default_from_schema_no_validation
get_config_from_default_and_params(config_path=None, set_fn=None, config=None, verbose=False)
Use this function to create a valid config.json file from a schema-derived base config, a callback that sets your parameters of interest
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_path
|
string / path
|
Path to valid config.json |
None
|
set_fn
|
function
|
Callback that sets params with implicit schema enforcement. |
None
|
config
|
ReadOnlyDict
|
Read-only dict configuration object. Pass this XOR the config_path. |
None
|
verbose
|
bool
|
Flag to print debug statements |
False
|
Returns:
Name | Type | Description |
---|---|---|
config |
ReadOnlyDict
|
read-only dict |
Source code in emod_api/config/default_from_schema_no_validation.py
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 |
|
get_default_config_from_schema(path_to_schema, schema_node=True, as_rod=False, output_filename=None)
This returns a default config object as defined from reading a schema file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_filename
|
str
|
if not None, the path to write the loaded config to |
None
|
Source code in emod_api/config/default_from_schema_no_validation.py
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 |
|
load_default_config_as_rod(config)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
string / path
|
path to default or base config.json |
required |
Returns:
Type | Description |
---|---|
ReadOnlyDict
|
config (as ReadOnlyDict) with schema ready for schema-verified param sets. |
Source code in emod_api/config/default_from_schema_no_validation.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
write_config_from_default_and_params(config_path, set_fn, config_out_path, verbose=False)
Use this function to create a valid config.json file from a schema-derived base config, a callback that sets your parameters of interest, and an output path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_path
|
string / path
|
Path to valid config.json |
required |
set_fn
|
function
|
Callback that sets params with implicit schema enforcement |
required |
config_out_path
|
Union[str, PathLike]
|
Path to write new config.json |
required |
verbose
|
bool
|
Flag to print debug statements |
False
|
Returns:
Source code in emod_api/config/default_from_schema_no_validation.py
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 |
|
write_default_from_schema(path_to_schema, output_filename='default_config.json', schema_node=True)
DEPRECATED: This function simply calls get_default_config_from_schema with specific arguments.
This function writes out a default config file as defined from reading a schema file. It's as good as the schema it's given. Note that this is designed to work with a schema from a disease-specific build, otherwise it may contain a lot of params from other disease types.
Source code in emod_api/config/default_from_schema_no_validation.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|