emodpy-typhoid documentation

emodpy-typhoid is a collection of Python scripts and utilities created to streamline user interactions with EMOD and idmtools for modeling typhoid. Much of the functionality is inherited from the emod_api package and emodpy package.

Additional information about how to use idmtools can be found in Welcome to idmtools. Additional information about EMOD typhoid parameters can be found in EMOD parameter reference.

See Welcome to idmtools for a diagram showing how idmtools and each of the related packages are used in an end-to-end workflow using EMOD as the disease transmission model.

Installation prerequisites

First, ensure the following prerequisites are met before following the install instructions in emodpy-typhoid installation.

  • Windows 10 Pro or Enterprise, or Linux

  • Python 3.9 64-bit (https://www.python.org/downloads/release)

  • Git client, such as Git Bash or the Git GUI

  • pip.ini (Windows) or pip.conf (Linux), containing the following:

    [global]
    index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
    

emodpy-typhoid installation

Follow the steps below to install emodpy-typhoid.

Note

Currently, an IDM VPN connection is required to run the example.

  1. Open a command prompt and create a virtual environment in any directory you choose. The command below names the environment “v-emodpy-typhoid”, but you may use any desired name:

    python -m venv v-emodpy-typhoid
    
  2. Activate the virtual environment:

    • For Windows, enter the following:

      v-emodpy-typhoid\Scripts\activate
      
    • For Linux, enter the following:

      source v-emodpy-typhoid/bin/activate
      
  3. Install emodpy-typhoid packages:

    pip install emodpy_typhoid
    

    If you are on Linux, also run:

    pip install keyrings.alt
    
  4. Open a command prompt and clone the emodpy-typhoid GitHub repository to a local directory using the following command:

    git clone https://github.com/InstituteforDiseaseModeling/emodpy-typhoid.git
    
  5. Verify installation by running the included Python example, example.py, located in /examples/start_here:

    python example.py
    

    Upon completion you can view the results in COMPS.

  6. When you are finished, deactivate the virtual environment by entering the following at a command prompt:

    deactivate
    

API reference

emodpy_typhoid package

Subpackages

emodpy_typhoid.demographics package
Submodules
emodpy_typhoid.demographics.TyphoidDemographics module
class emodpy_typhoid.demographics.TyphoidDemographics.TyphoidDemographics(nodes, idref='Gridded world grump2.5arcmin', base_file=None)[source]

Bases: Demographics

This class is derived from emod_api.demographics’ Demographics class so that we can set certain defaults for Typhoid in construction. As we add other disease types, the generalizations and speicfics will become clearer.

emodpy_typhoid.demographics.TyphoidDemographics.fromBasicNode(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)[source]

This function creates a single-node TyphoidDemographics instance from the params you give it.

Parameters:
  • lat – latitude (not really used)

  • lon – longitude (not really used)

  • pop – population. Defaults to 1 million.

  • name – node name (not really used)

  • forced_id – node id (not really used)

Returns:

GENERIC_SIM demographics instance which can be customized and/or written to file.

emodpy_typhoid.demographics.TyphoidDemographics.from_template_node(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)[source]

Create a single-node TyphoidDemographics instance from the params you give it.

Parameters:
  • lat – latitude (not really used)

  • lon – longitude (not really used)

  • pop – population. Defaults to 1 million.

  • name – node name (not really used)

  • forced_id – node id (not really used)

Returns:

GENERIC_SIM demographics instance which can be customized and/or written to file.

emodpy_typhoid.demographics.TyphoidDemographics.from_params(tot_pop=1000000.0, num_nodes=100, frac_rural=0.3, id_ref='from_params')[source]

Create a multi-node typhoidDemographics instance as a synthetic population based on a few parameters.

Parameters:
  • tot_pop – The total human population in the node.

  • num_nodes – The number of nodes to create.

  • frac_rural – The fraction of the population that is rural.

  • id_ref – Method describing how the latitude and longitude values are created for each of the nodes in a simulation. “Gridded world” values use a grid overlaid across the globe at some arcsec resolution. You may also generate the grid using another tool or coordinate system.

Returns:

A typhoid instance.

emodpy_typhoid.demographics.TyphoidDemographics.from_csv(pop_filename_in, site='No_Site', min_node_pop=0)[source]

Create a multi-node TyphoidDemographics instance from a CSV file describing a population.

Parameters:
  • pop_filename_in – The path to the demographics file to ingest.

  • pop_filename_out – The path to the file to output.

  • site – A string to identify the country, village, or trial site.

Returns:

A MalariaDemographics instance.

emodpy_typhoid.interventions package
Submodules
emodpy_typhoid.interventions.outbreak module
emodpy_typhoid.interventions.outbreak.add_outbreak_individual(start_day: int = 1, demographic_coverage: float = 1.0, node_ids: list | None = None, repetitions: int = 1, timesteps_between_repetitions: int = 365, ind_property_restrictions: list | None = None)[source]
emodpy_typhoid.interventions.tcc module
emodpy_typhoid.interventions.tcc.new_intervention(camp, rate)[source]

TyphoidCarrierClear intervention wrapper.

emodpy_typhoid.interventions.tcc.new_triggered_intervention(camp, rate, start_day=1, triggers=['Births'], coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidCarrierClear when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.tcc.new_scheduled_intervention(camp, start_day=1, coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidCarrierClear when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.tcc.new_intervention_as_file(camp, start_day, filename=None)[source]
emodpy_typhoid.interventions.tcd module
emodpy_typhoid.interventions.tcd.new_intervention(camp, sensitivity=1.0, specificity=1.0, days_to_diag=1, pos_event='TestedPositive', tx_fraction=1.0)[source]

TyphoidCarrierDiagnostic intervention wrapper. Just the intervention. No configuration yet.

emodpy_typhoid.interventions.tcd.new_triggered_intervention(camp, start_day=1, triggers=['Births'], coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidCarrierDiagnostic when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.tcd.new_scheduled_intervention(camp, start_day=1, coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidCarrierDiagnostic when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.tcd.new_intervention_as_file(camp, start_day, filename=None)[source]
emodpy_typhoid.interventions.typhoid_vaccine module
emodpy_typhoid.interventions.typhoid_vaccine.new_intervention(camp, efficacy=0.82, mode='Shedding', constant_period=0, decay_constant=0, expected_expiration=0)[source]

Create a new TyphoidVaccine intervention with specified parameters. If you use this function directly, you’ll need to distribute the intervention with a function like ScheduledCampaignEvent or TriggeredCampaignEvent from emod_api.interventions.common.

Parameters:
  • camp (Camp) – The camp to which the intervention is applied.

  • efficacy (float, optional) – The efficacy of the Typhoid vaccine. Default is 0.82.

  • mode (str, optional) – The mode of the intervention. Default is “Shedding”.

  • constant_period (float, optional) – The constant period of the waning effect in days. Default is 0.

  • decay_constant (float, optional) – The decay time constant for the waning effect. Default is 6935.0.

  • expected_expiration (float, optional) – The mean duration before efficacy becomes 0. If this is set to non-zero value, the constant_period and decay_constant are ignored. These are two different modes of waning.

Returns:

A fully configured instance of the TyphoidVaccine intervention with the specified parameters.

Return type:

TyphoidVaccine

emodpy_typhoid.interventions.typhoid_vaccine.new_vax(camp, efficacy=0.82, mode='Acquisition', constant_period=0, decay_constant=0, expected_expiration=0, deduplication_policy='replace')[source]

Create a new ‘SimpleVaccine’ intervention with specified parameters. If you use this function directly, you’ll need to distribute the intervention with a function like ScheduledCampaignEvent or TriggeredCampaignEvent from emod_api.interventions.common.

Parameters:
  • camp (Camp) – The camp to which the intervention is applied.

  • efficacy (float, optional) – The efficacy of the Typhoid vaccine. Default is 0.82.

  • mode (str, optional) – The mode of the intervention. Default is “Acquisition” Can also be “Transmission” or “All”.

  • constant_period (float, optional) – The constant period of the waning effect in days. Default is 0.

  • decay_constant (float, optional) – The decay time constant for the waning effect. Default is 6935.0.

  • expected_expiration (float, optional) – The mean duration before efficacy becomes 0. If this is set to non-zero value, the constant_period and decay_constant are ignored. These are two different modes of waning.

  • deduplication_policy (string) – “replace” (default) or “combine”. If giving vax to someone who already has one, based on Intervention_Name which defaults to intervention classname (“SimpleVaccine”), “replace” will purge the existing one, and “combine” will add the new one without replacement, and rely on code and configuration to calculate the combinatorix. If using “combine”, make sure you _know_ the combinatorix.

Returns:

A fully configured instance of the SimpleVaccine intervention with the specified parameters.

Return type:

SimpleVaccine

emodpy_typhoid.interventions.typhoid_vaccine.new_triggered_intervention(camp, efficacy=0.82, mode='Shedding', constant_period=0, decay_constant=6935.0, start_day=1, triggers=['Births'], coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Create a new triggered TyphoidVaccine intervention based on specified parameters.

Parameters:
  • camp (Camp) – The camp to which the intervention is applied.

  • efficacy (float, optional) – The efficacy of the Typhoid vaccine. Default is 0.82.

  • mode (str, optional) – The mode of the intervention. Default is “Shedding”.

  • constant_period (float, optional) – The constant period of the waning effect in days. Default is 0.

  • decay_constant (float, optional) – The decay time constant for the waning effect. Default is 6935.0.

  • start_day (int, optional) – The day on which the intervention starts. Default is 1.

  • triggers (list, optional) – List of triggers for the intervention. Default is [“Births”].

  • coverage (float, optional) – Demographic coverage of the intervention. Default is 1.0.

  • node_ids (list, optional) – List of node IDs where the intervention is applied. Default is None.

  • property_restrictions_list (list, optional) – List of property restrictions for the intervention. Default is an empty list.

  • co_event – The name of the event to be broadcast. This event name can be set in the Report_Event_Recorder_Events configuration parameter. It will be collected in ReportEventRecorder.csv with default event “VaccineDistributed”.

emodpy_typhoid.interventions.typhoid_vaccine.new_routine_immunization(camp, efficacy=0.82, mode='Acquisition', constant_period=0, decay_constant=0, expected_expiration=0, start_day=1, child_age=270, coverage=1.0, node_ids=None, property_restrictions_list=[], co_event='VaccineDistributed')[source]

Create a new delayed, birth-triggered SimpleVaccine intervention based on specified parameters. Does not add to campaign.

Parameters:
  • camp (Camp) – The camp to which the intervention is applied.

  • efficacy (float, optional) – The efficacy of the Typhoid vaccine. Default is 0.82.

  • mode (str, optional) – The mode of the intervention. Default is “Shedding”.

  • constant_period (float, optional) – The constant period of the waning effect in days. Default is 0.

  • decay_constant (float, optional) – The decay time constant for the waning effect. Default is 6935.0.

  • expected_expiration (float, optional) – The mean duration before efficacy becomes 0. If this is set to non-zero value, the constant_period and decay_constant are ignored. These are two different modes of waning.

  • start_day (int, optional) – The day on which the intervention starts. Default is 1.

  • child_age (int, optional) – The age of the person when they get the vaccine. Defaults to 9 months. Vaccines are actually distribute +/- 7 days.

  • coverage (float, optional) – Demographic coverage of the intervention. Default is 1.0.

  • node_ids (list, optional) – List of node IDs where the intervention is applied. Default is None.

  • property_restrictions_list (list, optional) – List of property restrictions for the intervention. Default is an empty list.

  • co_event – The name of the event to be broadcast. This event name can be set in the Report_Event_Recorder_Events configuration parameter. It will be collected in ReportEventRecorder.csv with default event “VaccineDistributed” if not set with other name.

emodpy_typhoid.interventions.typhoid_vaccine.new_scheduled_intervention(camp, efficacy=0.82, mode='Shedding', constant_period=0, decay_constant=6935.0, start_day=1, coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Create a new scheduled TyphoidVaccine intervention based on specified parameters.

Parameters:
  • camp (Camp) – The camp to which the intervention is applied.

  • efficacy (float, optional) – The efficacy of the Typhoid vaccine. Default is 0.82.

  • mode (str, optional) – The mode of the intervention. Default is “Shedding”.

  • constant_period (float, optional) – The constant period of the waning effect in days. Default is 0.

  • decay_constant (float, optional) – The decay time constant for the waning effect. Default is 6935.0.

  • start_day (int, optional) – The day on which the intervention starts. Default is 1.

  • coverage (float, optional) – Demographic coverage of the intervention. Default is 1.0.

  • node_ids (list, optional) – List of node IDs where the intervention is applied. Default is None.

  • property_restrictions_list (list, optional) – List of property restrictions for the intervention. Default is an empty list.

  • co_event – The name of the event to be broadcast. This event name can be set in the Report_Event_Recorder_Events configuration parameter. It will be collected in ReportEventRecorder.csv if set not None or “”.

emodpy_typhoid.interventions.typhoid_vaccine.new_intervention_as_file(camp, start_day, filename=None)[source]
emodpy_typhoid.interventions.typhoid_wash module
emodpy_typhoid.interventions.typhoid_wash.new_intervention(camp, efficacy=1.0)[source]

TyphoidWASH intervention wrapper. Just the intervention. No configuration yet.

emodpy_typhoid.interventions.typhoid_wash.new_triggered_intervention(camp, start_day=1, triggers=['Births'], coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidWASH when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.typhoid_wash.new_scheduled_intervention(camp, start_day=1, coverage=1.0, node_ids=None, property_restrictions_list=[], co_event=None)[source]

Distribute TyphoidWASH when something happens as determined by a signal published from the model or another campaign event.

emodpy_typhoid.interventions.typhoid_wash.new_intervention_as_file(camp, start_day, filename=None)[source]
emodpy_typhoid.utility package
Submodules
emodpy_typhoid.utility.sweeping module
emodpy_typhoid.utility.sweeping.set_param(simulation: Simulation, param: str, value: Any) Dict[str, Any][source]

Set specific parameter value. :param simulation: idmtools Simulation :param param: parameter :param value: new value

Returns:

dict

emodpy_typhoid.utility.sweeping.sweep_functions(simulation: Simulation, func_list: List) Dict[str, Any][source]

Apply funcs on simulation. :param simulation: idmtools Simulation :param func_list: a list of functions

Returns:

dict of parameters

class emodpy_typhoid.utility.sweeping.ItvFn(func, *args, **kwargs)[source]

Bases: object

Sweeping utility: works for sweeping on interventions. Requirements: - func is a method that takes campaign as first parameter - func return a dict

Returns:

dict

class emodpy_typhoid.utility.sweeping.CfgFn(func, *args, **kwargs)[source]

Bases: object

Sweeping utility: works for sweeping on config parameters. Requirements: - func is a method that takes config as first parameter - func return a dict

Returns:

dict

class emodpy_typhoid.utility.sweeping.SwpFn(func, *args, **kwargs)[source]

Bases: object

Sweeping utility: works for sweeping on report, demographics, migrations and climate, etc. Requirements: - func is a method that takes task as first parameter - func return a dict

Returns:

dict

Submodules

emodpy_typhoid.config module
emodpy_typhoid.config.cleanup_for_2018_mode(config)[source]

Frequently asked questions

As you get started with emodpy-typhoid, you may have questions. The most common questions are answered below. The most common questions are answered below. For questions related to functionality in related packages, see the following documentation:

What are some of the key differences for people used to using dtk-tools?

  1. Schema-Based. The creation of config and campaign files is entirely schema-based now. This means that you can only set parameters that the binary you are using recognizes. And parameter types and ranges are enforced at runtime.

  2. Inter-File Dependencies Now Automatic. Before there were lots of parameters in the config that you had to set to correspond to settings in campaign or demographics files. That is no longer the case. We call these ‘implicits’. For example, if you add a BirthRate to the demographics, the corresponding parameters in the config.json (Enable_Births) will get set automatically for you. As another example, when you create a campaign and specify various ‘events’ to be broadcast/published and/or listened/subscribed to, you no longer have to figure out which ones are built-in and which are ad-hoc. It does that for you and populates the Custom_Events param on your behalf.

  3. Hierarchical Dependencies Now Automatic. If a parameter depends on another parameter, previously you had to set all the Enables in the dependency tree. Now they get set automatically for you. For example, if Enable_Birth is set (see above), Enable_Vital_Dynamics will be set for you.

  4. No JSON manipulation. dtk-tools worked primarily through manipulation of JSON that made up the configuration files. You no longer need to have any knowledge of the internal representation of data in the DTK input files. All configuration should be done via Python functions.

  5. Released and Installed Modules. We want users mostly using versioned released modules that have been pip installed, not git cloned, dev-installed code, except during development. The process of getting new code reviewed, tested, and getting the module versioned and released is intended to be smooth and efficient when everyone does their defined role. “Trust The Process and Do Your Job”, as someone once said.

  6. Blessed Binaries. In dtk-tools you would often BYOB – Bring Your Own Binary – but in emodpy, the idea is that the system pulls down the latest CI (Continuous Integration) build for your disease that passed all the tests. We very much want to noramlize the idea of doing research with versioned software that has come through our professional BVT processes.

Do I need to install a whole bunch of Python modules? Where do I get that list?

No. You should only have to install emodpy-typhoid, and everything else should come as a dependency automatically. If you are starting from a workflow repo, there should be a requirements.txt file that lists a particular version of emodpy-typhoid. Then ‘pip install -r requirements.txt’ is what you should expect to do.

Is there an easier way than typing –index-url with that long URL every time I use pip?

Yes. You should not be typing that every time. You should update the pip.ini (Windows) or pip.conf globally on your computer with that URL and never have to type it again.

How do I find the path or file to my pip.ini?

pip config -v list.

Choose the first or second one.

What if the pip.ini file (or pip folder) doesn’t exist?

Go ahead and create it (at one of the locations specified by ‘pip config -v list’). It’s your computer.

What’s the text I need to enter into my pip config file?

[global]
index-url = https://packages.idmod.org/api/pypi/pypi-production/simple

I was installing the Python modules and it told me I needed a C++ compiler?

This is because of a dependency in some versions of emod-api on lz4. lz4 usually comes as what’s called a source package and it has to be compiled as part of the install. This requires a compiler, which doesn’t come by default on Windows computers. At this point, if your pip.ini is set up properly, you should be able to get a pre-built lz4 package from our local Artifactory PIP server.

I was installing and got prompted for JFrog credentials.

You should not have to give credentials to use our JFrog/Artifactory/pip server. Credentials are required to get packages from the staging server. We don’t expect end users to be accessing packages from staging, just prod, which is auth-free.

What if I really actually do want to install something from staging?

You need to specify ‘–index-url = https://<username>@idmod.org:<shh…password>@packages.idmod.org/api/pypi/pypi-staging/simple’ and also provide your creds when prompted.

What version of Python should I be using?

At least Python 3.7.7. If you are installing a new version of Python, feel free to go all the way forward to a Python 3.9.x. 3.8 is probably the sweet spot of “known to work and still not considered old”.

What if I want a particular version of emodpy-typhoid?

pip install emodpy-typhoid==1.2.3

Should get you what you need.

What if I want to make changes to emodpy-typhoid and run with those, instead of a released version?

(This is a duplicate.)

There are a couple of ways of doing that. Option 1: Do a Dev Install:

pip install -e .

This will make your site packages map to your local code until you do a new pip install of the package.

Option 2: Creating a wheel from your local code and pip install it (each time you make a change).:

python setup.py bdist_wheel
pip3 install dist/<newly_create_file.whl>

Some people prefer option 1 because it’s “one and done”. Some people prefer option 2 because it keeps you thinking in terms of packaging, versioning, and installing even while you’re developing.

I pip installed emodpy-typhoid, but I want to make changes. How should I do that?

Install at a command prompt using the following:

python package_setup.py develop

This method is the most popular and proven, though there are some other options. Installing this way means that the emodpy-typhoid module in site-packages actually points to the same code as you have checked out in git. For more detail, see this Stack Overflow post.

However, we aim to get the desired changes quickly tested and included in the versioned module we release via pip install.

How do I set configuration parameters?

Define your own parameter-setting function such as set_param_fn and pass that function to the emodpy task creator as the param_custom_cb parameter. In that function, you can set the parameters directly. For example:


    print(f"Telling emod-api to use {manifest.schema_file} as schema.")
    camp.set_schema( manifest.schema_file )

    event = ob.new_intervention( camp, timestep=1, cases=1 )
    camp.add( event )
    return camp

def build_demog():
    """
    Build a demographics input file for the DTK using emod_api. 
    """
    import emodpy_typhoid.demographics.TyphoidDemographics as Demographics # OK to call into emod-api

    demog = Demographics.from_template_node( lat=0, lon=0, pop=10000, name=1, forced_id=1 )
    wb_births_df = pd.read_csv( manifest.world_bank_dataset )
    demog.SetEquilibriumVitalDynamicsFromWorldBank( wb_births_df=wb_births_df, country='Chile', year=2005 )
    return demog


def run_test():
    # Create a platform
    # Show how to dynamically set priority and node_group
    platform = Platform("SLURM", node_group="idm_48cores", priority="Highest") 

    task = EMODTask.from_default2(config_path="config.json", eradication_path=manifest.eradication_path, campaign_builder=build_camp, demog_builder=build_demog, schema_path=manifest.schema_file, param_custom_cb=set_param_fn, ep4_custom_cb=None)

    print("Adding asset dir...")

See examples/start_here/example.py. for additional information.

If you prefer something more modular, you can call a function in a standalone script/file that sets the configuration parameters.

Are there defaults?

Great question. If you don’t set any configuration parameters, they will have defaults based on the schema. The typhoid team has set team defaults in emodpy_typhoid.config.set_team_defaults(). These defaults can be seen in config.py.

How do I specify the log level for EMOD? I get a schema error when I try to set it now.

TBD

How do I specify the vector species for my scenario?

See the excerpt below or the complete example of setting the vector species and parameter values associated with each species in examples/start_here/example.py.


    print(f"Telling emod-api to use {manifest.schema_file} as schema.")
    camp.set_schema( manifest.schema_file )

    event = ob.new_intervention( camp, timestep=1, cases=1 )
    camp.add( event )
    return camp

def build_demog():
    """
    Build a demographics input file for the DTK using emod_api. 
    """
    import emodpy_typhoid.demographics.TyphoidDemographics as Demographics # OK to call into emod-api

    demog = Demographics.from_template_node( lat=0, lon=0, pop=10000, name=1, forced_id=1 )
    wb_births_df = pd.read_csv( manifest.world_bank_dataset )
    demog.SetEquilibriumVitalDynamicsFromWorldBank( wb_births_df=wb_births_df, country='Chile', year=2005 )
    return demog


def run_test():
    # Create a platform
    # Show how to dynamically set priority and node_group
    platform = Platform("SLURM", node_group="idm_48cores", priority="Highest") 

    task = EMODTask.from_default2(config_path="config.json", eradication_path=manifest.eradication_path, campaign_builder=build_camp, demog_builder=build_demog, schema_path=manifest.schema_file, param_custom_cb=set_param_fn, ep4_custom_cb=None)

    print("Adding asset dir...")

A helper function to make this task even easier may be coming shortly.

Where else should I search for functions?

Yes, emod-api. Any functionality that is not typhoid-specific (or disease-specific) will be found in emod-api. In particular you’ll probably find very useful functions for crafting campaigns in emod-api.interventions.common, such as the ScheduledCampaignEvent function and the TriggeredCampaignEvent function.

Do I need to be connected to the VPN?

The original way of procuring the model binary itself was via a call to get_model_files(). This required you to be VPN-ed in. This is no longer the preferred approach. Instead you will want to use the ‘bootstrap’ approach. This involves installing the emod_typhoid package, which should happen automatically, and using code like:

import emod_typhoid.bootstrap as dtk
dtk.setup(...)

This does not require VPN. The value you pass to setup is the path where the model files will be put.

Is there an example of creating a demographics file from scratch with the API?

Yes, see examples/create_demographics, there are also examples in emodpy-measles and emodpy-hiv. We are working to add some to emod_api.demographics. The basic idea is you use one of 3 node creators, and then use the Setter API to set up the node defaults for fertility, mortality, age structure, initial immunity, individual ‘risk’, and initial prevalance. The first node creator, from_template_node, is very basic and usually for quickstarts or toy models. It lets you create a single node demographics file with a given population. The second creator, from_csv, lets you create a multinode demographics using a csv file with population data as an input. The third creator, from_params, lets you create a multinode demographics without specific node data but instead with a few parameters that represent the overall population and the population heterogeneity.

I see a lot of MALARIA_SIM examples. Are there any VECTOR_SIM examples?

Yes! The following examples use VECTOR_SIM:

Is there a multi-node or spatial example?

Yes. See:

  • examples/migration_spatial_vector_sim

  • examples/migration_spatial_typhoid_sim

  • examples/jonr_1

Are there simple campaign/intervention examples?

Yes. See:

  • examples/outdoor_rest_kill_male_mosquitoes

  • examples/inputEIR

  • examples/ivermectin

Is there a drug campaign example?

Yes. See:

  • examples/drug_campaign

  • examples/diagnostic_survey

Is there a campaign sweep example?

Yes. See:

  • examples/campaign_sweep

Is there a demographics sweep example?

Yes. See:

  • examples/demographics_sweep

Is there a serialization/burn-in example?

Yes. See:

  • examples/burnin_create

  • examples/burnin_use

Is there a reporter configuration example?

Yes. See:

  • examples/add_reports

  • examples/filtered_report