EMOD_functions.py
CfgFn
Obtained from IDM’s emodpy-snt framework that had been modified for bf-seasonal https://github.com/numalariamodeling/bf-seasonal/blob/main/sweeping.py
Sweeping utility: works for sweeping on config parameters. Requirements: - func is a method that takes config as first parameter - func return a dict
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
ItvFn
Obtained from IDM’s emodpy-snt framework that had been modified for bf-seasonal https://github.com/numalariamodeling/bf-seasonal/blob/main/sweeping.py
Sweeping utility: works for sweeping on interventions. Requirements: - func is a method that takes campaign as first parameter - func return a dict
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
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 381 |
|
SwpFn
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
Source code in EMOD\functions\EMOD_functions.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
|
all_campaigns(camp, exp=None, row=None, intervention_list=[])
Defines and adds various interventions and campaigns to be included in the campaigns.json
for EMOD.
The function serves as a wrapper that conditionally applies different campaigns based on the values in
the provided row
(e.g., from a scenario DataFrame), experiment configuration (exp
), and the
intervention_list
parameter.
Parameters: |
|
---|
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
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 |
|
build_burnin_df(exp_id, platform, serialize_days)
Builds a DataFrame containing information about serialized files and simulation configurations
for the burn-in process of the experiment.
The serialized population filenames are in the format: state-{step}-{core}.dtk
, where {step}
refers to
the serialization timestep and {core}
refers to the core number.
The Serialized_Population_Filenames
field varies based on the number of cores used. For example,
if Num_Cores = 2
, the filenames will look like this: state-00050-000.dtk
and state-00050-001.dtk
.
Parameters: |
|
---|
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 |
|
climate_setup(task, seasonality=None)
The function sets up the climate input filenames for EMOD.
Parameters: |
|
---|
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
create_sim_directory_map(exp_id, platform)
Return a dataframe which contains simulation's working_path and tags.
Args: exp_id: experiment id platform: idmtools platform Returns: dataframe
Source code in EMOD\functions\EMOD_functions.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
|
get_burnin_exp_name(serialized_df)
Retrieve the name of the EMOD burnin experiment from the metadata.json file Args: serialized_df (DataFrame): A pandas DataFrame containing serialized data information. Returns: str: The name of the burnin experiment as defined in the serialization df from emod_serialized_id.
Source code in EMOD\functions\EMOD_functions.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
get_scendf_burnin(exp, emod_serialized_id, manifest, platform, burnin)
Load the scenarios.csv file associated with the EMOD burnin experiment.
Parameters: |
|
---|
Returns: pandas.DataFrame: A DataFrame containing scenarios from the burn-in experiment.
Source code in EMOD\functions\EMOD_functions.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
get_workdir_from_simulations(platform, comps_simulations)
Get COMPS filepath Args: platform: idmtools Platform comps_simulations: COMPS Simulations Returns: dictionary with simid as key and filepath as value
Source code in EMOD\functions\EMOD_functions.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
habitat_setup(config, exp, row)
Sets up the habitat parameters for malaria vector species in EMOD, based on the climate seasonality and experiment configuration. The function configures different habitat types (“CONSTANT” or “TEMPORARY_RAINFALL”) and larval capacity based on the seasonality condition (‘perennial’ or ‘seasonal’) for the specified malaria species (gambiae).
Parameters: |
|
---|
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
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 |
|
set_inputEIR_seasonality(camp, EIR_scale_factor=1, seasonality='perennial')
Set input EIR (Entomological Inoculation Rate) based on seasonality.
Parameters: - camp: Campaign object from EMOD. - EIR_scale_factor: Scaling factor for EIR (default is 1). - seasonality: Type of seasonality, either ‘perennial’ or ‘seasonal’ (default is ‘perennial’).
Returns: A dictionary containing the EIR scale factor and the specified seasonality.
Source code in EMOD\functions\forcedEIR.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
set_param(simulation, param, value)
Set specific parameter value Args: simulation: idmtools Simulation param: parameter value: new value Returns: dict
Source code in EMOD\functions\EMOD_functions.py
67 68 69 70 71 72 73 74 75 76 77 |
|
sweep_functions(simulation, func_list)
Obtained from IDM’s emodpy-snt framework that had been modified for bf-seasonal https://github.com/numalariamodeling/bf-seasonal/blob/main/sweeping.py
Apply funcs on simulation. Args: simulation: idmtools Simulation func_list: a list of functions
Returns: |
|
---|
Source code in EMOD\functions\EMOD_functions.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
treatment_camp_simple(camp, cm_start, cm_clinical, cm_severe)
This function helps us establish treatment seeking behavior in an EMOD simulation.
Parameters: - camp: Campaign object from EMOD. - cm_start: Day when the treatment campaign starts. - cm_clinical: Clinical case coverage (float). - cm_severe: Severe case coverage (float).
Returns: A dictionary containing the start day of the treatment campaign, clinical case coverage, and severe case coverage.
Source code in EMOD\functions\interventions.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
update_mab(simulation, value)
Update the Maternal Antibody Protection parameter within the simulation.
Parameters: |
|
---|
Returns: |
|
---|
Source code in EMOD\functions\forcedEIR.py
12 13 14 15 16 17 18 19 20 21 22 23 24 |
|