-
Notifications
You must be signed in to change notification settings - Fork 26
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
Append a Dataset of References #1135
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1135 +/- ##
==========================================
+ Coverage 88.89% 88.91% +0.01%
==========================================
Files 45 45
Lines 9844 9857 +13
Branches 2799 2802 +3
==========================================
+ Hits 8751 8764 +13
Misses 776 776
Partials 317 317 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Co-authored-by: Ryan Ly <[email protected]>
Co-authored-by: Ryan Ly <[email protected]>
Minor suggestion to a test. Looks good otherwise. |
I added a test that raises an unexpected error:
We just chatted in person, but just to note that you were going to take a look at it. |
@rly There may be a work around, but I think the problem below might be enough to just start the proxy idea.
When a user calls append on a reference, we build the root builder first. We then call Why isn't in the file? I am in append mode right? Let's ignore the reference for now, and just add the new baz. It works (sort of). When you read it back, the new baz is not there. We need to call write again. Once you do that it is there. That means when we try to create a reference, and it is looking for the new baz in the file only to find nothing because it is not added till write (which we never call during append). Earlier I said in conversation that you do not need to call write. That is half true. in my method prior (seen below), you do not need to call write to append to a dataset of references, but you do need to call write to add a new baz because it itself is a new group. Earlier I had
This leads to a reference being created, but not found with the test Note: yes this is the same code from hdmf-zarr. I started to wonder if this could just be in hdmf because the append calls _create_ref which means all we need to do is have unique |
I see. Tricky indeed. You can't create an HDF5 reference to an object that isn't in the file yet, and rebuilding the whole hierarchy on each append is not ideal. A proxy makes sense. I can't think of another workaround without severely limiting and documenting the ways in which you cannot append.
That sounds useful to look into. You may be able to refactor it and some fields into the base |
Add documentation here: NeurodataWithoutBorders/pynwb#1951 |
Co-authored-by: Ryan Ly <[email protected]>
Co-authored-by: Ryan Ly <[email protected]>
Motivation
What was the reasoning behind this change? Please explain the changes briefly.
How to test the behavior?
Checklist
CHANGELOG.md
with your changes?