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

fix: Added correct unit validation for FuelPrice. #86

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 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 All @@ -23,7 +24,7 @@
"Min Up Time": "h",
"Min Volume": "GWh",
"Penalty Price": "$",
"Price": "$/MMbtu",
"Price": "$/MMBtu",
"Production Coefficient": "kg",
"Production Rate": "tonne/MWh",
"Pump Efficiency": "%",
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