emod_file
ClimateFiles
Bases: InputFilesList
Source code in emodpy/emod_file.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | |
gather_assets()
Gather assets for Climate files. Called by EMODTask.
Source code in emodpy/emod_file.py
read_config_file(config_path, asset_path)
Try to recreate the climate based on a given config file and an asset path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
path to the config |
required |
asset_path
|
str
|
path containing the assets |
required |
Source code in emodpy/emod_file.py
set_task_config(task)
Set the task Config. Set all the correct files for the climate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
EMODTask
|
Task to config. |
required |
Source code in emodpy/emod_file.py
DemographicsFiles
Bases: InputFilesList
Source code in emodpy/emod_file.py
add_demographics_from_dict(content, filename)
Add demographics from a dictionary object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
Dict
|
Dictionary Content. |
required |
filename
|
str
|
Filename to call demographics file. |
required |
Source code in emodpy/emod_file.py
add_demographics_from_files(absolute_path, filename=None)
Add demographics files into the demographics.assets from a file or from a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
absolute_path
|
str
|
Path to file, including the filename or folder. All .json files in the folder will be added as demographics files and used in the experiment. |
required |
filename
|
str
|
Optional filename. If not provided, the file name of source file will be used. |
None
|
Source code in emodpy/emod_file.py
set_task_config(task, extend=False)
Set the simulation level config. If extend is true, the demographics files are appended to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
EMODTask
|
The task to update. |
required |
extend
|
bool
|
If true, the demographics files are appended to the list. |
False
|
Source code in emodpy/emod_file.py
InputFilesList
Bases: AssetCollection
Source code in emodpy/emod_file.py
gather_assets()
MigrationFiles
Bases: InputFilesList
Source code in emodpy/emod_file.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
add_migration_from_file(migration_type, file_path, multiplier=1)
Add migration info from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
migration_type
|
MigrationTypes
|
Type of migration |
required |
file_path
|
str
|
Path to file |
required |
multiplier
|
float
|
Multiplier |
1
|
Source code in emodpy/emod_file.py
enable_migration()
Enables migration and sets the pattern if defined. If there are no other parameters, it also sets Enable_Migration_Heterogeneity to 0.
Source code in emodpy/emod_file.py
gather_assets()
Gather assets for Migration files. Called by EMODTask.
Source code in emodpy/emod_file.py
merge_with(mf, left_precedence=True)
Merge migration file with other Migration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mf
|
MigrationFiles
|
Other migration file to merge with. |
required |
left_precedence
|
bool
|
Does the current object have precedence or the other object? |
True
|
Source code in emodpy/emod_file.py
read_config_file(config_path, asset_path)
Try to recreate the migration based on a given config file and an asset path. Args: config_path: path to the config. asset_path: path containing the assets.
Source code in emodpy/emod_file.py
set_all_persisted()
set_task_config(task)
Update the task with the migration configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
EMODTask
|
Task to update |
required |
Source code in emodpy/emod_file.py
update_migration_pattern(migration_pattern, **kwargs)
Update migration pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
migration_pattern
|
MigrationPattern
|
Migration Pattern to use |
required |
**kwargs
|
Any
|
Additional migration parameters supplied as keyword
arguments (for example |
{}
|