-
Notifications
You must be signed in to change notification settings - Fork 532
MRG: allow more support for cli #1908
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
Codecov Report
@@ Coverage Diff @@
## master #1908 +/- ##
==========================================
+ Coverage 70.45% 72.21% +1.76%
==========================================
Files 1086 1088 +2
Lines 55291 55527 +236
Branches 7994 8009 +15
==========================================
+ Hits 38956 40100 +1144
+ Misses 14927 14161 -766
+ Partials 1408 1266 -142
Continue to review full report at Codecov.
|
@chrisfilo - a review here would be helpful - currently many of the cli break because we don't have full support. this is an attempt to improve that a bit. |
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.
Looks good to me. Some possible improvements attached.
nipype/scripts/utils.py
Outdated
trait_type = type(spec.inner_traits[0].trait_type.default_value) | ||
if trait_type in (bool, str, int, float): | ||
args["type"] = trait_type | ||
|
||
if hasattr(spec, "mandatory") and spec.mandatory: |
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.
if getattr(spec, "mandatory", False):
nipype/scripts/utils.py
Outdated
trait_type = type(spec.trait_type.default_value) | ||
if trait_type in (str, int, float): | ||
args["type"] = trait_type | ||
elif len(spec.inner_traits) == 1: |
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.
What if len(spec.inner_traits) > 1
? is that a possible case?. If so, we should raise an error
nipype/scripts/utils.py
Outdated
# current support is for simple trait types | ||
if not spec.inner_traits: | ||
trait_type = type(spec.trait_type.default_value) | ||
if trait_type in (str, int, float): |
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.
For compatibility, we should add an from builtins import str, bytes
. Also, add bytes
to this check.
Finally, change the type if trait_type
is bytes
to be str
nipype/scripts/utils.py
Outdated
args["type"] = trait_type | ||
elif len(spec.inner_traits) == 1: | ||
trait_type = type(spec.inner_traits[0].trait_type.default_value) | ||
if trait_type in (bool, str, int, float): |
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 as before with bytes
* master: (131 commits) Update ISSUE_TEMPLATE.md fix: more py36 fixes and doc updates [skip ci] Update CHANGES [ENH] Add interface to antsAffineInitializer add g++ to docker base file fix: streamlines less than 100 fix: sidestep Undefined issue setting self.numthreads to omp_core_val if set fix: deprecation cycle and basic testing fix: typo FIX: Typo in private method name doc: clean up option presentation enh: clean up documentation fix: update tests and integration tests to py36 fix: installation options and test on py36 fix: fixed failing tests fix: remove mask_file check enh: multiple masks and options to compcor docstrings fix code readability improvements ...
* upstream/master: fix errors in niftyreg workflows docstrings fixing the confounds doc build disable dummy test, close nipy#1933 force exit if any test failed [skip ci] Update CHANGES [FIX] Ensure build fails in Circle when tests fail Fixed description. fixing arg strings fixing expected output string naming fixes Added documentation and doctests. add qwarp
consider using this: https://pypi.python.org/pypi/traitscli