From 33f029ce7c2386cfbb0bfa8f67f1f5c69282213c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:33:04 +0200 Subject: [PATCH 1/8] Add missing release notes about new metric naming Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 28b422ff5..a1a2e4645 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,6 +24,18 @@ This release drops support for Python versions older than 3.11. soc_rx = battery_pool.soc.new_receiver() # new ``` +* Formulas now follow the new naming scheme. + + - `BatteryPool.{production_power, consumption_power}` + - `EVChargerPool.{production_power, consumption_power}` + - `LogicalMeter`: + - `consumer_power` + - `grid_production_power` + - `grid_consumption_power` + - `chp_power` + - `chp_production_power` + - `chp_consumption_power` + * A power request can now be forced by setting the `include_broken` attribute. This is especially helpful as a safety measure when components appear to be failing, such as when battery metrics are unavailable. Note that applications previously relying on automatic fallback to all batteries when none of them was working will now require the `include_broken` attribute to be explicitly set in the request. ## New Features From 61c91ff151868230e2f34736d56549d30e92c802 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:33:47 +0200 Subject: [PATCH 2/8] Add missing release note about removing `sympy` Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a1a2e4645..77b6f42b8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -38,6 +38,8 @@ This release drops support for Python versions older than 3.11. * A power request can now be forced by setting the `include_broken` attribute. This is especially helpful as a safety measure when components appear to be failing, such as when battery metrics are unavailable. Note that applications previously relying on automatic fallback to all batteries when none of them was working will now require the `include_broken` attribute to be explicitly set in the request. +* The dependency to `sympy` was unused and thus removed from the SDK. If you used it indirectly without declaring the dependency in your project you should do it now. + ## New Features * The `MovingWindow` as well as the OrderedRingBuffer are having new public methods that are returning the oldest and newest timestamp of all stored samples. From d7582b5ab2fcfb622c795da9878daffdd8e35ec6 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:34:26 +0200 Subject: [PATCH 3/8] Remove mention to the (internal) ring buffer Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 77b6f42b8..19a8ad04c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -42,7 +42,7 @@ This release drops support for Python versions older than 3.11. ## New Features -* The `MovingWindow` as well as the OrderedRingBuffer are having new public methods that are returning the oldest and newest timestamp of all stored samples. +* The `MovingWindow` has new public methods that return the oldest and newest timestamp of all stored samples. * The `PeriodicFeatureExtractor` has been added. From 60355623c6a14747197272e65fcd6323781244a7 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:34:48 +0200 Subject: [PATCH 4/8] Improve release notes summary Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 19a8ad04c..2d7aef4df 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,7 +2,7 @@ ## Summary -This release drops support for Python versions older than 3.11. +This release main introduces the new `PeriodicFeatureExtractor`, the control interface to the `BatteryPool`, and a new naming scheme for retrieving `LogicalMeter` and `BatteryPool` metrics. It also drops support for Python versions older than 3.11. ## Upgrading From 74536049f26bea6afad4da0b51b048b4e7fa3c55 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:36:57 +0200 Subject: [PATCH 5/8] Add fixing of examples to the release notes Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2d7aef4df..a486c6a8d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -52,4 +52,4 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int ## Bug Fixes - +* Fixed many exapmles in the documentation. From f44fa87e64c5c51e45c38ac12e46903dbe9576cf Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:39:29 +0200 Subject: [PATCH 6/8] Reorder release notes to have the most important changes first Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a486c6a8d..cb0f11709 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -8,14 +8,6 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int * Now Python 3.11 is the minimum supported version. All users must upgrade to Python 3.11 (including virtual environments used for development). -* Now `float` is used everywhere for representing power (before power metrics were `float` but setting power was done using `int`). - * `frequenz.sdk.actor.power_distributing`: the `power` attribute of the `Request` class has been updated from `int` to a `float`. - * `frequenz.sdk.microgrid`: the `set_power()` method of both the `MicrogridApiClient` and `MicrogridGrpcClient` classes now expect a `float` value for the `power_w` parameter instead of `int`. - -* The `LogicalMeter` no longer takes a `component_graph` parameter. - -* Now `frequenz.sdk.timeseries.Sample` uses a more sensible comparison. Before this release `Sample`s were compared only based on the `timestamp`. This was due to a limitation in Python versions earlier than 3.10. Now that the minimum supported version is 3.11 this hack is not needed anymore and `Sample`s are compared using both `timestamp` and `value` as most people probably expects. - * `BatteryPool` metric streaming interfaces have changed for `soc`, `capacity` and `power_bounds`: ```python @@ -38,6 +30,14 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int * A power request can now be forced by setting the `include_broken` attribute. This is especially helpful as a safety measure when components appear to be failing, such as when battery metrics are unavailable. Note that applications previously relying on automatic fallback to all batteries when none of them was working will now require the `include_broken` attribute to be explicitly set in the request. +* Now `float` is used everywhere for representing power (before power metrics were `float` but setting power was done using `int`). + * `frequenz.sdk.actor.power_distributing`: the `power` attribute of the `Request` class has been updated from `int` to a `float`. + * `frequenz.sdk.microgrid`: the `set_power()` method of both the `MicrogridApiClient` and `MicrogridGrpcClient` classes now expect a `float` value for the `power_w` parameter instead of `int`. + +* The `LogicalMeter` no longer takes a `component_graph` parameter. + +* Now `frequenz.sdk.timeseries.Sample` uses a more sensible comparison. Before this release `Sample`s were compared only based on the `timestamp`. This was due to a limitation in Python versions earlier than 3.10. Now that the minimum supported version is 3.11 this hack is not needed anymore and `Sample`s are compared using both `timestamp` and `value` as most people probably expects. + * The dependency to `sympy` was unused and thus removed from the SDK. If you used it indirectly without declaring the dependency in your project you should do it now. ## New Features From 4621fdfe79f0e882112b96d1bbcd0b368163de58 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 16:41:16 +0200 Subject: [PATCH 7/8] Add missing release note about the BatteryPool control interface Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cb0f11709..9684fb32c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -50,6 +50,8 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int As an example one can create a daily profile of specific weekdays which will be returned as numpy arrays. +* The `BatteryPool` can now be used to control the batteries in it via the new methods `charge()`, `discharge()`, and `set_power()`. + ## Bug Fixes * Fixed many exapmles in the documentation. From b30e762b387350da0905ac7aee5fcbfa4bcd8d08 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jun 2023 18:20:08 +0200 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Sahas Subramanian Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9684fb32c..1a05075bd 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -18,15 +18,16 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int * Formulas now follow the new naming scheme. - - `BatteryPool.{production_power, consumption_power}` - - `EVChargerPool.{production_power, consumption_power}` + - `BatteryPool.{power, production_power, consumption_power}` + - `EVChargerPool.{power, production_power, consumption_power}` - `LogicalMeter`: - `consumer_power` + - `grid_power` - `grid_production_power` - `grid_consumption_power` - `chp_power` - `chp_production_power` - - `chp_consumption_power` + - `chp_consumption_power` * A power request can now be forced by setting the `include_broken` attribute. This is especially helpful as a safety measure when components appear to be failing, such as when battery metrics are unavailable. Note that applications previously relying on automatic fallback to all batteries when none of them was working will now require the `include_broken` attribute to be explicitly set in the request. @@ -54,4 +55,4 @@ This release main introduces the new `PeriodicFeatureExtractor`, the control int ## Bug Fixes -* Fixed many exapmles in the documentation. +* Fixed many examples in the documentation.