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]: File count in output includes directories #359

Open
3 tasks done
rly opened this issue Apr 11, 2023 · 1 comment
Open
3 tasks done

[Bug]: File count in output includes directories #359

rly opened this issue Apr 11, 2023 · 1 comment
Labels
category: bug errors in the code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)

Comments

@rly
Copy link
Contributor

rly commented Apr 11, 2023

What happened?

When the check_unique_identifiers issue is raised, the directory is counted as a "file" in the output line Found 21 issues over 3 files. This can be confusing to users (see comment dandi/dandi-cli#1266 (comment)). I'm not sure if there are other directory-level issues like this.

Suggestion: change Found 21 issues over 3 files to Found 21 issues over 2 files and 1 directory or Found 21 issues over 3 files and directories

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

Timestamp: 2023-04-11 13:52:44.461154-07:00
Platform: macOS-13.2.1-arm64-i386-64bit
NWBInspector version: 0.4.27

Found 21 issues over 3 files:
       1 - CRITICAL
      10 - BEST_PRACTICE_VIOLATION
      10 - BEST_PRACTICE_SUGGESTION
**************************************************


0  CRITICAL
===========

0.0  /Users/rly/Documents/NWB_Data/dandisets/000037/sub-408021: check_unique_identifiers - 'NWBFile' object at location '/'
       Message: The identifier '758519303_with_stim' is used across the .nwb files: ['sub-408021_ses-758519303_behavior+image+ophys.nwb', 'sub-408021_ses-758519303_behavior+image+ophys_new_IDs.nwb']. The identifier of any NWBFile should be a completely unique value - we recommend using uuid4 to achieve this.

Operating System

M1 macOS

Python Version

3.11

Were you streaming with ROS3?

No

Package Versions

Copy and paste your output here

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)?
@rly rly added category: bug errors in the code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) labels Apr 11, 2023
@CodyCBakerPhD
Copy link
Collaborator

CodyCBakerPhD commented Apr 14, 2023

Can you please attach a .txt. or .json of the full report? You may have to use the --detailed flag as well to prevent aggregation

I'm having trouble reproducing the issue - the number of files displayed in that header is simply the number of unique NWB files that had messages returned: https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/src/nwbinspector/inspector_tools.py#L118

So what I'm looking for in the full report is all the messages from all the files to confirm they appear as expected

I could technically add some directory logic to the string (like evaluate the unique parents of each file) but TBH I don't think it's all that helpful; the inspector and reports have no notion of sub-directories (or even memory of the top-level directory), only files, and files are found by recursive globbing from the main CLI calls

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: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

No branches or pull requests

2 participants