-
Notifications
You must be signed in to change notification settings - Fork 16
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
ENH: command line interface #55
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
Codecov Report
@@ Coverage Diff @@
## master #55 +/- ##
==========================================
+ Coverage 98.77% 98.84% +0.06%
==========================================
Files 10 11 +1
Lines 819 868 +49
Branches 107 111 +4
==========================================
+ Hits 809 858 +49
Misses 6 6
Partials 4 4
Continue to review full report at Codecov.
|
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.
Looking good!
@@ -0,0 +1,122 @@ | |||
from argparse import ArgumentParser, RawDescriptionHelpFormatter |
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.
click is pretty lightweight - @effigies do you think would be some resistance in nibabel to migrate nib-ls
and other command line scripts I might not be aware of?
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.
In general, nibabel has tried to avoid mandatory dependencies besides numpy
. You might get some pushback on click, but might not, given it doesn't have any dependencies of its own.
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've made the main()
allow supplemental args to be passed in to argparse.ArgumentParser.parse_args()
- hopefully that is sufficient for testing purposes
|
||
|
||
def get_parser(): | ||
desc = dedent(""" |
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.
Does not argparse compose a good description for commands?
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 find it's nice to have a little blurb describing the subparsers at the top level (argparse doesn't do this)
Hello @mgxd! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-12-09 22:50:22 UTC |
Closes #48
Adds
nt
executable for command line usage of nitransforms.Currently only supports
nt apply
, which applies a linear or nonlinear transform to an image.