-
Notifications
You must be signed in to change notification settings - Fork 532
ENH: Add LibraryBaseInterface #2538
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3b25528
ENH: Add LibraryBaseInterface
effigies 3a54409
RF: NipyBaseInterface
effigies 2723c61
RF: NitimeBaseInterface
effigies 37c7895
RF: NilearnBaseInterface
effigies 7a99c27
RF: CMTK with LibraryBaseInterface
effigies 2c1e47b
RF: MRTrix2TrackVis is a DipyBaseInterface
effigies 7e83fac
RF: algorithms.metric.Similarity is a NipyBaseInterface
effigies 516ae7a
TEST: Update NBS import test
effigies be47ff8
TEST: Don't match error message string
effigies c3ee8d4
TEST: Drop unused import
effigies 3d5661c
TEST: make specs
effigies File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
nipype/interfaces/base/tests/test_auto_LibraryBaseInterface.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from __future__ import unicode_literals | ||
from ..core import LibraryBaseInterface | ||
|
||
|
||
def test_LibraryBaseInterface_inputs(): | ||
input_map = dict( | ||
ignore_exception=dict( | ||
deprecated='1.0.0', | ||
nohash=True, | ||
usedefault=True, | ||
), ) | ||
inputs = LibraryBaseInterface.input_spec() | ||
|
||
for key, metadata in list(input_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(inputs.traits()[key], metakey) == value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | ||
# vi: set ft=python sts=4 ts=4 sw=4 et: | ||
""" Base interface for cmtk """ | ||
|
||
from ..base import LibraryBaseInterface | ||
from ...utils.misc import package_check | ||
|
||
|
||
class CFFBaseInterface(LibraryBaseInterface): | ||
_pkg = 'cfflib' | ||
|
||
|
||
# Originally set in convert, nbs, nx, parcellation | ||
# Set here to be imported, in case anybody depends on its presence | ||
# Remove in 2.0 | ||
have_cmp = True | ||
try: | ||
package_check('cmp') | ||
except ImportError: | ||
have_cmp = False | ||
|
||
have_cfflib = True | ||
try: | ||
package_check('cfflib') | ||
except ImportError: | ||
have_cfflib = False | ||
|
||
have_cv = True | ||
try: | ||
package_check('cviewer') | ||
except ImportError: | ||
have_cv = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
nipype/interfaces/cmtk/tests/test_auto_CFFBaseInterface.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from __future__ import unicode_literals | ||
from ..base import CFFBaseInterface | ||
|
||
|
||
def test_CFFBaseInterface_inputs(): | ||
input_map = dict( | ||
ignore_exception=dict( | ||
deprecated='1.0.0', | ||
nohash=True, | ||
usedefault=True, | ||
), ) | ||
inputs = CFFBaseInterface.input_spec() | ||
|
||
for key, metadata in list(input_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(inputs.traits()[key], metakey) == value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this going to generate a lot of warnings when we create docs? or
make specs
? i.e. things that simply create an instance of an interface:InterfaceX()
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.
Yeah, potentially. I guess we could set a class-level flag to only display once per class? Or do you have another preferred approach?
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.
one option would be to remove this if. let's merge it and see how annoying it gets.