agencyenterprise / ndx-nirs

An NWB extension for storing Near-Infrared Spectroscopy (NIRS) data
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Use auto-generated DynamicTable classes #4

Closed dsleiter closed 2 years ago

dsleiter commented 3 years ago

Currently, we have to explicitly define and register NIRSSourceTable, NIRSDetectorTable, and NIRSChannelTable classes. eg: https://github.com/agencyenterprise/ndx-nirs/blob/33ca020da7cbc4ee342f731e764da11f4c1fb8e6/src/pynwb/ndx_nirs/__init__.py#L53

Once https://github.com/hdmf-dev/hdmf/pull/522 is accepted and the next release version of hdmf is published, we will be able to autogenerate these classes. eg, via:

NIRSSourceTabel = get_class("NIRSSourceTabel", "ndx-nirs")

This would improve code clarity, so we should use the autogenerated classes wherever possible once available.

dsleiter commented 2 years ago

Closing this story because we decided not to implement it.

Auto-class generation was tested in #8 but then backed-out. Using auto-class generation for the dynamic tables requires either:

We decided the code is cleaner to keep the explicit class definitions.