Create a project
Objective
The goal of this tutorial is to learn about "projects" and "frames." All the commands of emodpy-workflow must be used within a "project". You will learn how to create a new project and the files that exist in a project. Most of the other commands require a "frame". A frame is an idea/scenario that involves changing parameters and/or code. You will learn how to create a frame in this tutorial.
Prerequisites
You must complete the setup and installation instructions before you can start this tutorial.
General command format
emodpy-workflow provides you with a collection of commands that allow you to perform the tasks of creating projects, running EMOD, calibrating, downloading data, and so on. To use a command, you must be in the top-level directory of your project and type the command similarly to the following:
Test that you can execute a command:
You should see output similar to the following:
If you see this, you are ready!!
Create your project
The 'new_project' command is use to create a new project directory. It is assumed that all of the other commands will be executed in this project directory.
Execute new_project command:
When the command is finished, you should see something similar to the following:
Explore what is in the project
Let's look into the directory that was just created and learn about what is in it and why.
-
Look at what is in our training directory by executing the following command:
You should see something similar to the following:
env- This folder is the one that contains our Python virtual environment. It contains all of the Python tools we need for running EMOD, plotting data, etc.my_project- This is the folder we just created with the new_project command. All future emodpy-workflow commands must be executed inside themy_projectfolder.
-
Look at what is in the project directory by executing the following commands:
You should see something similar to the following:
idmtools.ini- This file contains information about the computing platforms where you are running EMOD like where you want the simulation files to be created. The reference contains the details about this file.manifest.py- This file contains information about how you are running EMOD, like where the EMOD binary is stored and if you are using simulation post processing. The reference contains the details about this file.__init__.py- A normal Python file that defines the folder as a Python package.__pycache__- This folder is created by Python to store compiled bytecode files for Python modules.
Create a baseline "frame"
In emodpy-workflow, a "frame" is used to define a collection of parameters and code. This collection could be your definition of a scenario, like vaccinating people for HIV on their 15th birthday. See the reference for more information.
Before you start creating new scenarios, you will want to create the frame that you will consider as your "baseline." This is a scenario too, but it will be the scenario that you will compare everything to. Typically, you setup the baseline to be the standard country model.
-
Execute the following to see the options of the 'new_frame' command:
You should see something similar to the following:
For this tutorial, we will use the country model called "ZambiaForTraining" and will name this frame "baseline".
-
Execute the following to create the "baseline" frame
When the command is finished, you should see output similar to the following:
-
Execute the following command to see that a new
framesdirectory has been createdYou should see something similar to the following:
-
Execute the following command to see what is in the
framesdirectory:You should see something similar to the following:
If you were to execute the
new_framecommand again or theextend_framecommand a new directory will be created in the frames directory with the name you give the frame. -
Execute the following command to see what is in the
baselinedirectory:You should see something similar to the following:
The
campaign.py,config.py, anddemographics.pyfiles give you hooks into how these different elements of an EMOD simulation are configured. When usingnew_frame, they will all default to what is defined in the country model, in this case,ZambiaForTraining. The__init__.pyfile contains the logic to tie them together for emodpy-workflow. More information on__init__.pycan be found in the reference. -
View the contents of these files.
Using a text editor, open these files and inspect their contents. In each file, you should see two methods:
initialize_XXX()get_campaign_XXX_calls()
where "XXX" is replaced with config, campaign, or demographics depending on the file. Depending on how you to modify the country model, these are the two methods that you will modify.
See the other tutorials on modifying the configuration:
Next up: Running your baseline frame
Try the Run EMOD next to run your new baseline frame.