Skip to content
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

[Bug]: nwbinspector with dandi flag doesn't contain dandi validation errors #302

Closed
3 tasks done
djarecka opened this issue Nov 9, 2022 · 4 comments · Fixed by #303
Closed
3 tasks done

[Bug]: nwbinspector with dandi flag doesn't contain dandi validation errors #302

djarecka opened this issue Nov 9, 2022 · 4 comments · Fixed by #303
Assignees
Labels
category: bug errors in the code or code behavior priority: critical impacts proper operation or use of core function of NWB or the software

Comments

@djarecka
Copy link

djarecka commented Nov 9, 2022

What happened?

I have an error from dandi validator, but no critical file from nwbinspector (file from the user guide)

follow-up to dandi/dandi-cli#1031

Steps to Reproduce

Was not able to upload files from the [user guide](https://github.com/dandi/example-notebooks/blob/master/dandi/DANDI%20User%20Guide%2C%20Part%20I.ipynb), so run validators that gave two different things:


(dandi_pip) dhcp-10-31-85-60:205769 dorota$ dandi validate
2022-11-09 15:30:04,586 [   ERROR] sub-001/sub-001_ecephys.nwb: 1 error(s)
2022-11-09 15:30:04,586 [   ERROR]   Subject.sex is missing.
Summary: Validation errors in 1 out of 1 files
2022-11-09 15:30:04,586 [    INFO] Logs saved in /Users/dorota/Library/Logs/dandi-cli/20221109203003Z-76498.log
(dandi_pip) dhcp-10-31-85-60:205769 dorota$ nwbinspector . --config dandi
                                                                                                                                                   

**************************************************
NWBInspector Report Summary

Timestamp: 2022-11-09 15:30:11.718071-05:00
Platform: macOS-12.0.1-arm64-arm-64bit
NWBInspector version: 0.4.17

Found 7 issues over 1 files:
       1 - BEST_PRACTICE_VIOLATION
       6 - BEST_PRACTICE_SUGGESTION
**************************************************


0  BEST_PRACTICE_VIOLATION
==========================

0.0  sub-001/sub-001_ecephys.nwb: check_regular_timestamps - 'ElectricalSeries' object at location '/acquisition/test_ephys_data'
       Message: TimeSeries appears to have a constant sampling rate. Consider specifying starting_time=0.0 and rate=0.1 instead of timestamps.

1  BEST_PRACTICE_SUGGESTION
===========================

1.1  sub-001/sub-001_ecephys.nwb: check_description - 'Subject' object at location '/general/subject'
       Message: Description is missing.

1.2  sub-001/sub-001_ecephys.nwb: check_description - 'Device' object at location '/general/devices/trodes_rig123'
       Message: Description is missing.

1.3  sub-001/sub-001_ecephys.nwb: check_experimenter_form - 'NWBFile' object at location '/'
       Message: The name of experimenter 'Dr. Bilbo Baggins' does not match any of the accepted DANDI forms: 'LastName, Firstname', 'LastName, FirstName MiddleInitial.' or 'LastName, FirstName, MiddleName'.

1.4  sub-001/sub-001_ecephys.nwb: check_keywords - 'NWBFile' object at location '/'
       Message: Metadata /general/keywords is missing.

1.5  sub-001/sub-001_ecephys.nwb: check_subject_sex - 'Subject' object at location '/general/subject'
       Message: Subject.sex is missing.

1.6  sub-001/sub-001_ecephys.nwb: check_col_not_nan - 'DynamicTable' object with name 'electrodes'
       Message: Column 'imp' has all NaN values. Consider removing it from the table.

Traceback

No response

Operating System

macOS

Python Executable

Python

Python Version

3.8

Usage

Command Line Interface

Were you streaming with ROS3?

No

Package Versions

you will have the same issue when you try to run in dandi hub so it is not platform specific

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • Have you ensured this bug was not already reported?
  • To the best of your ability, have you ensured this is a bug within the code that checks the NWBFile, rather than a bug in the NWBFile reader (e.g., PyNWB or MatNWB)?
@djarecka djarecka added the category: bug errors in the code or code behavior label Nov 9, 2022
@CodyCBakerPhD
Copy link
Contributor

CodyCBakerPhD commented Nov 9, 2022

@djarecka Thanks, can you try two quick things to help pin this down?

(a) python -m nwbinspector.nwbinspector . --config dandi

and if that gives the same results

(b) python -c "import nwbinspector; print(nwbinspector.load_config(filepath_or_keyword='dandi'))" to try to see if it's a local packaging issue (though unusual that dandi validate would still use the correct one...)

EDIT: corrected the module location

@djarecka
Copy link
Author

djarecka commented Nov 9, 2022

(dandi_pip) dhcp-10-31-85-60:205769 dorota$ python -m nwbinspector . --config dandi
/Users/dorota/miniconda3/envs/dandi_pip/bin/python: No module named nwbinspector.__main__; 'nwbinspector' is a package and cannot be directly executed

(dandi_pip) dhcp-10-31-85-60:205769 dorota$ python -c "import nwbinspector; print(nwbinspector.load_config(filepath_or_keyword='dandi'))"
{'CRITICAL': ['check_subject_exists', 'check_subject_id_exists', 'check_subject_sex', 'check_subject_species_exists', 'check_subject_species_latin_binomial', 'check_subject_age', 'check_subject_proper_age_range'], 'BEST_PRACTICE_VIOLATION': ['check_data_orientation']}

fyi., I've installed nwbinspector today with pip install -U nwbinspector

@CodyCBakerPhD CodyCBakerPhD self-assigned this Nov 9, 2022
@CodyCBakerPhD CodyCBakerPhD added the priority: critical impacts proper operation or use of core function of NWB or the software label Nov 9, 2022
@CodyCBakerPhD
Copy link
Contributor

@djarecka Thanks, I can reproduce the series of behaviors myself. Will try to fix this ASAP.

Good to know the API-level still works as dandi uses it, so no trouble triggering invalidation of improper files downstream

@CodyCBakerPhD
Copy link
Contributor

Also, for reference (if I ever need to search for this again), the syntax is python -m nwbinspector.nwbinspector ... for manual calling of the module in that environment-specific Python.

That doesn't seem to play a part in the source of this issue however, the config values propagate the criticality down to the lowest level I can track so seeing if it's a display issue now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior priority: critical impacts proper operation or use of core function of NWB or the software
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants