Skip to content
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

[Feature]: Support get_class with arbitrary recursion depth #1664

Open
3 tasks done
bendichter opened this issue Mar 10, 2023 · 5 comments
Open
3 tasks done

[Feature]: Support get_class with arbitrary recursion depth #1664

bendichter opened this issue Mar 10, 2023 · 5 comments
Labels
category: proposal proposed enhancements or new features priority: medium non-critical problem and/or affecting only a small set of NWB users topic: extension issues related to extensions or dynamic class generation

Comments

@bendichter
Copy link
Contributor

bendichter commented Mar 10, 2023

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

@oruebel
Copy link
Contributor

oruebel commented Mar 10, 2023

Which of the groups in the example have a neurodata_type set, i.e., for which object would get_class be called?

@oruebel oruebel added category: proposal proposed enhancements or new features priority: medium non-critical problem and/or affecting only a small set of NWB users topic: extension issues related to extensions or dynamic class generation labels Mar 10, 2023
@bendichter
Copy link
Contributor Author

bendichter commented Mar 10, 2023

@oruebel good question. I want to call get_class("BioSample", "ndx-biosample"). I fixed the yaml to make that more clear.

@oruebel
Copy link
Contributor

oruebel commented Mar 10, 2023

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?

@rly
Copy link
Contributor

rly commented Mar 10, 2023

Related: hdmf-dev/hdmf#796

I don't think that PR covers cases where an object links to itself. I will have to add a test for that.

@t-b
Copy link
Collaborator

t-b commented Mar 13, 2023

Related: #1299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: proposal proposed enhancements or new features priority: medium non-critical problem and/or affecting only a small set of NWB users topic: extension issues related to extensions or dynamic class generation
Projects
None yet
Development

No branches or pull requests

4 participants