Skip to content
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

Create greenheart input/output configs #283

Open
camirmas opened this issue Mar 6, 2024 · 0 comments
Open

Create greenheart input/output configs #283

camirmas opened this issue Mar 6, 2024 · 0 comments
Assignees

Comments

@camirmas
Copy link
Collaborator

camirmas commented Mar 6, 2024

greenheart input/output configs

Currently, run_simulation takes many arguments, including filenames, which are then loaded and used to run the simulation. This makes programmatic runs (i.e. optimization) more difficult and time consuming.

We are mixing concerns between interface and implementation. This leads to issues where there is no way to specify whether a value should be taken from the config, or calculated within the simulation. These side effects are difficult to track down and may cause misleading results for researchers.

Proposed solution

We need to be able to run the greenheart simulation in a more flexible way. The file handling and other configuration elements should be pulled out so that we may split the configuration/interface from the implementation. We have something similar in the Hopp -> HybridSimulation workflow, so we can use a similar pattern here:

  • GreenHeartConfig: dataclass responsible for the interface to run_simulation. The initialization logic can live on this class, or in some function like configure_simulation
  • run_simulation: will now take GreenHeartConfig as an argument
  • GreenHeartOutputs: dataclass that encapsulates relevant outputs

Within run_simulation, we can then utilize the config to determine whether fields should be calculated or user-specified.

Alternatives considered

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants