Skip to content

Commit 2fd47e2

Browse files
Add a message representing delivery-areas
This commit adds the following definition: `DeliveryArea`: A delivery area is a geographical or administrative region, usually defined and maintained by a Transmission System Operator (TSO), where electricity deliveries for a contract occur. Signed-off-by: Tiyash Basu <[email protected]>
1 parent 5f897be commit 2fd47e2

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
- Added a message `ComponentConnection` to represent electrical connection
5454
between two components installed in a microgrid.
5555

56+
- Added a message `DeliveryArea` to represent a market contract delivery area.
57+
5658
## New Features
5759

5860
<!-- Here goes the main new features and examples or instructions on how to use them -->
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Frequenz definitions of grids as entites participating in trading.
2+
//
3+
// Copyright 2023 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.grid;
11+
12+
// CodeType specifies the type of identification code used for uniquely
13+
// identifying various entities such as delivery areas, market participants, and
14+
// grid components within the energy market. This enumeration aims to offer
15+
// compatibility across different jurisdictional standards.
16+
//
17+
// !!! note "Understanding Code Types"
18+
// Different regions or countries may have their own standards for uniquely
19+
// identifying various entities within the energy market. For example, in
20+
// Europe, the Energy Identification Code (EIC) is commonly used for this
21+
// purpose.
22+
//
23+
// !!! info "Extensibility"
24+
// New code types can be added to this enum to accommodate additional
25+
// regional standards, enhancing the API's adaptability.
26+
//
27+
// !!! caution "Validation Required"
28+
// The chosen code type should correspond correctly with the `code` field in
29+
// the relevant message objects, such as `DeliveryArea` or `Counterparty`.
30+
// Failure to match the code type with the correct code could lead to
31+
// processing errors.
32+
//
33+
enum EnergyMarketCodeType {
34+
// Unspecified type. This value is a placeholder and should not be used.
35+
ENERGY_MARKET_CODE_TYPE_UNSPECIFIED = 0;
36+
37+
// European Energy Identification Code Standard.
38+
ENERGY_MARKET_CODE_TYPE_EUROPE_EIC = 1;
39+
40+
// North American Electric Reliability Corporation identifiers.
41+
ENERGY_MARKET_CODE_TYPE_US_NERC = 2;
42+
}
43+
44+
// DeliveryArea represents the geographical or administrative region, usually
45+
// defined and maintained by a Transmission System Operator (TSO), where
46+
// electricity deliveries for a contract occur.
47+
//
48+
// The concept is important to energy trading as it delineates the agreed-upon
49+
// delivery location. Delivery areas can have different codes based on the//
50+
// jurisdiction in which they operate.
51+
//
52+
// !!! note "Jurisdictional Differences"
53+
// This is typically represented by specific codes according to local
54+
// jurisdiction. In Europe, this is represented by an EIC
55+
// (Energy Identification Code).
56+
message DeliveryArea {
57+
// Code representing the unique identifier for the delivery area.
58+
string code = 1;
59+
60+
// Type of code used for identifying the delivery area itself.
61+
EnergyMarketCodeType code_type = 2;
62+
}

pytests/test_common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,16 @@ def test_module_import_metrics_electrical() -> None:
4949
from frequenz.api.common.v1.metrics import electrical_pb2_grpc
5050

5151
assert electrical_pb2_grpc is not None
52+
53+
54+
def test_module_import_grid() -> None:
55+
"""Test that the modules can be imported."""
56+
# pylint: disable=import-outside-toplevel
57+
from frequenz.api.common.v1 import grid_pb2
58+
59+
assert grid_pb2 is not None
60+
61+
# pylint: disable=import-outside-toplevel
62+
from frequenz.api.common.v1 import grid_pb2_grpc
63+
64+
assert grid_pb2_grpc is not None

0 commit comments

Comments
 (0)