From 4787b1f36313c18c473862cdc2c13bf3b1b6aafb Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Thu, 24 Apr 2025 15:00:35 +0000 Subject: [PATCH 1/3] Update common-api & other dependencies Signed-off-by: Mathias L. Baumann --- pyproject.toml | 7 ++++--- submodules/frequenz-api-common | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 814341e..fec885d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ requires = [ # sure the code is generated using the minimum supported versions, as older # versions can't work with code that was generated with newer versions. # https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards - "protobuf == 5.29.4", + "protobuf == 5.29.3", "grpcio-tools == 1.70.0", "grpcio == 1.70.0", ] @@ -43,7 +43,8 @@ classifiers = [ ] requires-python = ">= 3.11, < 4" dependencies = [ - "frequenz-api-common >= 0.5.4, < 0.7", + # "frequenz-api-common >= 0.5.4, < 0.7", + "frequenz-api-common @ git+http://git@github.com/frequenz-floss/frequenz-api-common.git@v0.x.x", "googleapis-common-protos >= 1.65.0, < 2", # We can't widen beyond the current value unless we bump the minimum # requirements too because of protobuf cross-version runtime guarantees: @@ -90,7 +91,7 @@ dev-mypy = [ ] dev-noxfile = ["nox == 2025.5.1", "frequenz-repo-config[api] == 0.13.3"] dev-pylint = [ - "pylint == 3.3.6", + "pylint == 3.3.7", # For checking the noxfile, docs/ script, and tests "frequenz-api-dispatch[dev-mkdocs,dev-noxfile,dev-pytest]", ] diff --git a/submodules/frequenz-api-common b/submodules/frequenz-api-common index c75dba3..6e1c00e 160000 --- a/submodules/frequenz-api-common +++ b/submodules/frequenz-api-common @@ -1 +1 @@ -Subproject commit c75dba3a24be767b24c929f6c418535e48bfdc83 +Subproject commit 6e1c00ecd3bcf85e3da39fa6883f5d3f95f52428 From 82160b8b4e44fc6c8ea8c1d9971006a647fdf4db Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Tue, 6 May 2025 18:18:57 +0200 Subject: [PATCH 2/3] Use `TimeIntervalFilter` from common-api Signed-off-by: Mathias L. Baumann --- proto/frequenz/api/dispatch/v1/dispatch.proto | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/proto/frequenz/api/dispatch/v1/dispatch.proto b/proto/frequenz/api/dispatch/v1/dispatch.proto index 3a359ff..0833178 100644 --- a/proto/frequenz/api/dispatch/v1/dispatch.proto +++ b/proto/frequenz/api/dispatch/v1/dispatch.proto @@ -23,6 +23,7 @@ import "frequenz/api/common/v1/microgrid/components/ev_charger.proto"; import "frequenz/api/common/v1/microgrid/components/inverter.proto"; import "frequenz/api/common/v1/pagination/pagination_info.proto"; import "frequenz/api/common/v1/pagination/pagination_params.proto"; +import "frequenz/api/common/v1/types/time_interval_filter.proto"; // Service providing operations related to dispatching microgrid components. // @@ -204,15 +205,6 @@ message DispatchMetadata { google.protobuf.Timestamp end_time = 4; } -// Filter parameter for specifying multiple time intervals -message TimeIntervalFilter { - // Filter by time >= this UTC time. - google.protobuf.Timestamp from_time = 1; - - // Filter by time <= this UTC time. - google.protobuf.Timestamp to_time = 2; -} - // Parameters for filtering the dispatch list message DispatchFilter { // Recurrence filters @@ -304,14 +296,14 @@ message DispatchFilter { // Optional filter by start time. // If no interval is provided, all dispatches will be returned. - TimeIntervalFilter start_time_interval = 6; + frequenz.api.common.v1.types.TimeIntervalFilter start_time_interval = 6; // Optional filter by end time // Filter dispatches based on their explicit end time. - TimeIntervalFilter end_time_interval = 7; + frequenz.api.common.v1.types.TimeIntervalFilter end_time_interval = 7; // Optional filter by update time - TimeIntervalFilter update_time_interval = 8; + frequenz.api.common.v1.types.TimeIntervalFilter update_time_interval = 8; } // Parameter for controlling which components a dispatch applies to From b186af7590d4b80a6bd2fb99bafc285e33124903 Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Wed, 7 May 2025 11:44:31 +0200 Subject: [PATCH 3/3] Use new electrical components names Signed-off-by: Mathias L. Baumann --- proto/frequenz/api/dispatch/v1/dispatch.proto | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/proto/frequenz/api/dispatch/v1/dispatch.proto b/proto/frequenz/api/dispatch/v1/dispatch.proto index 0833178..faaee5b 100644 --- a/proto/frequenz/api/dispatch/v1/dispatch.proto +++ b/proto/frequenz/api/dispatch/v1/dispatch.proto @@ -17,10 +17,10 @@ import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "frequenz/api/common/v1/microgrid/components/battery.proto"; -import "frequenz/api/common/v1/microgrid/components/components.proto"; -import "frequenz/api/common/v1/microgrid/components/ev_charger.proto"; -import "frequenz/api/common/v1/microgrid/components/inverter.proto"; +import "frequenz/api/common/v1/microgrid/electrical_components/battery.proto"; +import "frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto"; +import "frequenz/api/common/v1/microgrid/electrical_components/ev_charger.proto"; +import "frequenz/api/common/v1/microgrid/electrical_components/inverter.proto"; import "frequenz/api/common/v1/pagination/pagination_info.proto"; import "frequenz/api/common/v1/pagination/pagination_params.proto"; import "frequenz/api/common/v1/types/time_interval_filter.proto"; @@ -332,7 +332,7 @@ message TargetComponents { // Deprecated: Use `CategoryTypeSet` instead message CategorySet { // Set of component categories - repeated frequenz.api.common.v1.microgrid.components.ComponentCategory categories = 1; + repeated frequenz.api.common.v1.microgrid.electrical_components.ElectricalComponentCategory categories = 1; } // Wrapper for controlling dispatches with a set of component categories and optional types @@ -347,21 +347,21 @@ message TargetComponents { // only components of that type will be targeted. message CategoryAndType { // The category of the target component (required) - frequenz.api.common.v1.microgrid.components.ComponentCategory category = 1; + frequenz.api.common.v1.microgrid.electrical_components.ElectricalComponentCategory category = 1; // The type of the target component (optional) oneof type { // The type of battery // Only applicable if the category is COMPONENT_CATEGORY_BATTERY - frequenz.api.common.v1.microgrid.components.BatteryType battery = 2; + frequenz.api.common.v1.microgrid.electrical_components.BatteryType battery = 2; // The type of solar array // Only applicable if the category is COMPONENT_CATEGORY_INVERTER - frequenz.api.common.v1.microgrid.components.InverterType inverter = 3; + frequenz.api.common.v1.microgrid.electrical_components.InverterType inverter = 3; // The type of EV charger // Only applicable if the category is COMPONENT_CATEGORY_EV_CHARGER - frequenz.api.common.v1.microgrid.components.EvChargerType ev_charger = 4; + frequenz.api.common.v1.microgrid.electrical_components.EvChargerType ev_charger = 4; } }