NREL-Sienna / PowerSystems.jl

Data structures in Julia to enable power systems analysis. Part of the Scalable Integrated Infrastructure Planning Initiative at the National Renewable Energy Lab.
https://www.nrel.gov/analysis/sienna.html
BSD 3-Clause "New" or "Revised" License
299 stars 71 forks source link

Support cost struct unit conversions #1143

Open GabrielKS opened 6 days ago

GabrielKS commented 6 days ago

CostCurve and FuelCurve keep track of power_units::UnitSystem. Also, FuelCurve has a fuel_cost, which is sometimes a scalar. It would be useful to have built-in support for

  1. Conversion of CostCurves and FuelCurves from one UnitSystem to another
  2. Conversion from FuelCurve to CostCurve if the fuel_cost is scalar

as we are currently doing both of these things manually ad hoc.

For 1, an easy approach would involve a function that takes the CostCurve/FuelCurve, the desired units, and a component reference or some other way to look up the relevant conversion factors. That might be a good first issue. Depending on how https://github.com/NREL-Sienna/PowerSystems.jl/issues/1134 is resolved, a cleaner solution might be possible later.

For 2, the converter function (or overloaded constructor — CostCurve(fuel_curve)) is trivial, also a good first issue.