NatLabRockies / NatLabRockies/H2Integrate
Feature request: Option to Save or Not Save Plots
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 44
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 16
Description
Optionally Save HOPP plots
Every time HOPP is run, battery_output.png and generation_profile.png are created, which are not universally required. For both testing and docs building, this is unnecessary and requires additional teardown steps. Ideally, this should be a model input parameter.
Proposed solution
Include an option in the HOPP config (using https://github.com/NatLabRockies/H2Integrate/blob/main/examples/25_sizing_modes/tech_inputs/hopp_config_tx.yaml#L209) as an example, it could go in the simulation_options like the following, which would allow for the code modifications listed beneath.
#hopp_config_tx.yaml
...
config:
simulation_options:
cache: true
save_figures: false
wind:
skip_financial: false
# h2integrate/converters/hopp/hopp_wrapper.py::161
try:
system = self.hybrid_interface.system
save = self.hopp_config["config"]["simulation_options"]["save_figures"]
plot_battery_output(system, start_day=180, plot_filename="battery_output.png" if save else None)
plot_generation_profile(
system, start_day=180, plot_filename="generation_profile.png" if save else None
)
except AttributeError:
pass
Alternatives considered
Currently these are included in the .gitignore, and to remove them locally I either delete them manually. In a separate testing work, their removal is part of a teardown phase, but the example itself is called in more than one place, so this is required in more than one place.
Additional context
Contributor 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.
Research direction
Start in h2integrate/converters/hopp/hopp_wrapper.py around line 161 and review the HOPP configuration example at examples/25_sizing_modes/tech_inputs/hopp_config_tx.yaml around line 209. Trace the other places where the example is called, then verify that the new option controls creation of battery_output.png and generation_profile.png so testing and docs builds do not require teardown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100