Skip to content

Commit d180df4

Browse files
Rename type package to types in v1alpha8 proto files
This commit renames the `type` package to `types` in the v1alpha8 proto files to avoid using reserved keywords in programming languages. Signed-off-by: Tiyash Basu <[email protected]>
1 parent f6f8391 commit d180df4

File tree

9 files changed

+16
-15
lines changed

9 files changed

+16
-15
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- `electrical_components.VoltageTransformer` has been renamed to `electrical_components.PowerTransformer`, to make the name more consistent with the underlying concept.
2222
- `ElectricalComponentCategorySpecificInfo.kind.voltage_transformer` has been renamed to `ElectricalComponentCategorySpecificInfo.kind.power_transformer`, to make the name more consistent with the underlying concept.
2323
- `ElectricalComponentCategory.ELECTRICAL_COMPONENT_CATEGORY_VOLTAGE_TRANSFORMER` has been renamed to `ElectricalComponentCategory.ELECTRICAL_COMPONENT_CATEGORY_POWER_TRANSFORMER`, to make the name more consistent with the underlying concept.
24+
- The `type` package has been renamed to `types`, to avoid using reserved keywords in programming languages.
2425

2526

2627
## Bug Fixes

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ syntax = "proto3";
99

1010
package frequenz.api.common.v1alpha8.market;
1111

12-
import "frequenz/api/common/v1alpha8/type/decimal.proto";
12+
import "frequenz/api/common/v1alpha8/types/decimal.proto";
1313

1414
// Represents a single unit of electricity.
1515
//
@@ -20,5 +20,5 @@ import "frequenz/api/common/v1alpha8/type/decimal.proto";
2020
// production or consumption.
2121
message Energy {
2222
// Energy unit in Megawatthours (MWh).
23-
frequenz.api.common.v1alpha8.type.Decimal mwh = 1;
23+
frequenz.api.common.v1alpha8.types.Decimal mwh = 1;
2424
}

proto/frequenz/api/common/v1alpha8/market/power.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ syntax = "proto3";
99

1010
package frequenz.api.common.v1alpha8.market;
1111

12-
import "frequenz/api/common/v1alpha8/type/decimal.proto";
12+
import "frequenz/api/common/v1alpha8/types/decimal.proto";
1313

1414
// Represents a single unit of power.
1515
//
@@ -26,5 +26,5 @@ import "frequenz/api/common/v1alpha8/type/decimal.proto";
2626
// market applications.
2727
message Power {
2828
// Power amount in Megawatts (MW).
29-
frequenz.api.common.v1alpha8.type.Decimal mw = 1;
29+
frequenz.api.common.v1alpha8.types.Decimal mw = 1;
3030
}

proto/frequenz/api/common/v1alpha8/market/price.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ syntax = "proto3";
99

1010
package frequenz.api.common.v1alpha8.market;
1111

12-
import "frequenz/api/common/v1alpha8/type/decimal.proto";
12+
import "frequenz/api/common/v1alpha8/types/decimal.proto";
1313

1414
// Represents a monetary price for electricity trading, including
1515
// the amount and currency. The currency used should align with the
@@ -46,7 +46,7 @@ message Price {
4646
}
4747

4848
// The amount of the price.
49-
frequenz.api.common.v1alpha8.type.Decimal amount = 1;
49+
frequenz.api.common.v1alpha8.types.Decimal amount = 1;
5050

5151
// The currency in which the price is denominated.
5252
Currency currency = 2;

proto/frequenz/api/common/v1alpha8/microgrid/microgrid.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ syntax = "proto3";
1010
package frequenz.api.common.v1alpha8.microgrid;
1111

1212
import "frequenz/api/common/v1alpha8/grid/delivery_area.proto";
13-
import "frequenz/api/common/v1alpha8/type/location.proto";
13+
import "frequenz/api/common/v1alpha8/types/location.proto";
1414

1515
import "google/protobuf/timestamp.proto";
1616

@@ -60,7 +60,7 @@ message Microgrid {
6060
// Physical location of the microgrid, in geographical co-ordinates.
6161
//
6262
// If the location is not known, this field will be missing.
63-
frequenz.api.common.v1alpha8.type.Location location = 5;
63+
frequenz.api.common.v1alpha8.types.Location location = 5;
6464

6565
// The current status of the microgrid.
6666
MicrogridStatus status = 6;

proto/frequenz/api/common/v1alpha8/type/decimal.proto renamed to proto/frequenz/api/common/v1alpha8/types/decimal.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
syntax = "proto3";
99

10-
package frequenz.api.common.v1alpha8.type;
10+
package frequenz.api.common.v1alpha8.types;
1111

1212
// protolint:disable MAX_LINE_LENGTH
1313
// (the link is too long)

proto/frequenz/api/common/v1alpha8/type/interval.proto renamed to proto/frequenz/api/common/v1alpha8/types/interval.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
syntax = "proto3";
99

10-
package frequenz.api.common.v1alpha8.type;
10+
package frequenz.api.common.v1alpha8.types;
1111

1212
import "google/protobuf/timestamp.proto";
1313

proto/frequenz/api/common/v1alpha8/type/location.proto renamed to proto/frequenz/api/common/v1alpha8/types/location.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
syntax = "proto3";
99

10-
package frequenz.api.common.v1alpha8.type;
10+
package frequenz.api.common.v1alpha8.types;
1111

1212
// A pair of geographical co-ordinates, representing the location of a place.
1313
message Location {

pytests/test_common_v1alpha8.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ def test_package_import() -> None:
1515
def test_module_import_decimal() -> None:
1616
"""Test that the modules can be imported."""
1717
# pylint: disable=import-outside-toplevel
18-
from frequenz.api.common.v1alpha8.type import decimal_pb2
18+
from frequenz.api.common.v1alpha8.types import decimal_pb2
1919

2020
assert decimal_pb2 is not None
2121

2222
# pylint: disable=import-outside-toplevel
23-
from frequenz.api.common.v1alpha8.type import decimal_pb2_grpc
23+
from frequenz.api.common.v1alpha8.types import decimal_pb2_grpc
2424

2525
assert decimal_pb2_grpc is not None
2626

@@ -148,12 +148,12 @@ def test_module_import_microgrid_communication_components() -> None:
148148
def test_module_import_location() -> None:
149149
"""Test that the modules can be imported."""
150150
# pylint: disable=import-outside-toplevel
151-
from frequenz.api.common.v1alpha8.type import location_pb2
151+
from frequenz.api.common.v1alpha8.types import location_pb2
152152

153153
assert location_pb2 is not None
154154

155155
# pylint: disable=import-outside-toplevel
156-
from frequenz.api.common.v1alpha8.type import location_pb2_grpc
156+
from frequenz.api.common.v1alpha8.types import location_pb2_grpc
157157

158158
assert location_pb2_grpc is not None
159159

0 commit comments

Comments
 (0)