-
Notifications
You must be signed in to change notification settings - Fork 532
[ENH] Refactoring of nipype.interfaces.utility #1828
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
Conversation
Split utility.py into a module
nipype/interfaces/utility/base.py
Outdated
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data')) | ||
>>> os.chdir(datadir) | ||
|
||
.. testsetup:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the older form not necessary anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were printing those code-blocks in the documentation, but now I see we must be manually parsing them out, right?.
The .. testsetup::
directive just makes sure that the code is run before doctests but not printed out in the documentation.
I guess this would be more appropriate, since sphinx has a directive for this use case of docstrings. But I don't mind to roll it back if you want :).
nipype/interfaces/utility/csv.py
Outdated
Change directory to provide relative paths for doctests | ||
|
||
.. testsetup:: | ||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question here.
nipype/testing/fixtures.py
Outdated
@@ -25,12 +30,13 @@ def analyze_pair_image_files(outdir, filelist, shape): | |||
|
|||
|
|||
def nifti_image_files(outdir, filelist, shape): | |||
if not isinstance(filelist, (list, tuple)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be replaced with filename2list
from filemanip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thanks!
Codecov Report
@@ Coverage Diff @@
## master #1828 +/- ##
=========================================
Coverage ? 72.71%
=========================================
Files ? 1059
Lines ? 52550
Branches ? 0
=========================================
Hits ? 38211
Misses ? 14339
Partials ? 0
Continue to review full report at Codecov.
|
This PR splits the interfaces in nipype.interfaces.utility to make this code easier to maintain. The new three sub-modules are:
Function
interface for now. I am working on a Workflow wrapper that will be placed here.All the interfaces are loaded at module import, so the new module should behave the same way it was doing before.