[Feature]: Add dictionary methods to MultiContainerInterface #1161
Labels
category: enhancement
improvements of code or code behavior
priority: low
alternative solution already working and/or relevant to only specific user(s)
Milestone
What would you like to see added to HDMF?
Classes that extend
MultiContainerInterface
gain a__getitem__
which provides a convenient interface for accessing an item within it by name. This works only forMultiContainerInterface
classes that have one single multi-container attribute (i.e., a single element in__clsconf__
) (code). In PyNWB, that is almost all of them (except forNWBFile
and possible extensions).This allows you to do:
Instead of:
However, if you want to iterate through the contained objects, you have to use the attribute, which is a labelled dictionary:
It would be nice to be able to do just:
What solution would you like?
See above.
Do you have any interest in helping implement the feature?
Yes.
The text was updated successfully, but these errors were encountered: