-
Notifications
You must be signed in to change notification settings - Fork 10
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
[New Check]: Non-required Electrode columns (nwb-schema >= 2.5.0) #225
base: dev
Are you sure you want to change the base?
Conversation
if get_package_version(name="pynwb") < version.Version("2.1.0"): | ||
return | ||
if any(x.isnan() in electrode_table for x in ["x", "y", "z", "imp", "filtering"]): | ||
return InspectorMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would yield here and say in the message which column is Nan. Also, does isnan
work for an array? Maybe we could say if np.all(np.isnan(col))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, do you want it to report the exact index(ices) that are NaN
or just the column that it was found in?
group=ElectrodeGroup(name="test_group", description="", device=Device(name="test_device"), location="unknown"), | ||
group_name="test_group", | ||
) | ||
if get_package_version(name="pynwb") >= version.Version("2.1.0"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic should go inside the skip statement. From the comments it seems like maybe you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is temporary until they fix the bug - this PR will have to stay in draft until then.
fix #220
Early work on adding this check. Currently relies (incorrectly) on grabbing this information from the PyNWB version being used to read the files (>= 2.1.0 release) however that would not correctly apply to a file written using a cached namespace corresponding to any
nwb-schema<2.5.0
.A couple of design considerations...
i) how to get the cached namespace core version? I tried the
NWBHDF5IO
nwbfile and such for this but didn't have any luck -nwbfile.namespaces
just reports the string"core"
and not the version. I was able to get this information however by the followingapplied to a
file = h5py.File(...)
ii) how best to communicate this version information from the io/file reading level of the
inspect_nwb
/run_checks
level of the inspector and the ultimate check function (which is really only designed to receive one input, that being the object being checked.