pynwb
pynwb copied to clipboard
[Feature]: Support `get_class` with arbitrary recursion depth
What would you like to see added to PyNWB?
I am running into a problem automatically generating an extension I am creating of the form:
groups:
- neurodata_type: BioSample
groups:
- name: isDerivedFrom
links:
- type: BioSample
To make get_class work on this, we'd need to support arbitrary depth recursion, which is not currently supported.
Is your feature request related to a problem?
No response
What solution would you like?
modifications to get_class.
Do you have any interest in helping implement the feature?
Yes, but I would need guidance.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] Have you checked the Contributing document?
- [X] Have you ensured this change was not already requested?
Which of the groups in the example have a neurodata_type set, i.e., for which object would get_class be called?
@oruebel good question. I want to call get_class("BioSample", "ndx-biosample"). I fixed the yaml to make that more clear.
Just for further clarification, if you would set a neurodata_type for isDerivedFrom in your example, then get_class("BioSample", "ndx-biosample") would work, but without that it fails due to the nesting of groups, correct?
Related: https://github.com/hdmf-dev/hdmf/pull/796
I don't think that PR covers cases where an object links to itself. I will have to add a test for that.
Related: https://github.com/NeurodataWithoutBorders/pynwb/issues/1299