tardis.io.configuration.config_reader module¶
- class tardis.io.configuration.config_reader.ConfigWriterMixin(*args, **kwargs)[source]¶
Bases:
HDFWriterMixin
Overrides HDFWriterMixin to obtain HDF properties from configuration keys
- class tardis.io.configuration.config_reader.Configuration(config_dict)[source]¶
Bases:
ConfigurationNameSpace
,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'¶
- static parse_convergence_section(convergence_section_dict)[source]¶
Parse the convergence section dictionary
- Parameters:
- convergence_section_dictdict
dictionary
- static validate_model_section(model_section)[source]¶
Parse the model section dictionary
- Parameters:
- model_sectiondict
- exception tardis.io.configuration.config_reader.ConfigurationError[source]¶
Bases:
ValueError
- class tardis.io.configuration.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