Closed bendichter closed 5 years ago
What's the error message when pynwb reads the time value in?
$ python -m pynwb.validate ecephys_tutorial.nwb
Validating ecephys_tutorial.nwb against core namespace
- found the following errors:
Units/colnames (units.colnames): incorrect type - expected 'ascii', got 'utf'
root/file_create_date (file_create_date): incorrect type - expected 'isodatetime', got 'ascii'
root/session_start_time (session_start_time): incorrect type - expected 'isodatetime', got 'utf'
root/timestamps_reference_time (timestamps_reference_time): incorrect type - expected 'isodatetime', got 'utf'
using the validator, not reading in, but reading would be similar
I believe this actually works in through the reader though considering that session_start_time is required for a NWB file.
In any case, I can just update the format to match.
actually you are right, this does go through the reader and gets parsed correctly in pynwb, but the pynwb validator does not like it
bd03e830e9cc24611832868f8cee52cf8c01a388
Should fix both time formatting issues and the checks to set scalar attributes.
Also, the seconds indicator in the format string yyyy-MM-dd''T''HH:mm:SSZZ
is incorrect as capital S
values are interpreted to be fractional seconds. Regular seconds are lowercase s
.
ahh ok thanks for the correction
@ln-vidrio Looks like it's still missing a colon for the timezone offset
06ce9a658ad15b82b5196334d1159e5708d2169c This should fix it.
yay!
Bens-MacBook-Pro:~ bendichter$ python -m pynwb.validate ~/dev/matnwb/ecephys_tutorial.nwb
Validating /Users/bendichter/dev/matnwb/ecephys_tutorial.nwb against core namespace
- no errors found.
[]
two issues identified:
1) When I create a units table with only
spike_times
as a column:the
colnames
variable is length 1 and is automatically converted to a string. This causes an issue for pynwb which expectscolnames
to be a list, and causes an error on read:Would it be possible to ensure that
colnames
is always a list even if it is length 1?2) It looks like the dates are not being converted properly into strings. I input the following into the
NWBFile
constructor:which appears to have an ISO valid time:
however in the HDF5 there are no hyphens or colons (
20180301T120000+0200
) and pynwb cannot read the time properly.