-
Notifications
You must be signed in to change notification settings - Fork 111
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
overhaul units validation in bids-validator #969
Comments
@rwblair will your new package https://github.com/poldracklab/cmixf-js be easily integrated into bids-validator? |
Should be. It's published it on npm. Don't have time at the moment |
bids-standard/bids-specification#411 is now merged, we should "deactivate" current unit validation ASAP @rwblair |
Uncommenting the SI units validation code would fix this LGTM.com recommendation: bids-validator/bids-validator/validators/tsv/tsv.js Lines 309 to 336 in abb700c
|
I have created a PR to uncomment the SI units validation code. It's been sitting unused for a long time. Does it need some overhauling or more testing? |
yeah it needs both overhauling and testing. We would want the unit checks to:
|
One problem is
|
Another one is
|
So we recommend both SI and the stricter CMIXF. But neither are required. But what is required is to have a units entry in a sidecar if the units are not SI. @sappelhoff is my understanding of the specs unit guidelines correct? Is there an explicit example of documenting non SI units in a sidecar? https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/09-positron-emission-tomography.html#example-blood-data Above example shows units in a sidecar as required by PET part of spec. Could imagine documenting non SI units used in TSV files would be done similarly. bids-standard/bids-specification#885 goes a ways towards indicating fields that should be validated as units and should be used once its merged. Unfortunately the regex for validating both SI/CMIXF is so complicated that ever putting it in the schema may be out of the question. I haven't found a standard js library for validating SI units so we should keep using the code we have for that. I updated the old cmixf-js package so thats still an option doesn't have any dependencies and fortunately I don't think CMIXF-12 is going to be changing. I might move that over to bids-standard instead of keeping it under poldracklab account. |
yes 👍
I haven't seen any
I agree
Nice |
we are currently in the final review round of a PR in bids-specification that will RECOMMEND CMIXF formatting of SI units: bids-standard/bids-specification#411
Once that PR is merged, we should "switch off" units validation as it is currently and then start re-implementing / changing the way we validate to be in line with the specification again.
Specifically, units should be checked whether they conform to CMIXF-12 (+ the 5 unicodes we include for backward compatibility) ...
outdated, because the PR changed
We also need to consider cases where SI units are impossible -> in these cases, users can specify their units in JSON sidecars. (This needs to be covered by the tests, i.e., IF invalid SI unit found, but unit specified in JSON, do not raise ... else send error "please format as CMIXF")Lastly, the validator should alert users when the INVALID unicodeU+03BC
(μ) is used instead of the VALIDU+00B5
(µ). The warning should include something like "please take extra care ... these characters look the same, but are different"The text was updated successfully, but these errors were encountered: