oruebel / ndx-icephys-meta

NWB extensions for origanizing intracellular electrophysiology metadata
Other
6 stars 0 forks source link

Add stimulus, response, and electrode subtables for IntracellularRecordings #52

Closed oruebel closed 4 years ago

oruebel commented 4 years ago

This PR introduces the AlignedDynamicTable type, which inherits from DynamicTable but may itself contain a collection of additional DynamicTables that define "sub-categories" in the table. All tables within the AlignedDynamicTable type must align with the main table, i.e., all tables must have the same number of rows and rows must correspond to each other by index!

Using this new type, the IntracellularRecordingsTable type is updated so that the stimulus, response, and electrode are stored as separate DynamicTables within the IntracellularRecordingsTable. This approach has the advantage that we do not require DynamicTableRegions to link all these tables together and at the same time separates the stimulus, response, and electrode so that we can add dynamic metadata for each category. Since each of these is stored in a separate DynamicTable it is feasible the store metadata fields with the same name for each of these, which would not be possible if the data were stored in a single DynamicTable with sub-categories. At the same, time, the number of datasets we need is the same, so that the overhead compared to a single DynamicTable is minimal.

There are some API changes compared to the previous version but I think they should be reasonable. E.g., the example notebook is working without major changes. The main details that change is how to add new columns to the IntracellularRecordingsTable and how the Pandas dataframes look on read.

All tests are passing now and this should work now. There are still a few TODO items but most refer to adding more tests.

Fix #31

oruebel commented 4 years ago

@rly @t-b @lvsltz this should be good to merge now. All that is missing is more unit tests.