NatLabRockies / NatLabRockies/H2Integrate

Feature request: Option to Save or Not Save Plots

Open
#512 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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.

https://github.com/NatLabRockies/H2Integrate/blob/d51a3cd99389be7b922f1c0329fbb3920cb94be3/h2integrate/converters/hopp/hopp_wrapper.py#L161C13-L168C21

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.