-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add BidsValidator Plugin #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a few typos and one suggestion for a potential enhancement to the plugin
snakebids/project_template/{{cookiecutter.app_name}}/config/snakebids.yml
Outdated
Show resolved
Hide resolved
The one check that is failing seems to have occurred when there was some GitHub downtime the other day. I’ve reran this a couple of times since and that error is still there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is not at all clear to me what's going on with that workflow failure, I think we can probably just merge and address it in a separate PR if it sticks around
Looks like making a new push fixed that workflow failure. |
@kaitj, are you still working on this one, or am I good to take another look? |
Should be good for another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies again for the delay, I left some comments
snakebids/project_template/{{cookiecutter.app_name}}/workflow/Snakefile
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for another round of comments, I think I just reviewed this too late last night
snakebids/project_template/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/run.py
Outdated
Show resolved
Hide resolved
2bde868
to
8ba03a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment RE documentation, but I'd be okay with deferring to a future issue if you'd rather not do it here, I'll leave it up to you
snakebids/project_template/{{cookiecutter.app_name}}/workflow/Snakefile
Outdated
Show resolved
Hide resolved
- add validation via node.js Bids-Validator - add information about use of validation and plugins to the documentation - ignore validation on existing test cases - create test cases for BidsValidator plugin
- make validate=False default behaviour - fix bug with subprocess call for bids-validator
- use a namespaced config key (e.g. plugins.validator.param) - update documentation for namespaced key example
- validate with pybids if bids-validation is to be performed (regardless of ability to use bids-validator
- update overview to include link to plugins page for using / creating plugins - revamp plugins doc to split use and creation of plugins - using plugins demonstrates how to add a plugin to the snakebids app with distributed validator as example - creating plugins updated from function to callable class - highlights recommended practices for inheriting from SnakebidsPluginError for errors and namespaced keys for config - fix doc and cookiecutter typos / grammar - rename validate.py -> validator.py for consistency
- remove app assignment (self.app -> app) - remove logger from validator testing
- clarify '...callable class...' -> '...function or callable class...' - fix spelling
61edbbc
to
d733c9f
Compare
- remove mention of uncommenting lines - rephrased "Enable by default..." to "Boilerplate starts with the validator plugin enabled..." in the overview doc - focused docstring of validation using pybids in `generate_inputs()` - associte pybids validate logic to plugins.validator.skip (--skip-bids-validation), which will make it simpler for downstream devs - left plugins.validator.success in as it can still be used for more complex logic if desired - instantiate validator plugin in boilerplate - moved docstring under `__call__` - replaced `__init__` with attr - remove logic comments in Snakefile - replace individual #noqa: PLR0913 calls to ignore under ruff configuration
Proposed changes
A second attempt at implementing bids validation (see #222). This time, implementing as a snakebids plugin (resuing some of the code from the previous attempt). The plugin tries to perform validation using the bids-validator unless skipped by the user (
--skip_bids_validation
). If the validation fails, anInvalidBidsError
is thrown, otherwise validation is performed by default using pybids with a warning informing the user.As noted in #222:
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!Notes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.