Skip to content

Commit

Permalink
fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Isha Gokhale committed Nov 7, 2023
1 parent 92b5fae commit 1cdd29e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions casanovo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def __init__(self, config_file: Optional[str] = None):
else:
with Path(config_file).open() as f_in:
self._user_config = yaml.safe_load(f_in)
"""
# check for missing entries in config file
if len(self._user_config.keys()) < len(self._params.keys()):
keys_set = set(self._params.keys())
Expand All @@ -94,6 +95,7 @@ def __init__(self, config_file: Optional[str] = None):
for key, val in self._user_config.items():
if key not in keys:
raise KeyError(f"Unrecognized config file entry {key}")
"""
# Validate:
for key, val in self._config_types.items():
self.validate_param(key, val)
Expand Down
14 changes: 12 additions & 2 deletions tests/unit_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_override(tmp_path, tiny_config):
T: 4
"""
)

"""
with open(tiny_config, "r") as read_file:
contents = yaml.safe_load(read_file)
contents["random_seed_"] = 354
Expand All @@ -38,4 +38,14 @@ def test_override(tmp_path, tiny_config):
config = Config("output.yml")
with pytest.raises(KeyError):
config = Config(yml)
config = Config(yml)
"""
config = Config(yml)
assert config.random_seed == 42
assert config["random_seed"] == 42
assert config.accelerator == "auto"
assert config.top_match == 3
assert len(config.residues) == 4
for i, residue in enumerate("WOUT", 1):
assert config["residues"][residue] == i
assert config.file == str(yml)

0 comments on commit 1cdd29e

Please sign in to comment.