hdmf icon indicating copy to clipboard operation
hdmf copied to clipboard

[Bug]: Cannot overwrite mapped constructor argument

Open rly opened this issue 7 months ago • 0 comments

What happened?

See https://github.com/NeurodataWithoutBorders/nwb-schema/issues/630

I believe there are two issues here.

  1. LatentSpaceSeries/data.unit is identified as an inherited spec and so the spec is not processed when customizing the constructor docval (it is not in not_inherited_fields in ClassGenerator.generate_class. We should instead check whether a spec is not overridden.

  2. TimeSeries.unit is a custom mapped constructor argument. In the spec, "unit" is an attribute on the "data" dataset. It is not straightforward for HDMF to know that, and this is not considered when generating custom classes that extend the TimeSeries spec.

Steps to Reproduce

See https://github.com/NeurodataWithoutBorders/nwb-schema/issues/630

Traceback


Operating System

macOS

Python Version

3.13

Package Versions

No response

rly avatar May 22 '25 18:05 rly