emod_api.config.default_from_schema_no_validation module¶
-
emod_api.config.default_from_schema_no_validation.
schema_to_config_subnode
(schema_path_in, subnode_list)¶ This is the code from regular schema_to_config:
config = json.load(open(“default_config.json”), object_hook=s2c.ReadOnlyDict) os.remove( “default_config.json” )
-
emod_api.config.default_from_schema_no_validation.
get_default_config_from_schema
(path_to_schema, schema_node=True, as_rod=False)¶ This returns a default config object as defined from reading a schema file.
-
emod_api.config.default_from_schema_no_validation.
write_default_from_schema
(path_to_schema, output_filename='default_config.json', schema_node=True)¶ 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.
-
emod_api.config.default_from_schema_no_validation.
load_default_config_as_rod
(config)¶ - Parameters
config (string/path) – path to default or base config.json
- Returns
config (as ReadOnlyDict) with schema ready for schema-verified param sets.
-
emod_api.config.default_from_schema_no_validation.
get_config_from_default_and_params
(config_path, set_fn)¶ 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
config_path (string/path) – Path to valid config.json
set_fn (function) – Callback that sets params with implicit schema enforcement.
- Returns
dict
- Return type
config
-
emod_api.config.default_from_schema_no_validation.
write_config_from_default_and_params
(config_path, set_fn, config_out_path)¶ 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
config_path (string/path) – Path to valid config.json
set_fn (function) – Callback that sets params with implicit schema enforcement.
config_out_path – (string/path) Path to write new config.json
- Returns
Nothing