-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support reading of arbitrary RegisteredTypes #143
base: main
Are you sure you want to change the base?
Conversation
Add unit tests for BaseIO::findTypes
@stephprince I made this a separate PR from #142, because I: 1) didn't want to make that PR more complicated, 2) allow #142 to be merged independently, and 3) felt that the changes in this PR are a bit more fundamental and may require a closer look and maybe some discussion. |
Co-authored-by: Steph Prince <[email protected]>
Co-authored-by: Steph Prince <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
==========================================
+ Coverage 93.20% 93.27% +0.06%
==========================================
Files 62 60 -2
Lines 4328 4385 +57
Branches 268 269 +1
==========================================
+ Hits 4034 4090 +56
- Misses 284 285 +1
Partials 10 10 ☔ View full report in Codecov by Sentry. |
Support reading typed columns of a DynamicTable and as a result support more broadly reading of RegisteredType objects via predefined functions via the new
DEFINE_REGISTERED_FIELD
macro, much like the existingDEFINE_FIELD
macro. This PR makes the following key changes:Data
andVectorData
to take an optional template parameter with the data type of the dataset they represent. This is to allow us to predefine both the class and the data type to use for reading via theDEFINE_REGISTERED_FIELD
macro as well as when we readVectorData
viaRegisteredType::create
DEFINE_REGISTERED_FIELD
macro. In contrast to the existingDEFINE_FIELD
macro, this is not for reading datasets and attributes but for reading typed objects for which we have aRegisteredType
that represents itRegisteredType
objects works with the newDEFINE_REGISTERED_FIELD
macro availableDEFINE_FIELD
definitions inNWBFile
public (they were private by error)DEFINE_REGISTERED_FIELD(readElectrodeTable, ElectrodeTable,
onNWBFile
for reading theElectrodeTable
using the correct typeElectrodeTable
. The columns were written with a fixed-length string type of 250 characters instead of a variable-length string typeDEFINE_REGISTERED_FIELD
definitions for reading thelocation
andgroup_name
columns of theElectrodeTable
DynamicTable::addColumn
to avoid extra iteration sincewriteDataBlock
can handle writing all the variable length strings in one callDynamicTable::readColumn
method to simplify reading of arbitrary columnsDEFINE_REGISTERED_FIELD(readIdColumn
inDynamicTable
to read theElementIdentifiers
Fix #130
Fix #115