Skip to content

FIX: Add desc=preproc as filter when finding preproc BOLD files #204

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

Merged
merged 5 commits into from
Dec 11, 2019

Conversation

adelavega
Copy link
Collaborator

Related issue: bids-standard/pybids#557

Stems from having validate=False, which we only used to do when necessary, but now is applied across the whole master Layout

@pep8speaks
Copy link

pep8speaks commented Dec 11, 2019

Hello @adelavega, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 fitlins.

Comment last updated at 2019-12-11 22:03:14 UTC

@adelavega adelavega reopened this Dec 11, 2019
@adelavega
Copy link
Collaborator Author

Tested, and neuroscout-cli models are running with this change.

Not sure why this didn't come up before, but I think I hadn't rebuilt my fitlins image in a while, and maybe it was on a previous pybids version or something. Upgrading to 0.6.0 did it though.

I guess bugfix release will be needed, ugh.

@effigies
Copy link
Collaborator

I suspect it's because I only used validate=False when constructing models. Most of the layouts I constructed were validated.

@codecov-io
Copy link

codecov-io commented Dec 11, 2019

Codecov Report

Merging #204 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #204   +/-   ##
=======================================
  Coverage   77.35%   77.35%           
=======================================
  Files          18       18           
  Lines        1042     1042           
  Branches      187      187           
=======================================
  Hits          806      806           
- Misses        147      148    +1     
+ Partials       89       88    -1
Flag Coverage Δ
#ds003 77.35% <100%> (ø) ⬆️
Impacted Files Coverage Δ
fitlins/interfaces/bids.py 73.33% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea92778...f818dc6. Read the comment docs.

@@ -231,7 +231,7 @@ def _load_level1(self, runtime, analysis):
TR = ents.pop('RepetitionTime', None) # Required field in seconds
if TR is None: # But is unreliable (for now?)
preproc_files = analysis.layout.get(
extension=['.nii', '.nii.gz'], **ents)
extension=['.nii', '.nii.gz'], desc='preproc', **ents)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any chance ents could already contain 'desc'? If so, this is setting us up for an error.

Copy link
Collaborator Author

@adelavega adelavega Dec 11, 2019

Choose a reason for hiding this comment

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

It doesn't, I checked. Makes sense because the entities are coming from the design matrix which doesn't have that key.

bold_file = layout.get(**selectors)

if len(bold_file) == 0:
raise FileNotFoundError(
"Could not find BOLD file in {} with entities {}"
"".format(self.inputs.bids_dir, selectors))
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about layout.root?

@adelavega
Copy link
Collaborator Author

I suspect it's because I only used validate=False when constructing models. Most of the layouts I constructed were validated.

Yep, that's exactly what happened.

@adelavega
Copy link
Collaborator Author

I'm not too happy about validate=False for other reasons though. So maybe we should keep this in mind for a future fix/alternate way of doing things.

@effigies
Copy link
Collaborator

What if we enable validation but package our own config that handles smdl suffixes and model entities?

@adelavega
Copy link
Collaborator Author

That's probably the best thing to do yeah

@adelavega
Copy link
Collaborator Author

Merging, hope that's allright.

@adelavega adelavega merged commit dd9948b into poldracklab:master Dec 11, 2019
@adelavega adelavega deleted the filter_desc branch December 11, 2019 23:27
@adelavega adelavega changed the title Add desc=preproc as filter when finding preproc BOLD files FIX: Add desc=preproc as filter when finding preproc BOLD files Dec 11, 2019
@adelavega adelavega mentioned this pull request Dec 12, 2019
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