Package: simfection
SimfectionSimfection is an open-source, stochastic, interactions-based infectious disease model.Getting StartedRequirementssimfectionhas only been tested with Python 3.7. To guarantee that your local environment can runsimfectionregardless of operating system, python version, etc., it is highly recommended that you use the official, fully functional docker image (see below).Click herefor instructions on getting Docker installed.Using the Official DockerFirst, pull the latest version of the docker image. This only needs to run once, unless there is a newer image available to download.dockerpullsimfection/simfection:latestRun the Docker ContainerNext, (1) run the docker container and detach, with (2) a port for the Jupyter notebooks, (3) a directory mount in the current working directory, (4,5) sudo access, (6) the namesimfection, and (7) the docker image to use with the initial command to start the Jupyter notebook kernel. This also only needs to be run once per image version.dockerrun-d\-p8888:8888\-v$(pwd)/simfection_run:/home/jovyan/simfection_run\--userroot\-eGRANT_SUDO=yes\--namesimfection\simfection/simfection:lateststart.shjupyternotebook--NotebookApp.token=''Test the Docker ContainerTo test the docker container, use the following code. You should the help output fromsimfection.dockerexecsimfectionbash-c'simfection -h'Starting/Stopping Docker ImageYou can stop thesimfectiondocker container withdocker stop simfection. This is similar to "turning off the machine".To start thesimfectiondocker container, issue the commaneddocker start simfection. You can now pass in a command.Pass a Command to thesimfectionDockerTo pass a single command-line command<COMMANDLINE COMMAND>to thesimfectioncontainer, issue the following:dockerexecsimfectionbash-c'<COMMANDLINE COMMAND>'Open an Interactive Shell in thesimfectionDockerTo open an interactive shell, issuedocker exec -it simfection bash.When you want to exit the interactive shell, issueexit.Jupyer Kernel Access via Web BrowserPoint your web browser tohttp://localhost:8888/.Installing from PyPIIt is recommended that you installsimfectionin a virtual environment. A great place to keep your virtual environments is in a$HOME/.venv/directory. (The.prefix makes the directoryhidden.) If you do not already have such a directory, (1) navigate to your home directory, (2) create it, and (3) enter into the directory.cd$HOME# $HOME may not be a defined variable for you. If not, navigate home.mkdir.venvcd.venvFirst, (1) create the a virtual environment calledsimfectionusing thevenvmodule. Next (2) activate the virtual environment and (3) installsimfection. Finally, (4) copy the command line executable to your main environment and (5) deactivate the birtual environment. (Note: you may need to change the final path/usr/local/binif you are running Windows.)python3-mvenvsimfectionsourcesimfection/bin/activate
pip3installsimfection
cpsimfection/bin/simfection/usr/local/bin/
deactivateInstallingsimfectioninto a virtual environment and then making it accessible from within your main environment avoids any version conflicts withsimfection's dependencies.Confirm InstallationTo confirm thatsimfectionwas successfully installed, executesimfection -hat command line. You should see a list of available parameters.To run the default parameters, executesimfectionat command line. You should output from the model print to your screen. When the run is finished, there will be a new directory calledsimfection_runin your current working directory.