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
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
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
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
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.