Comments (3)
This is a feature request for the validator to introspect the assertions that it's enforcing and show the variables that led to the failure. We would need something like pytest
's magic, which would be a significant undertaking.
Not to say we shouldn't do it, but this is a consequence of pushing logic into the schema so that there is less custom code for each issue in the validator.
from bids-validator.
could it be made explicit? e.g. (assuming that syntax for sets handling is added)
diff --git a/src/schema/rules/checks/dataset.yaml b/src/schema/rules/checks/dataset.yaml
index 91704d32..434fe2fc 100644
--- a/src/schema/rules/checks/dataset.yaml
+++ b/src/schema/rules/checks/dataset.yaml
@@ -11,7 +11,8 @@ SubjectFolders:
selectors:
- path == '/dataset_description.json'
checks:
- - length(dataset.subjects.sub_dirs) > 0
+ - check: length(dataset.subjects.sub_dirs) > 0
+ hint: length(dataset.subjects.sub_dirs)
# 49
ParticipantIDMismatch:
@@ -24,7 +25,8 @@ ParticipantIDMismatch:
selectors:
- path == '/participants.tsv'
checks:
- - allequal(sorted(columns.participant_id), sorted(dataset.subjects.sub_dirs))
+ - check: allequal(set(columns.participant_id), set(dataset.subjects.sub_dirs))
+ hint: set(columns.participant_id).difference(dataset.subjects.sub_dirs)
# 51
PhenotypeSubjectsMissing:
? although indeed while doing few of those I started to think about pytest's approach ;-)
edit: 1st example I did was quite dumb ;-)
from bids-validator.
Whoever implements this gets to decide whether it makes more sense to modify the schema to allow hints to be specified there or to do introspection.
Personally, I don't want to do either. If we do this, I would probably do it in the Python validator, since I've already written a parser for the expression language. With an AST, we will be able to easily introspect every check.
from bids-validator.
Related Issues (20)
- Legacy validator permitting (i)EEG files without sidecars HOT 3
- New phenotype filename rule messes with filename rule suggestion heuristic.
- Implement allequal in expression language. HOT 2
- TSV column type check overhaul HOT 6
- No error/warning when IDs in `participant.tsv` do not match directory names HOT 5
- Error 1: [Code 1] NOT_INCLUDED in valid (?) filenames across dataset and more errors HOT 1
- version reporting in compiled/installed version from url is just "master" or "alpha" HOT 1
- git query for version -- redirect stderr to /dev/null or provide -c safe.directory=*
- do not add ANSI coloring if stdout is not a tty -- add `--color=auto,yes,no` HOT 1
- deno validator: incorrectly claims that README is missing HOT 4
- Make bids-validator conform to BIDS-App (or execution-spec right away) specification HOT 2
- deno validator: add option to run only specified list of checks
- deno validator: complains about EVENT_ONSET_ORDER but AFAIK they are sorted!
- deno: Does not ERROR on the unknown DatasetType + does not warn that no subjects
- deno: chokes on `derivatives/bagel.csv`
- deno validator: --filenameMode still wants dataset path and then seems to do more than just paths validation HOT 1
- Naming, volume matching and task naming HOT 2
- Installing CLI raises warnings
- Nested object validation using ajv
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bids-validator.