Draft
Investigation: Automatic reset_parent for cross-backend HDF5→Zarr exports requires HDMF core changes#311
Conversation
Co-authored-by: rly <310197+rly@users.noreply.github.com>
Co-authored-by: rly <310197+rly@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automatic reset_parent call for HDF5 export
Investigation: Automatic reset_parent for cross-backend HDF5→Zarr exports requires HDMF core changes
Dec 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Users adding HDF5 objects from one file to another and exporting to Zarr encounter cross-backend linking failures. The requested automatic
reset_parent()calls cannot be implemented in hdmf-zarr due to fundamental HDMF design constraints.Investigation Findings
Core Issue: HDMF's
container_sourceattribute is immutable once set. When objects from HDF5 file B are added to file A and exported to Zarr, they retaincontainer_sourcepointing to file B. HDMF's ObjectMapper detects this and attempts cross-backend links, which fail.Why Automatic Reset Fails:
reset_parent()only clearsparent, notcontainer_sourcecontainer_sourcereassignment to avoid data corruptionreset_parent()during export creates orphaned containers that fail validationRequired Solution: This needs HDMF core changes to either:
export=Trueand treat foreign containers as new objectsreset_for_export()API that can clear bothparentandcontainer_sourceHow to test the behavior?
The issue cannot be resolved in hdmf-zarr. See
INVESTIGATION_RESET_PARENT.mdfor detailed analysis including attempted solutions and code examples demonstrating the limitations.Checklist
CHANGELOG.mdwith your changes?Original prompt
reset_parentshould be called automatically #266💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.