-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fixes for variable-based encoding in backends without step support #1484
Fixes for variable-based encoding in backends without step support #1484
Conversation
4f06786
to
5f98403
Compare
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 Franz for the updates!
Just curious, what happens READ_LINEAR is applied to an h5/json file?
In terms of allowing any format to write one step and throw error on second steps when writing variable based. It is totally logical. From a client prospective, I would prefer openPMD-api to throw error when someone init series with h5/json + variable based, instead of wait until the second step.
The openPMD side of the code would be simpler too.
READ_LINEAR can be used with all backends, but it does not do any parsing in the Especially, using READ_LINEAR and
Writing a single step with variable-based encoding is a useful feature for data that has no iterations. We throw no error here because this is a workflow that we explicitly and intentionally support. |
Thanks for the explanation. Maybe this behavior can be in the docs for future reference. |
It is documented here |
41281a8
to
96f5477
Compare
Snapshot attribute must be written in Iteration::endStep() in file-based encoding
This reverts commit ee8de45.
1) Don't write snapshot attributes during initialization of an iteration 2) Catch unsuccessful flush run also in beginStep()
96f5477
to
d8c9b51
Compare
d8c9b51
to
b0e9e0d
Compare
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.
Thank you for the report, updates and fixes!! 🚀 ✨
Ah, we should have squashed these commits for easier backporting :) next time, hope I got it right :) |
Close #1481
While working on the fix, I noticed a few other related issues. This PR contains workflow fixes for using variable-based encoding in backends that don't support IO steps:
Series::readIterations()
is a misleading name for this, so introduceSeries::parseBase()
as an alias.Series::readIterations()
returns a new iterator instance for each call. Since this iterator modifies the state of the Series, it only makes sense to have a single instance of it. Store that instance internally in the Series.snapshot
attribute atSeries::close()
time, but atIteration::close()
insteadAbstractIOHandler::flush()
setsm_lastFlushSuccessful
(otherwise, a failed next iteration might leak into the output during the destructor run)