-
Notifications
You must be signed in to change notification settings - Fork 25
Description
What would you like to see added to HDMF?
AbstractContainer.reset_parent and LabelledDict.pop allow users to remove objects from a MultiContainerInterface, which is useful during modification and export of an NWB file. However, child objects that are not in a LabelledDict, e.g., NWBFile.units cannot be removed this way. The workaround is to do:
nwbfile.units.reset_parent()
nwbfile.fields["units"] = NoneThis is not ideal, because we normally discourage users from tampering with the fields attribute.
What solution would you like?
Perhaps reset_parent should look into the parent object and if it is in the parent object in the fields dictionary, then reset the value in fields.
Or perhaps even more intuitively, simply allow nwbfile.units = None which would handle resetting the value in fields (if it is allowed to be None) and call nwbfile.units.reset_parent(). This is related to #868
Do you have any interest in helping implement the feature?
Yes.