Skip to content

Commit

Permalink
fix: Added correct unit validation for FuelPrice.
Browse files Browse the repository at this point in the history
  • Loading branch information
pesap committed Nov 19, 2024
1 parent 03c5e05 commit 0e5f68d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/r2x/defaults/plexos_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Charge Efficiency": "%",
"Fixed Load": "MW",
"Forced Outage Rate": "%",
"Fuel Price": "$/MMbtu",
"Heat Rate": "MMBtu/MWh",
"Initial SoC": "%",
"Initial Volume": "GWh",
Expand Down
4 changes: 2 additions & 2 deletions src/r2x/models/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from r2x.enums import PrimeMoversType
from r2x.units import (
ActivePower,
FuelPrice,
Percentage,
PowerRate,
ApparentPower,
VOMPrice,
ureg,
Time,
Energy,
Expand Down Expand Up @@ -59,7 +59,7 @@ class Generator(Device):
must_run: Annotated[int | None, Field(description="If we need to force the dispatch of the device.")] = (
None
)
vom_price: Annotated[FuelPrice, Field(description="Variable operational price $/MWh.")] | None = None
vom_price: Annotated[VOMPrice, Field(description="Variable operational price $/MWh.")] | None = None
prime_mover_type: (
Annotated[PrimeMoversType, Field(description="Prime mover technology according to EIA 923.")] | None
) = None
Expand Down
6 changes: 5 additions & 1 deletion src/r2x/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class HeatRate(BaseQuantity):


class FuelPrice(BaseQuantity):
__base_unit__ = "usd/watthour"
__base_unit__ = "usd/Btu"


class VOMPrice(BaseQuantity):
__base_unit__ = "usd/kWh"


class Energy(BaseQuantity):
Expand Down

0 comments on commit 0e5f68d

Please sign in to comment.