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

Separate top-level config and parameters #452

Closed
brynpickering opened this issue Apr 19, 2023 · 1 comment
Closed

Separate top-level config and parameters #452

brynpickering opened this issue Apr 19, 2023 · 1 comment
Projects
Milestone

Comments

@brynpickering
Copy link
Member

Problem description

run and model configs mix up configuration and parameters. We want to be able to pipe these parameters to the Calliope model dataset and then onto the backend. We handle that at the moment with hardcoding which are parameters in the core code, which isn't ideal. An idea on how to change these YAML structures:

config:
  init:
    name: null
    calliope_version: null
    random_seed: null
    subset_time: null
    time: {}
    timeseries_data_path: null 
    timeseries_data: null 
    timeseries_dateformat: "%Y-%m-%d %H:%M:%S"
  build:
    custom_math: []
    backend: pyomo
    cyclic_storage: true
    ensure_feasibility: false
    mode: plan
  solve: 
    operate_window: null
    operate_horizon: null
    operate_use_cap_results: false
    spores_number: 3
    spores_score_cost_class: spores_score
    spores_slack_cost_group: null
    spores_save_per_spore: false
    spores_save_per_spore_path: null
    spores_skip_cost_op: false
    save_logs: null
    solver_io: null
    solver_options: null
    solver: cbc
    zero_threshold: 1e-10

parameters:
  reserve_margin: {electricity: 0.1}
  bigM: 1e9
  objective_cost_class: {"costs": {"monetary": 1, "emissions": 0.1}}
  my_param: {("costs", "carriers"): {("monetary", "electricity"): 1, ("monetary", "heat"): 0.1}}
  spores_slack: 0.1
  spores_objective_cost_class: {"costs": {spores_score: 1, monetary: 0} }

Other things:

  • file_allowed is deprecated.
  • All config items could become arguments in the relevant methods (init in calliope.Model)/(build in calliope.Model.build)/(solve in calliope.Model.solve).
  • ^ config items then have to be flattened so they can be used by args.
  • parameters can be dimensionless or have dimensions in a dict form (for non-tech/node/tech+node dims). This is very simplified and wouldn't work well for large parameters. That's ok because we would solve it in the long (hopefully medium) term with Load non-timeseries data from file #92.
  • Users can then add their own top-level parameters to 'parameters' for use in their custom constraints.

Calliope version

v0.7.0-dev

@brynpickering brynpickering added this to Refactoring user-facing in v0.7.0 Apr 21, 2023
@brynpickering brynpickering added this to the 0.7.0.b1 milestone Apr 21, 2023
@brynpickering
Copy link
Member Author

brynpickering commented Oct 27, 2023

Completed in #497

v0.7.0 automation moved this from Refactoring user-facing to Done Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

1 participant