tardis.io.config_reader module¶
- class tardis.io.config_reader.ConfigWriterMixin(*args, **kwargs)[source]¶
Bases:
tardis.io.util.HDFWriterMixin
Overrides HDFWriterMixin to obtain HDF properties from configuration keys
- class tardis.io.config_reader.Configuration(config_dict)[source]¶
Bases:
tardis.io.config_reader.ConfigurationNameSpace
,tardis.io.config_reader.ConfigWriterMixin
Tardis configuration class
- classmethod from_config_dict(config_dict, validate=True, config_dirname='')[source]¶
Validating and subsequently parsing a config file.
- Parameters
- config_dictdict
dictionary of a raw unvalidated config file
- validatebool
Turn validation on or off.
- Returns
- tardis.config_reader.Configuration
- classmethod from_yaml(fname, *args, **kwargs)[source]¶
Read a configuration from a YAML file
- Parameters
- fnamestr
filename or path
- hdf_name = 'simulation'¶
- exception tardis.io.config_reader.ConfigurationError[source]¶
Bases:
ValueError
- class tardis.io.config_reader.ConfigurationNameSpace(value=None)[source]¶
Bases:
dict
The configuration name space class allows to wrap a dictionary and adds utility functions for easy access. Accesses like a.b.c are then possible
Code from http://goo.gl/KIaq8I
- Parameters
- config_dictdict
configuration dictionary
- Returns
- config_nsConfigurationNameSpace
- classmethod from_config_dict(config_dict)[source]¶
Validating a config file.
- Parameters
- config_dictdict
dictionary of a raw unvalidated config file
- Returns
- tardis.config_reader.Configuration
- classmethod from_yaml(fname)[source]¶
Read a configuration from a YAML file
- Parameters
- fnamestr
filename or path
- tardis.io.config_reader.cns_representer(dumper, data)[source]¶
Represents Configuration as dict
- Parameters
- dumper :
YAML dumper object
- data :
ConfigurationNameSpace object
- Returns
- yaml dumper representation of Configuration as dict