Skip to content

WIP: Move nipype commands to a group command #1608

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 23 commits into from
Oct 9, 2016
Merged

Conversation

alexsavio
Copy link
Contributor

This is a continuation of #1596.
I am using click to create a group command, instead of adding all commands as separate scripts in the bin folder.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

6 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-0.09%) to 72.176% when pulling 4237c65 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.125% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.125% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.125% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

coveralls commented Sep 9, 2016

Coverage Status

Coverage decreased (-0.1%) to 72.125% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.141% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.141% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.141% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 72.141% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@coveralls
Copy link

coveralls commented Sep 9, 2016

Coverage Status

Coverage decreased (-0.1%) to 72.141% when pulling b2c9867 on alexsavio:master into 0f9a620 on nipy:master.

@alexsavio
Copy link
Contributor Author

I still can't figure out if there is any clean way of using Click for the --format option in the convert command. For now I added a to_boutiques command.

@coveralls
Copy link

coveralls commented Sep 9, 2016

Coverage Status

Coverage decreased (-0.1%) to 72.124% when pulling 8207421 on alexsavio:master into 0f9a620 on nipy:master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 9, 2016

Coverage Status

Coverage decreased (-0.1%) to 72.124% when pulling 8207421 on alexsavio:master into 0f9a620 on nipy:master.

@alexsavio
Copy link
Contributor Author

alexsavio commented Sep 12, 2016

The only option I can see is to have a simple click command with a --format parameter which forwards the rest of arguments to the nipype2boutiques function that uses an ArgumentParser to parse the rest of arguments. What do you think?

@satra
Copy link
Member

satra commented Sep 12, 2016

@alexsavio - this section (http://click.pocoo.org/5/quickstart/#nesting-commands) and the next suggests how to include subcommands and options.

so perhaps two sets of groups (one for main nipype_cli - e.g., show, convert) and one for format type (boutique, cwl, etc.,.) under convert with their own options would work.

so something along the lines of this example (without the chaining):

pallets/click#415

@alexsavio
Copy link
Contributor Author

Thanks @satra. Now it looks like nipype convert boutiques and the --help option works as expected as well.
I tested all the commands except the convert boutiques one. It would be nice to have an example of how to run it.

@codecov-io
Copy link

codecov-io commented Sep 12, 2016

Current coverage is 70.82% (diff: 29.91%)

Merging #1608 into master will increase coverage by 1.01%

@@             master      #1608   diff @@
==========================================
  Files           995       1032     +37   
  Lines         48658      51798   +3140   
  Methods           0          0           
  Messages          0          0           
  Branches       7317       7341     +24   
==========================================
+ Hits          33965      36685   +2720   
- Misses        13271      14024    +753   
+ Partials       1422       1089    -333   

Powered by Codecov. Last update 43ac390...3e650d4

@satra satra mentioned this pull request Sep 13, 2016
@alexsavio
Copy link
Contributor Author

Hi,
I think this is ready. I took the liberty of removing the old bin implementation, also from the setup file.
Please have a look.

@satra
Copy link
Member

satra commented Oct 1, 2016

@alexsavio - could we merge with current master and make sure the tests pass for this.

@alexsavio
Copy link
Contributor Author

yes, please.

On Sat, 1 Oct 2016, 22:29 Satrajit Ghosh, notifications@github.com wrote:

@alexsavio https://github.com/alexsavio - could we merge with current
master and make sure the tests pass for this.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1608 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACW4jJkt_COzBpchb0-hyyRyf5QW6M3dks5qvsKlgaJpZM4J4PUb
.

Sent from my phone, sorry for brevity or typos.

@oesteban
Copy link
Contributor

oesteban commented Oct 4, 2016

This is a great addition!.

Please, merge #1627 first... :)

@satra
Copy link
Member

satra commented Oct 6, 2016

@alexsavio - could you please merge with current master and resolve the conflicts.

@alexsavio
Copy link
Contributor Author

Ok, sorry. I didn't get your previous message. Merged master.

@@ -8,6 +8,7 @@ nose>=1.2
future==0.15.2
simplejson>=3.8.0
prov>=1.4.0
click>=6.6.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, add 'click' in nipype/info.py, in the REQUIRES list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

value = str2bool(value)
except:
pass
print("setting function inputs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use logging instead of prints?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied this from the previous existing functions. Would you like me to use logging instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the old nipype_cmd it makes sense. Probably it doesn't for nipype_display_crash and others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is previous code, I think I can do this in another PR.

ignore_template_numbers)

# Writes JSON string to file
with open(output, 'w') as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add from io import open at the top (py2/3 compatibility)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

alexsavio and others added 6 commits October 6, 2016 17:52
* upstream/master:
  undo matplotlib change.
  move badge to codecov
  disable matplotlib extension to test doc building.
  merge upstream master
  fix: retroicor - cleaned up interface, vim presets
@alexsavio
Copy link
Contributor Author

Thanks @satra

@satra satra merged commit 865ad49 into nipy:master Oct 9, 2016
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.

6 participants