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)[source]#

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, output_filename=None)[source]#

This returns a default config object as defined from reading a schema file.

Parameters:

output_filename (str) – if not None, the path to write the loaded config to

emod_api.config.default_from_schema_no_validation.write_default_from_schema(path_to_schema, output_filename='default_config.json', schema_node=True)[source]#

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.

emod_api.config.default_from_schema_no_validation.load_default_config_as_rod(config)[source]#
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=None, set_fn=None, config=None, verbose=False)[source]#

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:
  • config_path (string/path) – Path to valid config.json

  • config – read-only dict configuration object. Pass this XOR the config_path.

  • set_fn (function) – Callback that sets params with implicit schema enforcement.

Returns:

read-only 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)[source]#

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