Skip to content

Commit

Permalink
Merge pull request #80 from ahalev/ahalev_from_yaml
Browse files Browse the repository at this point in the history
add from_yaml
  • Loading branch information
ahalev authored May 13, 2024
2 parents 9835d35 + cebec38 commit de3d6b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/expfig/namespacify.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ def serialize_to_dir(self, log_dir, fname='namespacify.yaml', use_existing_dir=F
def deserialize(cls, stream):
return cls(yaml.safe_load(stream))

@classmethod
def from_yaml(cls, filepath):
with open(filepath, 'r') as stream:
return cls.deserialize(stream)

def __dir__(self):
rv = set(super().__dir__())

Expand Down

0 comments on commit de3d6b7

Please sign in to comment.