From ced2e73fba73e61829d8666e9a3c9b72f85503b9 Mon Sep 17 00:00:00 2001 From: cwasicki <126617870+cwasicki@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:13:06 +0200 Subject: [PATCH 1/2] Replace iterate in method names Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com> --- examples/client.py | 2 +- src/frequenz/client/reporting/_client.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/client.py b/examples/client.py index 0548975..adbff53 100644 --- a/examples/client.py +++ b/examples/client.py @@ -106,7 +106,7 @@ def data_iter() -> AsyncIterator[MetricSample]: Returns: Iterator over single metric samples """ - return client.iterate_single_component( + return client.list_single_component_data( microgrid_id=microgrid_id, component_id=component_id, metrics=metrics, diff --git a/src/frequenz/client/reporting/_client.py b/src/frequenz/client/reporting/_client.py index d33abd0..d574d10 100644 --- a/src/frequenz/client/reporting/_client.py +++ b/src/frequenz/client/reporting/_client.py @@ -122,7 +122,7 @@ def __init__(self, service_address: str): self._stub = ReportingStub(self._grpc_channel) # pylint: disable=too-many-arguments - async def iterate_single_component( + async def list_single_component_data( self, *, microgrid_id: int, @@ -147,7 +147,7 @@ async def iterate_single_component( * timestamp: The timestamp of the metric sample. * value: The metric value. """ - async for page in self._iterate_components_data_pages( + async for page in self._list_microgrid_components_data_pages( microgrid_components=[(microgrid_id, [component_id])], metrics=[metrics] if isinstance(metrics, Metric) else metrics, start_dt=start_dt, @@ -158,7 +158,7 @@ async def iterate_single_component( yield entry # pylint: disable=too-many-arguments - async def _iterate_components_data_pages( + async def _list_microgrid_components_data_pages( self, *, microgrid_components: list[tuple[int, list[int]]], From 46b7dd278af6b3627c4effb272a42d7bc426f5e6 Mon Sep 17 00:00:00 2001 From: cwasicki <126617870+cwasicki@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:28:07 +0200 Subject: [PATCH 2/2] Update release notes Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com> --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c0c8ea6..ea5d73a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,6 +6,8 @@ * The `ReportingClient` is renamed to `ReportingApiClient`. +* The client method `iterate_single_component` is renamed to `list_single_component_data`. + ## New Features ## Bug Fixes