Skip to content

Commit

Permalink
Revert "Merge pull request frequenz-floss#18 from camille-bouvy-frequ…
Browse files Browse the repository at this point in the history
…enz/energy-type"

This reverts commit e2e84c5, reversing
changes made to e28559f.

Signed-off-by: camille-bouvy-frequenz <camille.bouvy@frequenz.com>
  • Loading branch information
camille-bouvy-frequenz committed Jan 16, 2024
1 parent e2e84c5 commit 8f02cbf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
1 change: 0 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Commiting the API definitions and preparing the repo to the pass all CI tests.
- Commiting the electricity trading api specs.
- Rename PublicOrders to PublicTrades
- Add a python client with pyton wrappers for methods & classes and support for streaming orders.
- Add unit conversion methods to the Energy type

## Bug Fixes

Expand Down
40 changes: 0 additions & 40 deletions py/frequenz/client/electricity_trading/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,46 +144,6 @@ def to_pb(self) -> energy_pb2.Energy:
decimal_mwh.value = str(self.mwh)
return energy_pb2.Energy(mwh=decimal_mwh)

def as_watt_hours(self) -> Decimal:
"""Return the energy in watt hours.
Returns:
The energy in watt hours.
"""
return self.mwh * Decimal(1e6)

def as_kilowatt_hours(self) -> Decimal:
"""Return the energy in kilowatt hours.
Returns:
The energy in kilowatt hours.
"""
return self.mwh * Decimal(1e3)

@classmethod
def from_watt_hours(cls, watt_hours: Decimal) -> Self:
"""Initialize a new energy quantity from watt hours.
Args:
watt_hours: The energy in watt hours.
Returns:
A new energy quantity.
"""
return cls(mwh=watt_hours / Decimal(1e6))

@classmethod
def from_kilowatt_hours(cls, kilowatt_hours: Decimal) -> Self:
"""Initialize a new energy quantity from kilowatt hours.
Args:
kilowatt_hours: The energy in kilowatt hours.
Returns:
A new energy quantity.
"""
return cls(mwh=kilowatt_hours / Decimal(1e3))


class EnergyMarketCodeType(enum.Enum):
"""
Expand Down

0 comments on commit 8f02cbf

Please sign in to comment.