-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 416 - Parallelise evidence string generation #421
Issue 416 - Parallelise evidence string generation #421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
def dump_to_file(self, dir_out, filename=COUNTS_FILE_NAME): | ||
with open(os.path.join(dir_out, filename), 'w') as f: | ||
yaml.safe_dump(vars(self), f) | ||
|
||
def load_from_file(self, filename): | ||
with open(filename, 'r') as f: | ||
data = yaml.safe_load(f) | ||
self.__dict__.update(**data) | ||
# yaml loads a dict, convert to counter | ||
self.unmapped_trait_names = Counter(self.unmapped_trait_names) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say that pickling the objet might be safer but I 'm guessing that you want to use the final output yaml elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was thinking having it in yaml might be more readable and flexible for downstream purposes (e.g. updating the metrics or generating sankey diagrams), but it's probably overkill if those processes end up implemented in Python anyway... I'd probably keep it as it is for now.
Counts from test run match last submission, aside from a very silly error that I just fixed. |
Closes #416
Closes #420