bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

[BUG]? Python bids-validator returns true on non-bids folder names

Open bendhouseart opened this issue 2 years ago • 4 comments
trafficstars

Was playing around a bit last week and noticed that the python version of the validator seems to misclassify non-bids folder names as compliant.

See:

>>> from bids_validator import BIDSValidator
>>> validator = BIDSValidator()
>>> validator.is_bids('/sub_07/eeg/sub-07_task-matchingpennies_events.tsv')
True
>>>

Python and validator version(s):

Python 3.10.9 (main, Mar  1 2023, 12:20:14) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bids_validator
>>> bids_validator.__version__
'1.12.0'

bendhouseart avatar Oct 02 '23 15:10 bendhouseart

I'm a little inclined to mark this wontfix. If you would like to do filename validation in Python, the bidsschematools validator is going to be better supported.

effigies avatar Oct 02 '23 16:10 effigies

Actually, I think the better fix is to depend on bidsschematools and write shims for the current API. We should strip the Python validator out of the JS validator repository and free up JS developers to reorganize without potentially breaking the Python packaging.

effigies avatar Oct 02 '23 16:10 effigies

+1 to remove the python validator from the JS repo and potentially even deprecating it in favor of the new schema based python validator.

sappelhoff avatar Oct 04 '23 08:10 sappelhoff

This will be fixed with #1967

In [1]: from bids_validator import BIDSValidator

In [2]: BIDSValidator().is_bids('/sub_07/eeg/sub-07_task-matchingpennies_events.tsv')
Out[2]: False

effigies avatar May 06 '24 19:05 effigies