-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fix autosave function for single core #770
Conversation
(applied black to history.py. should stop doing that 🐈⬛ ) |
Codecov Report
@@ Coverage Diff @@
## develop #770 +/- ##
============================================
+ Coverage 48.05% 89.84% +41.78%
============================================
Files 98 98
Lines 6829 6847 +18
============================================
+ Hits 3282 6152 +2870
+ Misses 3547 695 -2852
Continue to review full report at Codecov.
|
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.
Not entirely sure what you did in the testing files but looks like a more elegant way of creating temporary hdf5 files 👍
you mean that |
return False | ||
|
||
# extract storage type | ||
path = Path(storage_file) |
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.
👍
@@ -79,13 +86,13 @@ def check_history(self): | |||
if storage_type is not None: | |||
read_results_from_file( | |||
self.problem, self.history_options, | |||
len(result.optimize_result.list) + 2 | |||
n_starts=n_starts, |
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.
As indicated by the docstring here, having n_starts+2 was very much intentional
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.
ah missed the docstring 🙈 problem is that now the csv files each carry an id, therefore files with id=1,2 do not exist. Would it be desirable to allow passing a list of ids (/filenames) to read_results_from_file instead of the single n_starts? then this scenario could be covered here by [0, 0, 0]
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 guess silently reading the same file multiple times bc no id is present, is not desirable, unless explicitly requested, thus the {id} check.
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.
but the {id}
was there before. This is supposed to check whether read_results_from_file can handle missing files (optimization stopped before file was written, for whatever reason). If we do not wan't this behavior we should add a check whether read_results_from_file
fails when the file is not present.
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.
how did the {id} come in before? It's not in the original file name in 6d3226d#diff-80b64c062a6e89e507e7518b03d2cf45dc9518a824f39bae232b565e8e5016afL52, does it come in in processing somewhere?
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 thought it just read in the same file filename.csv 3 times in the previous test implementation, therefore all files existed. when adding {id}, then there was a trace is Null error or something.
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.
ah, I supposed the test didn't implement what I intended to then ;)
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.
will fix this in a separate PR
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.
thanks :) it confused me too then. so in conclusion I guess yes we want to be able to merge histories also when some ids are not present (maybe warn then).
Actual fix of #743 not done yet.