Skip to content

ENH: Modify Directory and File traits to get along with pathlib #2962

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 11 commits into from
Jul 17, 2019

Conversation

oesteban
Copy link
Contributor

@oesteban oesteban commented Jul 16, 2019

Closes #2959

Summary

Fixes # .

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

Acknowledgment

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

@oesteban
Copy link
Contributor Author

Okay, getting green lights with my user's Travis builds.

@effigies
Copy link
Member

Cool. Will look tonight if I get a chance, otherwise first thing in the morning. Thanks for taking this one over.

@effigies
Copy link
Member

Incidentally, we should try to have a release this month...

@oesteban
Copy link
Contributor Author

Thanks for taking this one over

This doesn't address #2944, but sets the ground to tackle it.

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.

This looks reasonable. A few small comments.

@codecov-io
Copy link

Codecov Report

Merging #2962 into master will decrease coverage by 2.68%.
The diff coverage is 84.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2962      +/-   ##
==========================================
- Coverage   66.92%   64.23%   -2.69%     
==========================================
  Files         344      342       -2     
  Lines       43747    43744       -3     
  Branches     5456     5468      +12     
==========================================
- Hits        29277    28100    -1177     
- Misses      13722    14557     +835     
- Partials      748     1087     +339
Flag Coverage Δ
#smoketests ?
#unittests 64.23% <84.14%> (-0.81%) ⬇️
Impacted Files Coverage Δ
nipype/info.py 88.05% <ø> (-5.98%) ⬇️
nipype/interfaces/base/support.py 79.65% <ø> (ø) ⬆️
nipype/interfaces/io.py 49.52% <0%> (-4.84%) ⬇️
nipype/interfaces/spm/base.py 57.94% <100%> (-10.7%) ⬇️
nipype/interfaces/base/__init__.py 100% <100%> (ø) ⬆️
nipype/interfaces/base/core.py 84.37% <100%> (-2.52%) ⬇️
nipype/interfaces/base/traits_extension.py 87.23% <85.86%> (-10.45%) ⬇️
nipype/interfaces/base/specs.py 87.11% <91.66%> (-5.98%) ⬇️
nipype/utils/filemanip.py 76.55% <96.77%> (-2.6%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
... and 49 more

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 bab16a5...d42db56. Read the comment docs.

local_directory = str(self.inputs.local_directory)
bucket_path = str(self.inputs.bucket_path)
template = str(self.inputs.template)
if not os.path.split(local_directory)[1] == '':
Copy link
Member

Choose a reason for hiding this comment

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

minor refactor for added clarity

Suggested change
if not os.path.split(local_directory)[1] == '':
if not os.path.basename(local_directory) == '':

template = str(self.inputs.template)
if not os.path.split(local_directory)[1] == '':
local_directory += '/'
if not os.path.split(bucket_path)[1] == '':
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if not os.path.split(bucket_path)[1] == '':
if not os.path.basename(bucket_path) == '':

@oesteban
Copy link
Contributor Author

@mgxd I'd rather apply your suggestions in a different PR, with the AFNI and other minor fixtures I detached from #2959.

Would that be okay by you?

@oesteban
Copy link
Contributor Author

Everything seems to be checking out - I'll merge, cross your fingers this doesn't break everything.

@oesteban oesteban merged commit b1eb3ee into nipy:master Jul 17, 2019
@effigies
Copy link
Member

🤞

oesteban added a commit to oesteban/nipype that referenced this pull request Jul 17, 2019
@oesteban oesteban deleted the enh/improved-File-Directory-traits branch July 17, 2019 18:39
oesteban added a commit to oesteban/nipype that referenced this pull request Jul 31, 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.

5 participants