Skip to content

PR: FIX Check that file exists in basedir, not current dir #2945

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

Closed
wants to merge 3 commits into from

Conversation

stilley2
Copy link
Contributor

Summary

Fixes #2944

List of changes proposed in this PR (pull-request)

  • modify_paths function checks if argument is a file in the basedir, not the current directory.

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@@ -486,7 +486,7 @@ def modify_paths(object, relative=True, basedir=None):
out = tuple(out)
else:
if isdefined(object):
if isinstance(object, (str, bytes)) and os.path.isfile(object):
if isinstance(object, (str, bytes)) and os.path.isfile(os.path.join(basedir, object)):
Copy link
Contributor

@oesteban oesteban Jun 19, 2019

Choose a reason for hiding this comment

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

Please dismiss this comment.
Please check whether this:

Suggested change
if isinstance(object, (str, bytes)) and os.path.isfile(os.path.join(basedir, object)):
if isinstance(object, (str, bytes)) and os.path.isfile(os.path.join(basedir, os.path.basename(object))):

Does not bring us back to the original problem. My impression is that it will. I agree with @effigies this is a result of loosing track of the traits.

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2945   +/-   ##
=======================================
  Coverage   67.59%   67.59%           
=======================================
  Files         344      344           
  Lines       43747    43747           
  Branches     5456     5456           
=======================================
  Hits        29572    29572           
+ Misses      13466    13458    -8     
- Partials      709      717    +8
Flag Coverage Δ
#smoketests 50.37% <33.33%> (ø) ⬆️
#unittests 65.03% <100%> (ø) ⬆️
Impacted Files Coverage Δ
nipype/pipeline/engine/utils.py 82.26% <100%> (ø) ⬆️
nipype/interfaces/base/core.py 86.88% <100%> (ø) ⬆️
nipype/interfaces/io.py 55.07% <0%> (ø) ⬆️
nipype/interfaces/freesurfer/preprocess.py 66.11% <0%> (ø) ⬆️
nipype/interfaces/dynamic_slicer.py 17.47% <0%> (ø) ⬆️
nipype/interfaces/nipy/preprocess.py 45.79% <0%> (ø) ⬆️

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 7fbc7cb...2e95a8b. Read the comment docs.

oesteban added a commit to oesteban/nipype that referenced this pull request Aug 1, 2019
Once we figure out the problem of ``OutputMultiObject``, we could go
ahead and set fix nipy#2944, fix nipreps/fmriprep#1674, close nipy#2945.
oesteban added a commit to oesteban/nipype that referenced this pull request Aug 1, 2019
Once we figure out the problem of ``OutputMultiObject``, we could go
ahead and set fix nipy#2944, fix nipreps/fmriprep#1674, close nipy#2945.
oesteban added a commit to oesteban/nipype that referenced this pull request Aug 2, 2019
Once we figure out the problem of ``OutputMultiObject``, we could go
ahead and set fix nipy#2944, fix nipreps/fmriprep#1674, close nipy#2945.
@oesteban oesteban closed this in 3ad68d7 Aug 7, 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.

Workflow crashing with file not found due to strange nipype.pipeline.engine.utils.modify_path behavior
4 participants