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

ENH: Enable filtering for ANY or NONE in --bids-filter-file #2123

Merged
merged 7 commits into from
May 12, 2020

Conversation

bpinsard
Copy link
Collaborator

@bpinsard bpinsard commented May 8, 2020

Changes proposed in this pull request

When loading from bids-filter-file from json the pybids query values NONE and ANY cannot be used (cannot be serialized).

Here is a quick fix for that problem, will need to be pushed to smriprep as well, and tested.
json null is converted to bids.layout.Query.NONE
json string '__any__' is converted to bids.layout.Query.ANY (could change the naming if we prefer '*' but it usually means anything including empty, maybe '+' then ?)

Documentation that should be reviewed

The FAQ section on how to select images when multiple one available.

@pep8speaks
Copy link

pep8speaks commented May 8, 2020

Hello @bpinsard! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-05-11 17:56:47 UTC

@auto-comment
Copy link

auto-comment bot commented May 8, 2020

Thank your for raising your pull request.

Some of the fMRIPRep maintainers will review your changes as soon as time permits.
I'm attaching below a Review Checklist for the reviewers, to check off during the
review.

PR Review

Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide

  • As the reviewer I confirm that there are no conflicts of interest for me to review this work.

Please check what applies in the following aspects of the PR:

Code documentation

  • New functions and modules are documented following the guidelines.
  • Existing code required amendments in documentation and has been updated.
  • Sufficient inline comments ensure readability by other contributors in the long term.

Documentation site

  • The modifications to fMRIPrep in this PR do not require extra documentation. This is a common situation when a bug fix that does not change the code base substantially is submitted.
  • This PR requires documentation. The corresponding documentation will be submitted as an additional PR in the future.
  • This PR requires extra documentation, and will be included within this PR. Please check the boxes that apply best:
    • An existing feature is substantially modified, changing the interface and/or logic of a module.
    • A new feature is being added, therefore full documentation of it will be included
    • This PR addresses an error in existing documentation.
  • Yes, all expected sections of documentation were generated by the CI build, and look as expected

Tests

  • The new functionalities in this PR are covered by the existing tests
  • New test batteries have been included with this PR

Data

  • This PR does not require any additional data to be uploaded to OSF.
  • This PR requires additional data for tests.

Dependencies: smriprep

  • This PR does not require any update on smriprep; or
  • smriprep has correctly been pinned.

Dependencies: niworkflows

  • This PR does not require any update on niworkflows; or
  • niworkflows has correctly been pinned.

Dependencies: sdcflows

  • This PR does not require any update on sdcflows; or
  • sdcflows has correctly been pinned.

Dependencies: Nipype

  • This PR does not require any update on nipype; or
  • nipype has correctly been pinned.

Dependencies: other

  • This PR does not require any update on other dependencies; or
  • other dependencies have correctly been pinned.

Reports generated within CI tests

  • Yes, I have checked the reports of ds005 and they are not modified or the changes are as expected
  • Yes, I have checked the reports of ds054 and they are not modified or the changes are as expected
  • Yes, I have checked the reports of ds010 and they are not modified or the changes are as expected

@bpinsard bpinsard changed the title Fix/bids filters allow none any [Fix] bids filters allow none and any May 8, 2020
@bpinsard bpinsard requested a review from oesteban May 10, 2020 00:36
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ANY should be added, but null should already work fine. Do you have evidence that it doesn't?

import bids
for k, v in dct.items():
if v is None:
dct[k] = bids.layout.Query.NONE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyBIDS should already treat None like Query.None.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I tried and it did not, and now it does.
Maybe my sleep deprived brain is just making a lot of typos. :/
I will remove it.

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies effigies changed the title [Fix] bids filters allow none and any ENH: Enable filtering for ANY or NONE in --bids-filter-file May 11, 2020
@mgxd mgxd merged commit d9db8b7 into nipreps:master May 12, 2020
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

Successfully merging this pull request may close these issues.

4 participants