NeurodataWithoutBorders / pynwb

A Python API for working with Neurodata stored in the NWB Format
https://pynwb.readthedocs.io
Other
176 stars 85 forks source link

Timeseries unit attribute ought to be property pointing at data #931

Open NileGraddis opened 5 years ago

NileGraddis commented 5 years ago

In the spec unit (among others) is an attribute on the data of a timeseries, not on the timeseries itself: https://github.com/NeurodataWithoutBorders/pynwb/blob/85ef17dc5d820deeaf1c40e5ed22e22336b691ec/src/pynwb/data/nwb.base.yaml#L146-L164

This gets cached on the timeseries object upon construction, which screws up lazy data access (and seems like unnecessary duplication). Instead, we ought to have a R/W pair of descriptors that dispatch to the underlying data.

@ajtritt thoughts?

NileGraddis commented 5 years ago

OK, immediate problem: TimeSeries doesn't etl its data. ndarrays don't have a unit attribute. Should TimeSeries wrap its data?

NileGraddis commented 5 years ago

and if so in what? TimeSeries.data has a name but not a type.