Skip to content

Commit 4b120ae

Browse files
Rename package types to type (#370)
This commit: - Renames the directory `proto/frequenz/api/common/v1/types` to `proto/frequenz/api/common/v1/type` .. - .. along with renaming the corresponding package from `types` to `type`. This is done to use the same standards as google, potentially making it more familiar to users. closes #365
2 parents 26f9f54 + ddbd206 commit 4b120ae

File tree

10 files changed

+19
-15
lines changed

10 files changed

+19
-15
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
* `METRIC_AC_ACTIVE_ENERGY*` to `METRIC_AC_ENERGY_ACTIVE*`
5858
* `METRIC_AC_REACTIVE_ENERGY*` to `METRIC_AC_ENERGY_REACTIVE*`
5959

60+
+ `types`:
61+
62+
* The whole package has been renamed to `type`.
63+
6064
- Renumbered some enum values to remove unnecessary gaps:
6165

6266
+ `microgrid.components.ComponentCategory` (`microgrid.electrical_components.ElectricalComponentCategory`)

proto/frequenz/api/common/v1/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.v1.market;
1111

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

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

proto/frequenz/api/common/v1/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.v1.market;
1111

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

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

proto/frequenz/api/common/v1/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.v1.market;
1111

12-
import "frequenz/api/common/v1/types/decimal.proto";
12+
import "frequenz/api/common/v1/type/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.v1.types.Decimal amount = 1;
49+
frequenz.api.common.v1.type.Decimal amount = 1;
5050

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

proto/frequenz/api/common/v1/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.v1.microgrid;
1111

1212
import "frequenz/api/common/v1/grid/delivery_area.proto";
13-
import "frequenz/api/common/v1/types/location.proto";
13+
import "frequenz/api/common/v1/type/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.v1.types.Location location = 5;
63+
frequenz.api.common.v1.type.Location location = 5;
6464

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

proto/frequenz/api/common/v1/types/decimal.proto renamed to proto/frequenz/api/common/v1/type/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.v1.types;
10+
package frequenz.api.common.v1.type;
1111

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

proto/frequenz/api/common/v1/types/interval.proto renamed to proto/frequenz/api/common/v1/type/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.v1.types;
10+
package frequenz.api.common.v1.type;
1111

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

proto/frequenz/api/common/v1/types/location.proto renamed to proto/frequenz/api/common/v1/type/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.v1.types;
10+
package frequenz.api.common.v1.type;
1111

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

pytests/test_common.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.v1.types import decimal_pb2
18+
from frequenz.api.common.v1.type import decimal_pb2
1919

2020
assert decimal_pb2 is not None
2121

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

2525
assert decimal_pb2_grpc is not None
2626

@@ -212,12 +212,12 @@ def test_module_import_microgrid_communication_components() -> None:
212212
def test_module_import_location() -> None:
213213
"""Test that the modules can be imported."""
214214
# pylint: disable=import-outside-toplevel
215-
from frequenz.api.common.v1.types import location_pb2
215+
from frequenz.api.common.v1.type import location_pb2
216216

217217
assert location_pb2 is not None
218218

219219
# pylint: disable=import-outside-toplevel
220-
from frequenz.api.common.v1.types import location_pb2_grpc
220+
from frequenz.api.common.v1.type import location_pb2_grpc
221221

222222
assert location_pb2_grpc is not None
223223

0 commit comments

Comments
 (0)