CLI for Basic Workflows
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
Research direction
Start by reading the existing Python workflow scripts and the H2IntegrateModel entry points, then check how project configurations such as run.yaml are loaded and how the examples invoke workflows. The issue proposes a CLI for running workflows from a project path, with optional standardized post-processing and additional pathways, but does not identify specific files or tests. Done means the proposed workflows can be invoked through a CLI; the command interface and scope still need to be agreed.
Written by the indexing model from the issue text.
Description
Create a CLI for standardized workflows
Because many of the examples are simply an exposition of running a series of configurations, we should simplify this process by creating a command line interface (CLI) to complete these 4 line workflows. If ambitious, the CLI should also incorporate standardized post-processing routines as well.
Proposed solution
Assuming a project folder with a run.yaml referencing any other required configurations, users should be able to run h2i run /relative/path/to/project run.yaml.
If multiple run pathways are desired, the run command could take additional modifiers such as --standard, --pathway1, etc. similar to pre-commit run --all-files. Here I imagine --standard (or similar) as the default pathway.
Once run, I also think the working directory should be temporarily changed to the provided relevant path to maintain continuity with how the current Python scripts work but with the convenience of not needing to change paths in the terminal itself.
Additional modeling pathways could be also be developed for any pre- or post-processing workflows such as h2i plot --pathway1 arg1 arg2.
Alternatives considered
Continue to write files with the standard workflow:
# run.py inside project folder
from h2integrate import H2IntegrateModel
h2i = H2IntegrateModel("primary_config.yaml")
h2i.run()
h2i.post_process()
Additional context
Previously I've used Typer, which is built on Click, but after using Typer more extensively, I think Click itself or Typer is better suited. Click requires a bit more upfront work, so Cyclopts would be an easier build out than either Typer or Click. The standard library argparse is another option, but is tedious when developing more robust interfaces.
Click: https://click.palletsprojects.com/en/stable/
Cyclopts: https://cyclopts.readthedocs.io/en/stable/index.html
- Dominant language
- Python
- Stars
- 30
- Forks
- 44
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NatLabRockies/H2Integrate
-
infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NatLabRockies/H2Integrate#977 ·
Maintainers usually reply within 1 day
-
SimpleThermalNuclearReactorCostModel: variable O&M overstated 1000x (kWh treated as MWh)Possibly taken A pull request linked to this issue is open or already merged. Openbug finance
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
NatLabRockies/H2Integrate#968 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NatLabRockies/H2Integrate#944 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NatLabRockies/H2Integrate#894 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NatLabRockies/H2Integrate#623 ·
Maintainers usually reply within 1 day
All issues in NatLabRockies/H2Integrate
Similar issues
-
PluginProvider.storeInstance races and clobbers the dedup cache for concurrent loadsPossibly taken @Wilson0511 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
community documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kagent-dev/kagent#3462 ·
Maintainers usually reply within 1 day