calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
276 stars 89 forks source link

Allow setting saving of shadow prices for constraints in YAML #581

Closed sjpfenninger closed 1 month ago

sjpfenninger commented 3 months ago

What can be improved?

We should allow the user to configure a list of constraints for which shadow prices should be saved in YAML, and have these then dropped into the results as data variables with some standard naming like shadow_price_{constraintname}.

Something like: config.solve.save_shadow_prices: [system_balance] resulting in shadow_price_system_balance as a variable in the results.

Version

v0.7.0.dev

brynpickering commented 3 months ago

Another option is to have it as a param in the math. E.g.

Pros: one place for constraint names; more likely that you get the constraint name right when defining it? Cons: you have to have this in a separate file and load it as additional math.

constraints:
  system_balance:
    save_shadow_price: true
sjpfenninger commented 3 months ago

Could also work. I would add as another con that this mixes something that's more akin to a config for postprocessing with the math definition?