hdmf-dev / hdmf

The Hierarchical Data Modeling Framework
http://hdmf.readthedocs.io
Other
46 stars 26 forks source link

[Bug]: Custom class generator does not account for fields refined from parent type #1101

Open rly opened 5 months ago

rly commented 5 months ago

What happened?

In PyNWB, the TimeSeries spec has a dataset spec with name "data", dtype "numeric", many possible shapes, and a docstring. If an extension type ExtracellularSeries extends TimeSeries and has a dataset spec with name "data", dtype "float", one possible shape, and a different docstring, then when generating ExtracellularSeries.__init__, the "data" keyword argument from TimeSeries.__init__ is used instead of a new one being generated with the refined properties.

Same for the attributes of the "data" dataset spec like "unit", "conversion", etc.

I don't remember why we even use the docstring arguments from TimeSeries.__init__ rather than always regenerating them from the spec. It may have to do with fixed value and fixed name specs and how those are not part of added as keyword arguments to __init__.

Steps to Reproduce

See description above.

Traceback

No response

Operating System

macOS

Python Executable

Conda

Python Version

3.12

Package Versions

No response

mavaylon1 commented 5 months ago

That is a weird decision to use the docstring inputs from TimeSeries. Thanks for assigning labels and a milestone.