Skip to content

Conversation

@mgxd
Copy link
Member

@mgxd mgxd commented Jul 27, 2017

Fixes #2132 .

Changes proposed in this pull request

  • ENH: exclusively select directories

@codecov-io
Copy link

codecov-io commented Aug 22, 2017

Codecov Report

Merging #2134 into master will decrease coverage by <.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2134      +/-   ##
==========================================
- Coverage   72.27%   72.27%   -0.01%     
==========================================
  Files        1174     1174              
  Lines       58738    58741       +3     
  Branches     8454     8455       +1     
==========================================
+ Hits        42453    42454       +1     
- Misses      14924    14925       +1     
- Partials     1361     1362       +1
Flag Coverage Δ
#smoketests 72.27% <33.33%> (-0.01%) ⬇️
#unittests 69.94% <33.33%> (-0.01%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/io.py 53.06% <33.33%> (-0.05%) ⬇️

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 2f422f0...06b45ee. Read the comment docs.

@satra
Copy link
Member

satra commented Sep 25, 2017

could you please add a test with some fake directories and ensure that the test covers scenarios where there is and is not an os.sep at the end of the template

quick question: why couldn't the user at the separator at the end? is this addition necessary?

@satra
Copy link
Member

satra commented Sep 25, 2017

on 20s of further thought, i'm not sure this is change is essential, as a user can easily add the separator, no?

@mgxd
Copy link
Member Author

mgxd commented Sep 27, 2017

@satra the separator will be removed since abspath is called before the glob search

@effigies
Copy link
Member

@mgxd Maybe just check template[-1] == os.sep before applying abspath, and append it afterwards if it was there?

@mgxd
Copy link
Member Author

mgxd commented Sep 27, 2017

@effigies I like that better than my initial solution

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.

LGTM. Couple style comments.


find_dirs = False
if template[-1] == os.sep:
find_dirs = True
Copy link
Member

Choose a reason for hiding this comment

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

find_dirs = template[-1] == os.sep

desc=("Whether to return outputs as a list even when only one file "
"matches the template. Either a boolean that applies to all "
"output fields or a list of output field names to coerce to "
" a list"))
Copy link
Member

Choose a reason for hiding this comment

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

I think these changes should be reverted, or the arguments on the first line of each trait should also be dropped to a newline and un-indented.

@mgxd
Copy link
Member Author

mgxd commented Sep 27, 2017

GTK-thanks!

@mgxd mgxd added this to the 0.14.0 milestone Oct 24, 2017
@mgxd mgxd merged commit a40e056 into nipy:master Oct 27, 2017
@mgxd mgxd deleted the enh/selectdirs branch October 27, 2017 18:03
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