Running stuff
A couple of methods used in run_simulation.py
Contains some useful methods that get used in run_simulation_2.py
Functions:
Name | Description |
---|---|
print_attributes |
Recursively prints the attributes of an object. |
set_random_seed |
Sets global seed infections for testing purposes. |
str_to_bool |
interprets strings saying "true" as a bool object, and all other strings as false. |
parse_arguments(description='Default run_simulation_2.py')
Parse arguments given to run_simulation.py
Sets tons of defaults here. This is almost like a configuration file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
description
|
str
|
(Default value = 'Default run_simulation_2.py') |
'Default run_simulation_2.py'
|
Source code in june/utils/running_stuff.py
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 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 65 66 67 68 |
|
print_attributes(obj, indent=0)
Recursively prints the attributes of an object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
|
required | |
indent
|
(Default value = 0) |
0
|
Source code in june/utils/running_stuff.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
quick_run_check(args)
Handles commands passed to the RunManager that do not require a full simulation setup.
Some of the arguments that can be passed to the parser when run_simulation is called do not require a full blown simulation. This is a quick step to deal with those before the bulky full simulations are required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args
|
|
required |
Source code in june/utils/running_stuff.py
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 |
|