diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ce384fc..3095073 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,17 +1,7 @@ # Frequenz Assets API Client Release Notes -## Summary - - - ## Upgrading - - -## New Features - - - -## Bug Fixes - - +- Bumped `frequenz-api-common` from `v0.8.9` to `v0.8.11` and `frequenz-api-assets` from `v0.3.0` to `v0.4.0`. +- Renamed `MarketLocation` to `MarketLocationRef` to match the upstream protobuf rename in `frequenz-api-common` v0.8.11. The `market_location_from_proto` helper was renamed to `market_location_ref_from_proto` accordingly. +- Renamed the `MarketTopologyRelation.market_location` field to `market_location_ref` to match the upstream protobuf field rename in `frequenz-api-assets` v0.4.0. diff --git a/pyproject.toml b/pyproject.toml index 5f29f75..83a428b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,11 +37,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" dependencies = [ "typing-extensions >= 4.13.0, < 5", - "frequenz-api-assets >= 0.3.0, < 0.4.0", - "frequenz-api-common >= 0.8.9, < 1", + "frequenz-api-assets >= 0.4.0, < 0.5.0", + "frequenz-api-common >= 0.8.11, < 1", "frequenz-client-base >= 0.11.0, < 0.12.0", "frequenz-client-common >= 0.3.8, < 0.5.0", - "grpcio >= 1.81.0, < 2", + "grpcio >= 1.81.1, < 2", ] dynamic = ["version"] diff --git a/src/frequenz/client/assets/__init__.py b/src/frequenz/client/assets/__init__.py index b94604d..9bb848f 100644 --- a/src/frequenz/client/assets/__init__.py +++ b/src/frequenz/client/assets/__init__.py @@ -16,7 +16,7 @@ from ._interval import Interval from ._lifetime import Lifetime from ._location import Location -from ._market_location import MarketLocation, MarketLocationId, MarketLocationIdType +from ._market_location import MarketLocationId, MarketLocationIdType, MarketLocationRef from ._market_topology import ( MarketParticipation, MarketParticipationType, @@ -40,9 +40,9 @@ "MicrogridStatus", "Location", "Lifetime", - "MarketLocation", "MarketLocationId", "MarketLocationIdType", + "MarketLocationRef", "MarketParticipation", "MarketParticipationType", "MarketTopologyRelation", diff --git a/src/frequenz/client/assets/_market_location.py b/src/frequenz/client/assets/_market_location.py index f9a5bab..0533dee 100644 --- a/src/frequenz/client/assets/_market_location.py +++ b/src/frequenz/client/assets/_market_location.py @@ -68,8 +68,8 @@ class MarketLocationId: @dataclass(frozen=True, kw_only=True) -class MarketLocation: - """A market-facing metering point in a specific market area.""" +class MarketLocationRef: + """A reference to a market-facing metering point in a specific market area.""" market_area: int """The market area in which this market location is registered.""" diff --git a/src/frequenz/client/assets/_market_location_proto.py b/src/frequenz/client/assets/_market_location_proto.py index 68a17af..500d834 100644 --- a/src/frequenz/client/assets/_market_location_proto.py +++ b/src/frequenz/client/assets/_market_location_proto.py @@ -1,12 +1,12 @@ # License: MIT # Copyright © 2026 Frequenz Energy-as-a-Service GmbH -"""Conversion of MarketLocation objects to/from protobuf messages.""" +"""Conversion of MarketLocationRef objects to/from protobuf messages.""" from frequenz.api.common.v1alpha8.grid import market_location_pb2 from frequenz.client.common.proto import enum_from_proto -from ._market_location import MarketLocation, MarketLocationId, MarketLocationIdType +from ._market_location import MarketLocationId, MarketLocationIdType, MarketLocationRef def market_location_id_from_proto( @@ -19,11 +19,11 @@ def market_location_id_from_proto( ) -def market_location_from_proto( - message: market_location_pb2.MarketLocation, -) -> MarketLocation: - """Convert a protobuf market location message to a domain object.""" - return MarketLocation( +def market_location_ref_from_proto( + message: market_location_pb2.MarketLocationRef, +) -> MarketLocationRef: + """Convert a protobuf market location ref message to a domain object.""" + return MarketLocationRef( market_area=message.market_area, market_location_id=( market_location_id_from_proto(message.market_location_id) diff --git a/src/frequenz/client/assets/_market_topology.py b/src/frequenz/client/assets/_market_topology.py index 66fdc37..2307f41 100644 --- a/src/frequenz/client/assets/_market_topology.py +++ b/src/frequenz/client/assets/_market_topology.py @@ -11,7 +11,7 @@ from ._delivery_area import DeliveryArea from ._interval import Interval -from ._market_location import MarketLocation +from ._market_location import MarketLocationRef @enum.unique @@ -46,7 +46,7 @@ class MarketTopologyRelation: microgrid_id: MicrogridId | None """The microgrid associated with this relation.""" - market_location: MarketLocation | None + market_location_ref: MarketLocationRef | None """The market location associated with this relation.""" gridpool_id: int | None diff --git a/src/frequenz/client/assets/_market_topology_proto.py b/src/frequenz/client/assets/_market_topology_proto.py index 28ab32e..d23403b 100644 --- a/src/frequenz/client/assets/_market_topology_proto.py +++ b/src/frequenz/client/assets/_market_topology_proto.py @@ -9,7 +9,7 @@ from ._delivery_area_proto import delivery_area_from_proto from ._interval_proto import interval_from_proto -from ._market_location_proto import market_location_from_proto +from ._market_location_proto import market_location_ref_from_proto from ._market_topology import ( MarketParticipation, MarketParticipationType, @@ -41,9 +41,9 @@ def market_topology_relation_from_proto( if message.HasField("microgrid_id") else None ), - market_location=( - market_location_from_proto(message.market_location) - if message.HasField("market_location") + market_location_ref=( + market_location_ref_from_proto(message.market_location_ref) + if message.HasField("market_location_ref") else None ), gridpool_id=message.gridpool_id if message.HasField("gridpool_id") else None, diff --git a/tests/client_test_cases/list_market_topology_relations/success_case.py b/tests/client_test_cases/list_market_topology_relations/success_case.py index 86b78c2..0f151bf 100644 --- a/tests/client_test_cases/list_market_topology_relations/success_case.py +++ b/tests/client_test_cases/list_market_topology_relations/success_case.py @@ -17,9 +17,9 @@ DeliveryArea, EnergyMarketCodeType, Interval, - MarketLocation, MarketLocationId, MarketLocationIdType, + MarketLocationRef, MarketParticipation, MarketParticipationType, MarketTopologyRelation, @@ -64,7 +64,7 @@ def assert_stub_method_call(stub_method: Any) -> None: relations=[ assets_pb2.MarketTopologyRelation( microgrid_id=1234, - market_location=market_location_pb2.MarketLocation( + market_location_ref=market_location_pb2.MarketLocationRef( market_area=market_area_pb2.MarketArea.ValueType(1), market_location_id=market_location_pb2.MarketLocationId( id=market_location_pb2.MarketLocationIdValue(value="DE001"), @@ -94,7 +94,7 @@ def assert_client_result(result: Any) -> None: assert result == [ MarketTopologyRelation( microgrid_id=MicrogridId(1234), - market_location=MarketLocation( + market_location_ref=MarketLocationRef( market_area=1, market_location_id=MarketLocationId( value="DE001", type=MarketLocationIdType.MALO_ID