Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwfrost committed Sep 27, 2018
0 parents commit 2533e9b
Show file tree
Hide file tree
Showing 376 changed files with 37,575 additions and 0 deletions.
134 changes: 134 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Jekyll
_site/

# XPP
*.ode

# C
*.o
*.c
*.cpp

# Fortran
*.f

# R
*.Rhistory
Rplots.pdf

# Result files
*.out

# VFGEN
*.vf

# Matlab
*.m

# Scilab
*.sci
1 change: 1 addition & 0 deletions CNAME.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
epirecip.es/epicookbook
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM sdwfrost/epirecipes:latest

LABEL maintainer="Simon Frost <[email protected]>"

27 changes: 27 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!

gem "github-pages", group: :jekyll_plugins
gem 'jekyll-redirect-from'

# If you want to use Jekyll native, uncomment the line below.
# To upgrade, run `bundle update`.

# gem "jekyll"

gem "wdm", "~> 0.1.0" if Gem.win_platform?

# If you have any plugins, put them here!
group :jekyll_plugins do
# gem "jekyll-archives"
gem "jekyll-feed"
gem 'jekyll-sitemap', :github => 'jekyll/jekyll-sitemap', :branch => 'master'
end
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Chris Holdgraf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: help textbook clean serve

help:
@echo "Please use 'make <target>' where <target> is one of:"
@echo " textbook to convert the `notebooks/` folder into Jekyll markdown in `chapters/`"
@echo " clean to clean out site build files"
@echo " runall to run all notebooks in-place, capturing outputs with the notebook"
@echo " serve to serve the repository locally with Jekyll"

textbook:
python scripts/generate_textbook.py

runall:
python scripts/execute_all_notebooks.py

clean:
python scripts/clean.py

serve:
bundle exec jekyll serve
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# epicookbook

This repository / website is based on a template for hosting a textbook using
Jupyter Notebooks and Jekyll.
76 changes: 76 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
require "bundler/gem_tasks"
require "jekyll"
require "listen"

def listen_ignore_paths(base, options)
[
/_config\.ya?ml/,
/_site/,
/\.jekyll-metadata/
]
end

def listen_handler(base, options)
site = Jekyll::Site.new(options)
Jekyll::Command.process_site(site)
proc do |modified, added, removed|
t = Time.now
c = modified + added + removed
n = c.length
relative_paths = c.map{ |p| Pathname.new(p).relative_path_from(base).to_s }
print Jekyll.logger.message("Regenerating:", "#{relative_paths.join(", ")} changed... ")
begin
Jekyll::Command.process_site(site)
puts "regenerated in #{Time.now - t} seconds."
rescue => e
puts "error:"
Jekyll.logger.warn "Error:", e.message
Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
end
end
end

task :preview do
base = Pathname.new('.').expand_path
options = {
"source" => base.join('test').to_s,
"destination" => base.join('test/_site').to_s,
"force_polling" => false,
"serving" => true,
"theme" => "minimal-mistakes-jekyll"
}

options = Jekyll.configuration(options)

ENV["LISTEN_GEM_DEBUGGING"] = "1"
listener = Listen.to(
base.join("_data"),
base.join("_includes"),
base.join("_layouts"),
base.join("_sass"),
base.join("assets"),
options["source"],
:ignore => listen_ignore_paths(base, options),
:force_polling => options['force_polling'],
&(listen_handler(base, options))
)

begin
listener.start
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options["source"]}'"

unless options['serving']
trap("INT") do
listener.stop
puts " Halting auto-regeneration."
exit 0
end

loop { sleep 1000 }
end
rescue ThreadError
# You pressed Ctrl-C, oh my!
end

Jekyll::Commands::Serve.process(options)
end
50 changes: 50 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Summary

* [Simple deterministic models](notebooks/simple.md)
* [SIR model](notebooks/sir/intro.md)
* [Python using SciPy](notebooks/sir/python.ipynb)
* [R using deSolve](notebooks/sir/r_desolve.ipynb)
* [R using odin](notebooks/sir/r_odin.ipynb)
* [Julia](notebooks/sir/julia.ipynb)
* [Octave](notebooks/sir/octave.ipynb)
* [Scilab](notebooks/sir/scilab.ipynb)
* [C++](notebooks/sir/cpp.ipynb)
* [xppaut](notebooks/sir/xpp.ipynb)
* [VFGEN](notebooks/sir/vfgen.ipynb)
* [Javascript](notebooks/sir/js.ipynb)
* [Javascript using Observable](notebooks/sir/js_observable.md)
* [Simple stochastic models](notebooks/stochastic.md)
* [Continuous time](notebooks/sir-stochastic-discretestate-continuoustime/intro.md)
* [R](notebooks/sir-stochastic-discretestate-continuoustime/r.ipynb)
* [R using GillespieSSA](notebooks/sir-stochastic-discretestate-continuoustime/r-gillespiessa.ipynb)
* [R using Rcpp](notebooks/sir-stochastic-discretestate-continuoustime/r-rcpp.ipynb)
* [Julia](notebooks/sir-stochastic-discretestate-continuoustime/julia.ipynb)
* [Discrete time](notebooks/sir-stochastic-discretestate-discretetime/intro.md)
* [R using POMP](notebooks/sir-stochastic-discretestate-discretetime/r_pomp.ipynb)
* [R using LibBi](notebooks/sir-stochastic-discretestate-discretetime/r_rbi.ipynb)
* [Julia](notebooks/sir-stochastic-discretestate-discretetime/julia.ipynb)
* [Final size of an epidemic](notebooks/finalsize.md)
* [Exact recursive expressions](notebooks/blackross2015/intro.md)
* [Original Matlab code](notebooks/blackross2015/matlab.md)
* [Julia](notebooks/blackross2015/julia.ipynb)
* [Octave](notebooks/blackross2015/octave.ipynb)
* [Scilab](notebooks/blackross2015/scilab.ipynb)
* [Time-varying parameters](notebooks/timevarying.md)
* [Seasonally forced deterministic model](notebooks/sirforced/intro.md)
* [R](notebooks/sirforced/r.ipynb)
* [Network models](notebooks/network.md)
* [An edge based SIR model on a configuration network](notebooks/sircn/intro.md)
* [R](notebooks/sircn/r.ipynb)
* [Applications](notebooks/applications.md)
* [Acute HIV infection](notebooks/acutehiv/intro.md)
* [R](notebooks/acutehiv/r.ipynb)
* [A model of HIV with two risk groups](notebooks/diffrisk/intro.md)
* [R](notebooks/diffrisk/r.ipynb)
* [Keeling and Rohani 2008](notebooks/kr08.md)
* [Program 2.1](notebooks/kr08/2_1/intro.md)
* [Original C](notebooks/kr08/2_1/c_original.ipynb)
* [Original Fortran](notebooks/kr08/2_1/fortran_original.ipynb)
* [Original Python](notebooks/kr08/2_1/python_original.ipynb)
* [Original Matlab/Octave](notebooks/kr08/2_1/octave_original.ipynb)
* [Appendices](notebooks/appendices.md)
* [Style guide for notebooks](notebooks/style.md)
13 changes: 13 additions & 0 deletions _chapters/acutehiv/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Acute HIV infection'
permalink: 'chapters/acutehiv/intro'
previouschapter:
url: chapters/applications
title: 'Applications'
nextchapter:
url: chapters/acutehiv/r
title: 'R'
redirect_from:
- 'chapters/acutehiv/intro'
---
## A model of acute HIV infection
Loading

0 comments on commit 2533e9b

Please sign in to comment.