-
Notifications
You must be signed in to change notification settings - Fork 309
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
feat(generate_classes): create a command-line interface #1912
Conversation
654c096
to
2127262
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1912 +/- ##
=========================================
- Coverage 72.5% 72.5% -0.1%
=========================================
Files 257 257
Lines 56276 56294 +18
=========================================
+ Hits 40849 40853 +4
- Misses 15427 15441 +14
|
Thanks @mwtoews I did overlook the defaults in 1907. I wonder if this could see use beyond developers e.g. modelers beta testing unreleased versions of modflow6. Are there downsides to adding a project.scripts command besides occupying the command name, e.g. |
There's no big downsides, it just creates several objects (e.g. an Calling modules in Python is pretty common (e.g. |
Another future consideration is to expose a top-level
and I say future consideration, since there could be other potential sub-commands. A few ideas:
And probably others. You can see example sub-commands with |
@w-bonelli not sure if your recent CI changes impact this PR. |
I think this should not present any CI issues. The top-level |
This is a simple command-line interface for
generate_classes()
using the-m
switch method with argparse, which is cleaner than using the-c
command switch approach. E.g., compare:Built-in help is shown with
python -m flopy.mf6.utils.generate_classes -h
.At this time, it is not added to
[project.scripts]
(likeget-modflow
) since this is generally a developer feature, not a user feature.Also, not sure if this was overlooked from #1907, but the defaults to
generate_classes()
would always show:This is resolved by swapping these defaults to
branch=None
andref="master"
.Closes #1629