Skip to content

Commit 7a198f7

Browse files
committed
Mark all types non-enum as frozen dataclasses
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 540da39 commit 7a198f7

File tree

1 file changed

+8
-7
lines changed
  • src/frequenz/client/electricity_trading

1 file changed

+8
-7
lines changed

src/frequenz/client/electricity_trading/_types.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ def to_pb(self) -> delivery_duration_pb2.DeliveryDuration.ValueType:
371371
return delivery_duration_pb2.DeliveryDuration.ValueType(self.value)
372372

373373

374+
@dataclass(frozen=True)
374375
class DeliveryPeriod:
375376
"""
376377
Time period during which the contract is delivered.
@@ -906,7 +907,7 @@ def to_pb(
906907
return self.value
907908

908909

909-
@dataclass()
910+
@dataclass(frozen=True)
910911
class Order: # pylint: disable=too-many-instance-attributes
911912
"""Represents an order in the electricity market."""
912913

@@ -1094,7 +1095,7 @@ def __eq__(self, other: object) -> bool:
10941095
)
10951096

10961097

1097-
@dataclass()
1098+
@dataclass(frozen=True)
10981099
class Trade: # pylint: disable=too-many-instance-attributes
10991100
"""Represents a private trade in the electricity market."""
11001101

@@ -1228,7 +1229,7 @@ def to_pb(self) -> electricity_trading_pb2.OrderDetail.StateDetail:
12281229
)
12291230

12301231

1231-
@dataclass()
1232+
@dataclass(frozen=True)
12321233
class OrderDetail:
12331234
"""
12341235
Represents an order with full details, including its ID, state, and associated UTC timestamps.
@@ -1315,7 +1316,7 @@ def to_pb(self) -> electricity_trading_pb2.OrderDetail:
13151316
)
13161317

13171318

1318-
@dataclass()
1319+
@dataclass(frozen=True)
13191320
class PublicTrade: # pylint: disable=too-many-instance-attributes
13201321
"""Represents a public order in the market."""
13211322

@@ -1752,7 +1753,7 @@ def to_pb(self) -> electricity_trading_pb2.PublicTradeFilter:
17521753
)
17531754

17541755

1755-
@dataclass()
1756+
@dataclass(frozen=True)
17561757
class UpdateOrder: # pylint: disable=too-many-instance-attributes
17571758
"""
17581759
Represents the order properties that can be updated after an order has been placed.
@@ -1892,7 +1893,7 @@ def to_pb(self) -> electricity_trading_pb2.UpdateGridpoolOrderRequest.UpdateOrde
18921893
)
18931894

18941895

1895-
@dataclass()
1896+
@dataclass(frozen=True)
18961897
class PublicOrder: # pylint: disable=too-many-instance-attributes
18971898
"""Represents a public order in the market."""
18981899

@@ -1993,7 +1994,7 @@ def to_pb(self) -> electricity_trading_pb2.PublicOrderBookRecord:
19931994
)
19941995

19951996

1996-
@dataclass()
1997+
@dataclass(frozen=True)
19971998
class PublicOrderBookFilter:
19981999
"""Parameters for filtering the public orders in the market."""
19992000

0 commit comments

Comments
 (0)