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

validate-bids doesn't report an error on a file with incorrect suffix #991

Closed
yarikoptic opened this issue Apr 28, 2022 · 5 comments
Closed
Assignees

Comments

@yarikoptic
Copy link
Member

$> dandi --version
0.39.4+2.gb73f44d1
(dev3) 1 21468 [1].....................................:Thu 28 Apr 2022 06:08:44 PM EDT:.
lena:/tmp/test
$> dandi validate-bids sub-MITU01/ses-MR/sub-MITU01_ses-MR_SSSPDmap.nii.gz
2022-04-28 18:08:50,698 [ WARNING] BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-04-28 18:08:51,321 [    INFO] Logs saved in /home/yoh/.cache/dandi-cli/log/20220428220849Z-1783177.log

there is no SSSPDmap, only PDmap:

(git)lena:~/proj/dandi/dandi-cli-master[master]
$> git grep PDmap
dandi/support/bids/schemadata/1.7.0+012+dandi001/objects/suffixes.yaml:    **Change:** Replaced by `PDw` or `PDmap`.
dandi/support/bids/schemadata/1.7.0+012+dandi001/objects/suffixes.yaml:PDmap:
dandi/support/bids/schemadata/1.7.0+012+dandi001/rules/datatypes/anat.yaml:  - PDmap
dandi/support/bids/schemadata/1.7.0+012/objects/suffixes.yaml:    **Change:** Replaced by `PDw` or `PDmap`.
dandi/support/bids/schemadata/1.7.0+012/objects/suffixes.yaml:PDmap:
dandi/support/bids/schemadata/1.7.0+012/rules/datatypes/anat.yaml:  - PDmap
@yarikoptic
Copy link
Member Author

yarikoptic commented Apr 28, 2022

what does it validate really? doesn't even complain if sub / ses label doesn't match between folders and files:

$> dandi validate-bids sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz
2022-04-28 18:11:09,291 [ WARNING] BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-04-28 18:11:09,873 [    INFO] Logs saved in /home/yoh/.cache/dandi-cli/log/20220428221107Z-1784078.log
(dev3) 1 21475 [1].....................................:Thu 28 Apr 2022 06:11:10 PM EDT:.
lena:/tmp/test
$> cat /home/yoh/.cache/dandi-cli/log/20220428221107Z-1784078.log
2022-04-28T18:11:07-0400 [INFO    ] dandi 1784078:140317588195136 dandi v0.39.4+2.gb73f44d1, hdmf v3.1.1, pynwb v2.0.0, h5py v3.6.0
2022-04-28T18:11:07-0400 [INFO    ] dandi 1784078:140317588195136 sys.argv = ['/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3/bin/dandi', 'validate-bids', 'sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz']
2022-04-28T18:11:07-0400 [INFO    ] dandi 1784078:140317588195136 os.getcwd() = /tmp/test
2022-04-28T18:11:08-0400 [DEBUG   ] urllib3.connectionpool 1784078:140317588195136 Starting new HTTPS connection (1): rig.mit.edu:443
2022-04-28T18:11:08-0400 [DEBUG   ] urllib3.connectionpool 1784078:140317588195136 https://rig.mit.edu:443 "GET /et/projects/dandi/dandi-cli HTTP/1.1" 200 579
2022-04-28T18:11:08-0400 [DEBUG   ] dandi 1784078:140317588195136 Running a newer version (0.39.4+2.gb73f44d1) of dandi/dandi-cli than available (0.39.4)
2022-04-28T18:11:08-0400 [DEBUG   ] h5py._conv 1784078:140317588195136 Creating converter from 7 to 5
2022-04-28T18:11:08-0400 [DEBUG   ] h5py._conv 1784078:140317588195136 Creating converter from 5 to 7
2022-04-28T18:11:08-0400 [DEBUG   ] h5py._conv 1784078:140317588195136 Creating converter from 7 to 5
2022-04-28T18:11:08-0400 [DEBUG   ] h5py._conv 1784078:140317588195136 Creating converter from 5 to 7
2022-04-28T18:11:09-0400 [WARNING ] dandi 1784078:140317588195136 BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-04-28T18:11:09-0400 [INFO    ] dandi 1784078:140317588195136 Logs saved in /home/yoh/.cache/dandi-cli/log/20220428221107Z-1784078.log

edit: here is the tarball of that "tricky" case -- http://www.onerussian.com/tmp/test-bids.tgz

@TheChymera
Copy link
Contributor

TheChymera commented Apr 29, 2022

@yarikoptic it marks the file as invalid if there is a mismatch, just that the function only returns a dictionary of the summary, and optionally writes issues it found to the report file via -r.

This should additionally log the errors: #992

@TheChymera
Copy link
Contributor

TheChymera commented Apr 29, 2022

chymera@decohost ~ $ wget http://www.onerussian.com/tmp/test-bids.tgz -q
chymera@decohost ~ $ tar xvf test-bids.tgz
test/
test/dataset_description.json
test/sub-MITU02/
test/sub-MITU02/ses-MR2/
test/sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz
chymera@decohost ~ $ dandi validate-bids test -r
2022-04-29 08:56:51,060 [ WARNING] A newer version (0.39.4) of dandi/dandi-cli is available. You are using 0.39.2+47.gb73f44d.dirty
2022-04-29 08:56:51,157 [    INFO] Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2022-04-29 08:56:51,158 [    INFO] NumExpr defaulting to 8 threads.
2022-04-29 08:56:52,377 [ WARNING] BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-04-29 08:56:53,148 [    INFO] BIDS validation log written to /home/chymera/.cache/dandi-cli/log/bids-validator-report_20220429125653Z-1736.log
2022-04-29 08:56:53,149 [   ERROR] The `.*?/README$` regex pattern file required by BIDS was not found.
2022-04-29 08:56:53,149 [   ERROR] The `.*?/CHANGES$` regex pattern file required by BIDS was not found.
2022-04-29 08:56:53,149 [ WARNING] The `/home/chymera/test/sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz` file was not matched by any regex schema entry.
2022-04-29 08:56:53,149 [    INFO] Logs saved in /home/chymera/.cache/dandi-cli/log/20220429125650Z-1736.log
chymera@decohost ~ $ ppb /home/chymera/.cache/dandi-cli/log/bids-validator-report_20220429125653Z-1736.log
Upload succeeded:
https://ppb.chymera.eu/fe88e3.log

@yarikoptic
Copy link
Member Author

now it is #1037 I think

(git-annex)lena:~/proj/dandi/dandisets/000108[draft]git
$> dandi validate-bids sub-MITU02/ses-20210521h17m17s06/micr/sub-MITU01_ses-20210521h17m17s06_sample-178_stain-NN_run-1_chunk-1_SPIM.ome.zarr                                                    
2022-07-08 19:06:33,800 [ WARNING] A newer version (0.44.1) of dandi/dandi-cli is available. You are using 0.39.6+39.g8139966
2022-07-08 19:06:34,992 [ WARNING] BIDSVersion 1.4.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-07-08 19:06:35,655 [    INFO] Logs saved in /home/yoh/.cache/dandi-cli/log/20220708230633Z-424963.log
Error: list index out of range

while testing the 0.39.6+39.g8139966 of #1011

@TheChymera
Copy link
Contributor

TheChymera commented Jul 27, 2022

@yarikoptic This is not the same issue as the initial one reported, and that particular issue was just missing reporting which has been fixed a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants