Skip to content

Allow nipype.cfg in cwd to be read even if ~/.nipype does not exist #3072

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 2 commits into from
Oct 8, 2019

Conversation

stilley2
Copy link
Contributor

@stilley2 stilley2 commented Oct 8, 2019

Fixes a bug where the nipype.cfg in the current directory would not
be read if the folder ~/.nipype does not exist.

Acknowledgment

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

Fixes a bug where the nipype.cfg in the current directory would not
be read if the folder ~/.nipype does not exist.
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.

Checking pydoc:

configparser.ConfigParser.read = read(self, filenames, encoding=None)
    Read and parse a filename or an iterable of filenames.
    
    Files that cannot be opened are silently ignored; this is
    designed so that you can specify an iterable of potential
    configuration file locations (e.g. current directory, user's
    home directory, systemwide directory), and all existing
    configuration files in the iterable will be read.  A single
    filename may also be given.
    
    Return list of successfully read files.

LGTM.

@effigies effigies added this to the 1.3.0 milestone Oct 8, 2019
@effigies
Copy link
Member

effigies commented Oct 8, 2019

Please merge/rebase master to fix the tests.

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #3072 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3072      +/-   ##
==========================================
- Coverage   68.19%   68.19%   -0.01%     
==========================================
  Files         297      297              
  Lines       39771    39770       -1     
  Branches     5210     5209       -1     
==========================================
- Hits        27123    27121       -2     
- Misses      11939    11940       +1     
  Partials      709      709
Flag Coverage Δ
#smoketests 51.77% <100%> (-0.01%) ⬇️
#unittests 65.44% <100%> (ø) ⬆️
Impacted Files Coverage Δ
nipype/utils/config.py 65.94% <100%> (-0.19%) ⬇️
nipype/__init__.py 61.9% <0%> (-3.18%) ⬇️
nipype/pipeline/plugins/legacymultiproc.py 68% <0%> (+0.5%) ⬆️

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 1725f51...097cf75. Read the comment docs.

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.

3 participants