Skip to content

Commit

Permalink
Merge pull request #164 from wkerzendorf/config/toggle_validation
Browse files Browse the repository at this point in the history
Config/toggle validation
  • Loading branch information
orbitfold committed Aug 6, 2014
2 parents f3a68bf + ad850db commit b28ffbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions tardis/io/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def from_yaml(cls, fname, test_parser=False):

@classmethod
def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
config_definition_file=None):
config_definition_file=None, validate=True):
"""
Validating and subsequently parsing a config file.
Expand All @@ -759,6 +759,9 @@ def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
path to config definition file, if `None` will be set to the default
in the `data` directory that ships with TARDIS
validate: ~bool
Turn validation on or off.
Returns
-------
Expand All @@ -771,9 +774,11 @@ def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
config_definition_file = default_config_definition_file

config_definition = yaml.load(open(config_definition_file))

validated_config_dict = ConfigurationValidator(config_definition,
if validate:
validated_config_dict = ConfigurationValidator(config_definition,
config_dict).get_config()
else:
validated_config_dict = config_dict

#First let's see if we can find an atom_db anywhere:
if test_parser:
Expand Down

0 comments on commit b28ffbf

Please sign in to comment.