Skip to content

Commit

Permalink
Remove unused load function in attrdict
Browse files Browse the repository at this point in the history
  • Loading branch information
irm-codebase committed Dec 3, 2024
1 parent 5eafc04 commit 3ba48a2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/calliope/attrdict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,6 @@ def __nonzero__(self):
_MISSING = __Missing()


def _yaml_load(src):
"""Load YAML from a file object or path with useful parser errors."""
yaml = ruamel_yaml.YAML(typ="safe")
if not isinstance(src, str):
try:
src_name = src.name
except AttributeError:
src_name = "<yaml stringio>"
# Force-load file streams as that allows the parser to print
# much more context when it encounters an error
src = src.read()
else:
src_name = "<yaml string>"
try:
result = yaml.load(src)
if not isinstance(result, dict):
raise ValueError(f"Could not parse {src_name} as YAML")
return result
except ruamel_yaml.YAMLError:
logger.error(f"Parser error when reading YAML from {src_name}.")
raise


class AttrDict(dict):
"""Extended `dict` class."""

Expand Down

0 comments on commit 3ba48a2

Please sign in to comment.