-
Notifications
You must be signed in to change notification settings - Fork 84
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
nwb_version is neither populated, nor validation causes any error #1085
Comments
oh, forgot to include detail that validation using pynwb also does not cause any error (here I am using `dandi ls` which merely prints output from `pynwb.validate`/home/yoh/proj/dandi/trash > dandi validate testfile.nwb
/home/yoh/deb/gits/pkg-exppsy/hdmf/src/hdmf/backends/hdf5/h5tools.py:99: UserWarning: No cached namespaces found in testfile.nwb
warnings.warn(msg)
No validation errors among 1 files |
I went for a shorter name in ls command since space is scarse. Unfortunately I could not immediately figure out how to even populate that field e.g. using NWBFile. And PyNWB does not populate it either ATM: NeurodataWithoutBorders/pynwb#1085 The only example I found quickly with nwb_version field populated was from ///crcns/ssc-7 dataset -- and in particular data/L4E_whole_cell/Exp_2015-09-05_001_0001-0162.nwb file there. I really think we should come up with some good, and not that large collection of sample .nwb files to test on. Unfortunately any "real" .nwb file seems to be quite large
The version is still populated. In NWB 1 it's a dataset and in 2 it's an attribute. from datetime import datetime
from dateutil.tz import tzlocal
from pynwb import NWBFile, NWBHDF5IO
from h5py import File
nwb = NWBFile(session_description='session', identifier='1', session_start_time=datetime.now(tzlocal()))
with NWBHDF5IO('test.nwb', 'w') as io:
io.write(nwb)
with File('test.nwb','r') as file:
print(file.attrs['nwb_version'])
I don't know how to read this using pynwb though |
xo xo @bendichter -- thank you! I will never trust h5ls now and will resort to h5dump! It even confirmed that those sample .nwb files you pointed to, do not have a stored version to match the version of the directory they are under, e.g. /tmp/nwb_test_data > h5dump v2.0.1/test_timestamps_linking.nwb | grep -A10 nwb_version
ATTRIBUTE "nwb_version" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "2.0b"
} but that would be a separate issue! Thanks again, I am tuning up |
Thanks Ben for chiming in on NeurodataWithoutBorders/pynwb#1085
Looking at the schema:
it doesn't suggest that it is optional (fix is submitted for the example version) , so I assume that it is mandatory (is it?);
and within #1077 it came as the one to be used as a decision point either a given file NWB 2.0 or not.
While looking at a sample file from https://github.com/dandi/najafi-2018-nwb (generated with pynwb 1.0.3) I saw
that it does not carry this field although carries specifications/core/:
And apparently pynwb (as of current 1.1.1) does not bother to populate it while creating a simple NWBFile file.
I think PyNWB should by default populate it with the version of the standard it supports! otherwise there is no way to figure out what version of NWB a given file is.
The text was updated successfully, but these errors were encountered: