emod_api.schema_to_class module

class emod_api.schema_to_class.ReadOnlyDict

Bases: collections.OrderedDict

set_schema(schema)

Add schema node.

to_file(config_name='config.json')

Write ‘clean’ config file out to disk as json. Param: config_name (defaults to ‘config.json’)

finalize()

Remove all params that are disabled by depends-on param being off and schema node.

emod_api.schema_to_class.get_default_for_complex_type(schema, idmtype)

This function used to be more involved and dumb but now it’s a passthrough to get_class_with_defaults. If this approach proves robust, it can probably be deprecated. Depends a bit on completeness of schema.

emod_api.schema_to_class.get_class_with_defaults(classname, schema_path=None)

Returns the default config for a datatype in the schema.