-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use click to allow command line arguments #79
Conversation
Click seems better suited to this task than argparse since pyproject.toml wants to call run() from cupid/run.py rather than running run.py as a command line script. First pass added --serial and --time-series flags; the former can be updated to skip creating the LocalCluster object in notebooks, the latter can be updated to run time series generation directly.
Also make use of serial in ocean and ice notebooks
click is already in the cupid-dev environment, but it was not listed as a dependency in the pyproject.toml file
For now, this option raises a NotImplementedError exception. The branch that incorporates time series should remove that block (as well as the "import sys" line)
A few notes:
|
Should we also include the flag options in the README, or at least mention that descriptions are available with |
Yes! I'll update the README now. |
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 is a good first pass at these features, thanks for diving into this Mike!
Another thought is we probably want to include some more extensive documentation for people developing notebooks about including the serial parameter and logic with the local cluster, maybe in a separate page about parallelization, but I don't think that has to happen with this PR.
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.
Great! All these options are working for me. Thanks for adding a bit of info on this to the README. I agree with Lev's comment above, too.
I made a note in #73 about documentation, so will merge and close this. |
Sorry about the misleading branch name, but
click
seems better suited to this task thanargparse
sincepyproject.toml
wants to callrun()
fromcupid/run.py
rather than runningrun.py
as a command line script.Fixes #72