emodpy.emod_file module#

class emodpy.emod_file.InputFilesList(relative_path=None)[source]#

Bases: AssetCollection

abstract set_task_config(simulation)[source]#
gather_assets() List[Asset][source]#

Gather input files for Input File List

Returns:

class emodpy.emod_file.MigrationTypes(value)[source]#

Bases: Enum

An enumeration.

LOCAL = 'Local'#
AIR = 'Air'#
FAMILY = 'Family'#
REGIONAL = 'Regional'#
SEA = 'Sea'#
class emodpy.emod_file.MigrationModel(value)[source]#

Bases: Enum

An enumeration.

NO_MIGRATION = 'NO_MIGRATION'#
FIXED_RATE_MIGRATION = 'FIXED_RATE_MIGRATION'#
class emodpy.emod_file.MigrationPattern(value)[source]#

Bases: Enum

An enumeration.

RANDOM_WALK_DIFFUSION = 'RANDOM_WALK_DIFFUSION'#
SINGLE_ROUND_TRIPS = 'SINGLE_ROUND_TRIPS'#
WAYPOINTS_HOME = 'WAYPOINTS_HOME'#
class emodpy.emod_file.MigrationFiles(relative_path=None)[source]#

Bases: InputFilesList

enable_migration()[source]#

Enables migration and sets the pattern if defined. If there are not other other parameters, it also set Enable_Migration_Heterogeneity to 0

update_migration_pattern(migration_pattern: MigrationPattern, **kwargs) NoReturn[source]#

Update migration pattern

Parameters:
  • migration_pattern – Migration Pattern to use

  • **kwargs

Returns:

NoReturn

add_migration_from_file(migration_type: MigrationTypes, file_path: str, multiplier: float = 1)[source]#

Add migration info from a file

Parameters:
  • migration_type – Type of migration

  • file_path – Path to file

  • multiplier – Multiplier

Returns:

set_task_config(task: EMODTask)[source]#

Update the task with the migration configuration

Parameters:

task – Task to update

Returns:

gather_assets()[source]#

Gather assets for Migration files. Called by EMODTask Returns:

set_all_persisted()[source]#

Set akk migration assets as persisted

Returns:

merge_with(mf: MigrationFiles, left_precedence: bool = True) NoReturn[source]#

Merge migration file with other Migration file

Parameters:
  • mf – Other migration file to merge with

  • left_precedence – Does the current object have precedence or the other object?

Returns:

read_config_file(config_path, asset_path)[source]#

Try to recreate the migration based on a given config file and an asset path :param config_path: path to the config :param asset_path: path containing the assets

class emodpy.emod_file.DemographicsFiles(relative_path=None)[source]#

Bases: InputFilesList

set_task_config(task: EMODTask, extend: bool = False)[source]#

Set the simulation level config. If extend is true, the demographics files are appended to the list :param task: :param extend:

Returns:

add_demographics_from_file(absolute_path: str, filename: str | None = None)[source]#

Add demographics from a file

Parameters:
  • absolute_path – Path to file

  • filename – Optional filename. If not provided, the file name of source file will be used

Returns:

add_demographics_from_dict(content: Dict, filename: str)[source]#

Add demographics from a dictionary object

Parameters:
  • content – Dictionary Content

  • filename – Filename to call demographics file

Returns:

class emodpy.emod_file.ClimateFileType(value)[source]#

Bases: Enum

An enumeration.

AIR_TEMPERATURE = 'Air_Temperature'#
LAND_TEMPERATURE = 'Land_Temperature'#
RELATIVE_HUMIDITY = 'Relative_Humidity'#
RAINFALL = 'Rainfall'#
class emodpy.emod_file.ClimateModel(value)[source]#

Bases: Enum

An enumeration.

CLIMATE_OFF = 'CLIMATE_OFF'#
CLIMATE_CONSTANT = 'CLIMATE_CONSTANT'#
CLIMATE_KOPPEN = 'CLIMATE_KOPPEN'#
CLIMATE_BY_DATA = 'CLIMATE_BY_DATA'#
class emodpy.emod_file.ClimateFiles[source]#

Bases: InputFilesList

set_task_config(task: EMODTask)[source]#

Set the task Config. Set all the correct files for the climate.

Parameters:

task – Task to config

add_climate_files(file_type, file_path)[source]#
gather_assets()[source]#

Gather assets for Climate files. Called by EMODTask

set_climate_constant(Base_Air_Temperature, Base_Rainfall, Base_Land_Temperature=None, Base_Relative_Humidity=None)[source]#
read_config_file(config_path, asset_path)[source]#

Try to recreate the climate based on a given config file and an asset path :param config_path: path to the config :param asset_path: path containing the assets