Skip to content

Commit 8cdc2c9

Browse files
Merge v0.6.3 into v0.6.x (#286)
2 parents acc3401 + a9b1621 commit 8cdc2c9

File tree

13 files changed

+123
-38
lines changed

13 files changed

+123
-38
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737
# Only use hashes here, as we are passing the github token, we want to
3838
# make sure updates are done consciously to avoid security issues if the
3939
# action repo gets hacked
40-
uses: yoheimuta/action-protolint@a7c658b971a0874e120e046edb6fd137fdbc92a7 # v1.1.0
40+
uses: yoheimuta/action-protolint@e62319541dc5107df5e3a5010acb8987004d3d25 # v1.3.0
4141
with:
4242
fail_on_error: true
4343
filter_mode: nofilter
4444
github_token: ${{ secrets.github_token }}
4545
protolint_flags: proto/
46-
protolint_version: "0.45.0"
46+
protolint_version: "0.50.5"
4747
reporter: github-check
4848

4949
nox:

.github/workflows/release-notes-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- name: Check for a release notes update
2222
if: github.event_name == 'pull_request'
23-
uses: brettcannon/check-for-changed-files@4170644959a21843b31f1181f2a1761d65ef4791 # v1.2.0
23+
uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1
2424
with:
2525
file-pattern: "RELEASE_NOTES.md"
2626
prereq-pattern: "{proto,py}/**"

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exclude CODEOWNERS
66
exclude CONTRIBUTING.md
77
exclude mkdocs.yml
88
exclude noxfile.py
9-
exclude src/conftest.py
9+
exclude py/frequenz/api/common/conftest.py
1010
recursive-exclude .github *
1111
recursive-exclude benchmarks *
1212
recursive-exclude docs *

RELEASE_NOTES.md

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
- Added message linking microgrid and sensor IDs.
66

7+
- Update of the `PaginationParams` struct.
8+
9+
## Upgrading
10+
11+
- `PaginationParams` has been changed so that the `page_size` and `page_token`
12+
fields are now mutually exclusive.
13+
14+
- A new component category `COMPONENT_CATEGORY_HVAC` has been added to the API
15+
to represent HVAC (Heating, Ventilation, and Air Conditioning) systems.
16+
17+
- Additional information for energy metric
18+
19+
- Generalize Energy message documentation for broader market use
20+
21+
- Add Power message to represent Power in MW
22+
723
## Bug Fixes
824

925
- Fix a dependency issue by pinning the `grpcio` version and related libraries.
26+
- Fixed a wrong documentation comment for `COMPONENT_CATEGORY_UNSPECIFIED`.

proto/frequenz/api/common/v1/market/energy.proto

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Frequenz definitions of energy for electricity trading.
1+
// Frequenz definitions of energy.
22
//
33
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
44
//
@@ -14,11 +14,11 @@ import "frequenz/api/common/v1/types/decimal.proto";
1414
// Represents a single unit of electricity.
1515
//
1616
// !!! note
17-
// In these trading orders, the unit of energy is denominated in MWh
18-
// (Megawatt-hours) as opposed to MW (Megawatts). MWh is a unit of energy
19-
// representing total output over a period, while MW is a unit of power that
20-
// represents the rate of energy production or consumption.
17+
// The unit of energy is denominated in MWh, which is a unit of energy
18+
// representing total output over a period.(Megawatt-hours). This differs
19+
// from MW (Megawatts), a unit of power representing the rate of energy
20+
// production or consumption.
2121
message Energy {
22-
// Represents energy unit in Megawatthours (MWh).
22+
// Energy unit in Megawatthours (MWh).
2323
frequenz.api.common.v1.types.Decimal mwh = 1;
2424
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Frequenz definitions of power.
2+
//
3+
// Copyright 2024 Frequenz Energy-as-a-Service GmbH
4+
//
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
7+
8+
syntax = "proto3";
9+
10+
package frequenz.api.common.v1.market;
11+
12+
import "frequenz/api/common/v1/types/decimal.proto";
13+
14+
// Represents a single unit of power.
15+
//
16+
// !!! note
17+
// The power unit is denominated in MW (Megawatts), which is a unit of
18+
// power representing the rate of energy production or consumption at any
19+
// given moment. This differs from MWh (Megawatt-hours), which measures
20+
// the total amount of energy delivered or consumed over a period.
21+
//
22+
// Example:
23+
// A power plant running at 10 MW for 1 hour generates 10 MWh of energy.
24+
//
25+
// This message standardizes the representation of power in MW across all
26+
// market applications.
27+
message Power {
28+
// Power amount in Megawatts (MW).
29+
frequenz.api.common.v1.types.Decimal mw = 1;
30+
}

proto/frequenz/api/common/v1/metrics/metric_sample.proto

+14
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ message MetricValueVariant {
6363
}
6464

6565
// List of supported metrics.
66+
//
67+
// !!! note
68+
// AC energy metrics information:
69+
//
70+
// * This energy metric is reported directly from the component, and not a
71+
// result of aggregations in our systems. If a component does not have this
72+
// metric, this field cannot be populated.
73+
//
74+
// * Components that provide energy metrics reset this metric from time to
75+
// time. This behaviour is specific to each component model. E.g., some
76+
// components reset it on UTC 00:00:00.
77+
//
78+
// * This energy metric does not specify the timestamp since when the energy
79+
// was being accumulated, and therefore can be inconsistent.
6680
enum Metric {
6781
// Default value.
6882
METRIC_UNSPECIFIED = 0;

proto/frequenz/api/common/v1/microgrid/components/components.proto

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import "google/protobuf/timestamp.proto";
2424

2525
// Enumrated component categories.
2626
enum ComponentCategory {
27-
// An unknown component categories, useful for error handling, and marking
28-
// unknown components in a list of components with otherwise known categories.
27+
// The component category is unspecified. This should not be used.
2928
COMPONENT_CATEGORY_UNSPECIFIED = 0;
3029

3130
// The point where the local microgrid is connected to the grid.

proto/frequenz/api/common/v1/microgrid/lifetime.proto

+16-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,27 @@ import "google/protobuf/timestamp.proto";
1515
// a microgrid asset, such as a component, connection, sensor, or any other
1616
// entity with a limited operational lifetime.
1717
//
18-
// !!! warning "Permanent Deletion"
19-
// The `end_timestamp` indicates that the asset has been permanently removed
20-
// from the system.
18+
// It is normally used to track the historical evolution of assets, and it
19+
// determines the validity period for the asset's data.
2120
//
21+
// If the `start_timestamp` is not set, the asset is considered to be in
22+
// operation since the beginning of the system's operational history.
23+
//
24+
// If the `end_timestamp` is not set, the asset is considered to be in
25+
// operation indefinitely into the future.
26+
//
27+
// If the Lifetime message is completely missing, it means both timestamps are
28+
// not set, which means the asset is considered to be in operation since the
29+
// beginning of the system's operational history and indefinitely into the
30+
// future.
2231
message Lifetime {
2332
// The timestamp when the asset became operationally active.
33+
// If not set, the asset is considered to be in operation since the beginning
34+
// of the system's operational history.
2435
google.protobuf.Timestamp start_timestamp = 1;
2536

2637
// Optional timestamp when the asset's operational activity ceased.
38+
// If not set, the asset is considered to be in operation indefinitely into
39+
// the future.
2740
google.protobuf.Timestamp end_timestamp = 2;
2841
}

proto/frequenz/api/common/v1/microgrid/microgrid.proto

+6
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ message Microgrid {
5151

5252
// The delivery area where the microgrid is located, as identified by a
5353
// specific code.
54+
//
55+
// If a microgrid is not connected to the grid (it is an island) it does not
56+
// belong to any delivery area and this field will be missing, but it could
57+
// be missing for other reasons as well.
5458
frequenz.api.common.v1.grid.DeliveryArea delivery_area = 4;
5559

5660
// Physical location of the microgrid, in geographical co-ordinates.
61+
//
62+
// If the location is not known, this field will be missing.
5763
frequenz.api.common.v1.Location location = 5;
5864

5965
// The current status of the microgrid.

proto/frequenz/api/common/v1/pagination/pagination_params.proto

+15-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ package frequenz.api.common.v1.pagination;
1111

1212
// A message defining parameters for paginating list requests.
1313
// It can be appended to a request message to specify the desired page of
14-
// results and the maximum number of results per page. For initial requests
15-
// (requesting the first page), the page_token should not be provided. For
16-
// subsequent requests (requesting any page after the first), the
17-
// next_page_token from the previous responses PaginationInfo must be supplied.
18-
// The page_size should only be specified in the initial request and will be
19-
// disregarded in subsequent requests.
14+
// results and the maximum number of results per page.
2015
message PaginationParams {
21-
// The maximum number of results to be returned per request.
22-
optional uint32 page_size = 1;
16+
oneof params {
17+
// The maximum number of results to return in a single page. The service may
18+
// return fewer results than requested. If unspecified, the service may
19+
// choose a reasonable default.
20+
// May only be specified in the first request.
21+
uint32 page_size = 1;
2322

24-
// The token identifying a specific page of the list results.
25-
optional string page_token = 2;
23+
// A token identifying a page of results to return. This should be the value
24+
// of the `next_page_token` field in the previous response's PaginationInfo.
25+
// For the first request, this field should be omitted.
26+
//
27+
// To avoid keeping remembering the page_size across requests, service
28+
// implementations may choose to encode the page_size in the page_token.
29+
string page_token = 2;
30+
}
2631
}
File renamed without changes.

pyproject.toml

+14-13
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ requires = [
1010
# sure the code is generated using the minimum supported versions, as older
1111
# versions can't work with code that was generated with newer versions.
1212
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
13-
"protobuf == 4.25.3",
14-
"grpcio-tools == 1.51.1",
15-
"grpcio == 1.51.1",
13+
"protobuf == 5.28.0",
14+
"grpcio-tools == 1.66.1",
15+
"grpcio == 1.66.1",
1616
]
1717
build-backend = "setuptools.build_meta"
1818

@@ -33,13 +33,14 @@ classifiers = [
3333
]
3434
requires-python = ">= 3.11, < 4"
3535
dependencies = [
36-
# We can't widen beyond 6 because of protobuf cross-version runtime guarantees
36+
# We can't widen beyond the current value unless we bump the minimum
37+
# requirements too because of protobuf cross-version runtime guarantees:
3738
# https://protobuf.dev/support/cross-version-runtime-guarantee/#major
38-
"protobuf >= 4.25.3, < 6", # Do not widen beyond 6!
39+
"protobuf >= 5.28.0, < 7", # Do not widen beyond 7!
3940
# We couldn't find any document with a spec about the cross-version runtime
4041
# guarantee for grpcio, so unless we find one in the future, we'll assume
4142
# major version jumps are not compatible
42-
"grpcio >= 1.51.1, < 2", # Do not widen beyond 2!
43+
"grpcio >= 1.66.1, < 2", # Do not widen beyond 2!
4344
]
4445
dynamic = ["version"]
4546

@@ -49,30 +50,30 @@ email = "[email protected]"
4950

5051
[project.optional-dependencies]
5152
dev-flake8 = [
52-
"flake8 == 7.0.0",
53+
"flake8 == 7.1.1",
5354
"flake8-docstrings == 1.7.0",
5455
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
55-
"pydoclint == 0.4.1",
56+
"pydoclint == 0.5.9",
5657
"pydocstyle == 6.3.0",
5758
]
58-
dev-formatting = ["black == 24.4.2", "isort == 5.13.2"]
59+
dev-formatting = ["black == 24.8.0", "isort == 5.13.2"]
5960
dev-mkdocs = [
6061
"mike == 1.1.2",
6162
"mkdocs-gen-files == 0.5.0",
6263
"mkdocs-literate-nav == 0.6.1",
63-
"mkdocs-material == 9.5.21",
64-
"mkdocstrings[python] == 0.25.1",
64+
"mkdocs-material == 9.5.39",
65+
"mkdocstrings[python] == 0.26.1",
6566
"frequenz-repo-config[api] == 0.11.0",
6667
]
6768
dev-mypy = [
68-
"mypy == 1.10.0",
69+
"mypy == 1.11.2",
6970
"grpc-stubs == 1.53.0.5",
7071
# For checking the noxfile, docs/ script, and tests
7172
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
7273
]
7374
dev-noxfile = ["nox == 2024.4.15", "frequenz-repo-config[api] == 0.11.0"]
7475
dev-pylint = [
75-
"pylint == 3.1.0",
76+
"pylint == 3.3.1",
7677
# For checking the noxfile, docs/ script, and tests
7778
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
7879
]

0 commit comments

Comments
 (0)