Skip to content

Commit 8918467

Browse files
committed
Remove Fuse component
This component was removed from the microgrid API v0.18. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent ef43fa5 commit 8918467

File tree

8 files changed

+0
-164
lines changed

8 files changed

+0
-164
lines changed

src/frequenz/client/microgrid/component/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
UnrecognizedEvCharger,
3131
UnspecifiedEvCharger,
3232
)
33-
from ._fuse import Fuse
3433
from ._grid_connection_point import GridConnectionPoint
3534
from ._hvac import Hvac
3635
from ._inverter import (
@@ -84,7 +83,6 @@
8483
"EvCharger",
8584
"EvChargerType",
8685
"EvChargerTypes",
87-
"Fuse",
8886
"GridConnectionPoint",
8987
"Hvac",
9088
"HybridEvCharger",

src/frequenz/client/microgrid/component/_category.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class ComponentCategory(enum.Enum):
6161
external precharging modules.
6262
"""
6363

64-
FUSE = components_pb2.COMPONENT_CATEGORY_FUSE
65-
"""A fuse."""
66-
6764
VOLTAGE_TRANSFORMER = components_pb2.COMPONENT_CATEGORY_VOLTAGE_TRANSFORMER
6865
"""A voltage transformer.
6966

src/frequenz/client/microgrid/component/_component_proto.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
UnrecognizedEvCharger,
3939
UnspecifiedEvCharger,
4040
)
41-
from ._fuse import Fuse
4241
from ._grid_connection_point import GridConnectionPoint
4342
from ._hvac import Hvac
4443
from ._inverter import (
@@ -362,20 +361,6 @@ def component_from_proto_with_issues(
362361
)
363362
case unexpected_ev_charger_type:
364363
assert_never(unexpected_ev_charger_type)
365-
case ComponentCategory.FUSE:
366-
rated_current = message.category_type.fuse.rated_current
367-
# No need to check for negatives because the protobuf type is uint32.
368-
return Fuse(
369-
id=base_data.component_id,
370-
microgrid_id=base_data.microgrid_id,
371-
name=base_data.name,
372-
manufacturer=base_data.manufacturer,
373-
model_name=base_data.model_name,
374-
status=base_data.status,
375-
operational_lifetime=base_data.lifetime,
376-
rated_bounds=base_data.rated_bounds,
377-
rated_current=rated_current,
378-
)
379364
case ComponentCategory.GRID:
380365
rated_fuse_current = message.category_type.grid.rated_fuse_current
381366
# No need to check for negatives because the protobuf type is uint32.

src/frequenz/client/microgrid/component/_fuse.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/frequenz/client/microgrid/component/_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from ._crypto_miner import CryptoMiner
1212
from ._electrolyzer import Electrolyzer
1313
from ._ev_charger import EvChargerTypes, UnrecognizedEvCharger, UnspecifiedEvCharger
14-
from ._fuse import Fuse
1514
from ._grid_connection_point import GridConnectionPoint
1615
from ._hvac import Hvac
1716
from ._inverter import InverterTypes, UnrecognizedInverter, UnspecifiedInverter
@@ -52,7 +51,6 @@
5251
| CryptoMiner
5352
| Electrolyzer
5453
| EvChargerTypes
55-
| Fuse
5654
| GridConnectionPoint
5755
| Hvac
5856
| InverterTypes

tests/client_test_cases/list_components/diverse_component_types_case.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
battery_pb2,
1010
components_pb2,
1111
ev_charger_pb2,
12-
fuse_pb2,
1312
grid_pb2,
1413
inverter_pb2,
1514
)
@@ -30,7 +29,6 @@
3029
Electrolyzer,
3130
EvCharger,
3231
EvChargerType,
33-
Fuse,
3432
GridConnectionPoint,
3533
Hvac,
3634
HybridEvCharger,
@@ -109,13 +107,6 @@ def assert_stub_method_call(stub_method: Any) -> None:
109107
)
110108
),
111109
),
112-
components_pb2.Component(
113-
id=7,
114-
category=components_pb2.ComponentCategory.COMPONENT_CATEGORY_FUSE,
115-
category_type=components_pb2.ComponentCategoryMetadataVariant(
116-
fuse=fuse_pb2.Fuse(rated_current=50)
117-
),
118-
),
119110
components_pb2.Component(
120111
id=8, category=components_pb2.ComponentCategory.COMPONENT_CATEGORY_HVAC
121112
),
@@ -279,7 +270,6 @@ def assert_client_result(result: Any) -> None:
279270
Converter(id=ComponentId(4), microgrid_id=MicrogridId(0)),
280271
Meter(id=ComponentId(5), microgrid_id=MicrogridId(0)),
281272
AcEvCharger(id=ComponentId(6), microgrid_id=MicrogridId(0)),
282-
Fuse(id=ComponentId(7), microgrid_id=MicrogridId(0), rated_current=50),
283273
Hvac(id=ComponentId(8), microgrid_id=MicrogridId(0)),
284274
# Additional battery types
285275
UnspecifiedBattery(id=ComponentId(9), microgrid_id=MicrogridId(0)),

tests/component/component_proto/test_simple.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
Converter,
1818
CryptoMiner,
1919
Electrolyzer,
20-
Fuse,
2120
GridConnectionPoint,
2221
Hvac,
2322
Meter,
@@ -165,33 +164,6 @@ def test_voltage_transformer(
165164
)
166165

167166

168-
@pytest.mark.parametrize("rated_current", [None, 0, 23])
169-
def test_fuse(
170-
default_component_base_data: ComponentBaseData,
171-
rated_current: int | None,
172-
) -> None:
173-
"""Test Fuse component with default values."""
174-
major_issues: list[str] = []
175-
minor_issues: list[str] = []
176-
base_data = default_component_base_data._replace(category=ComponentCategory.FUSE)
177-
178-
proto = base_data_as_proto(base_data)
179-
if rated_current is not None:
180-
proto.category_type.fuse.rated_current = rated_current
181-
182-
component = component_from_proto_with_issues(
183-
proto, major_issues=major_issues, minor_issues=minor_issues
184-
)
185-
186-
assert not major_issues
187-
assert not minor_issues
188-
assert isinstance(component, Fuse)
189-
assert_base_data(base_data, component)
190-
assert component.rated_current == (
191-
rated_current if rated_current is not None else 0
192-
)
193-
194-
195167
@pytest.mark.parametrize("rated_fuse_current", [None, 0, 23])
196168
def test_grid(
197169
default_component_base_data: ComponentBaseData,

tests/component/test_fuse.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)