frequenz-api-common 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ # License: MIT
2
+ # Copyright © 2023 Frequenz Energy-as-a-Service GmbH
3
+
4
+ """Frequenz Common API definitions."""
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: frequenz/api/common/components.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$frequenz/api/common/components.proto\x12\x1e\x66requenz.api.common.components*\xfd\x02\n\x11\x43omponentCategory\x12\"\n\x1e\x43OMPONENT_CATEGORY_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x43OMPONENT_CATEGORY_GRID\x10\x01\x12\x1c\n\x18\x43OMPONENT_CATEGORY_METER\x10\x02\x12\x1f\n\x1b\x43OMPONENT_CATEGORY_INVERTER\x10\x03\x12 \n\x1c\x43OMPONENT_CATEGORY_CONVERTER\x10\x04\x12\x1e\n\x1a\x43OMPONENT_CATEGORY_BATTERY\x10\x05\x12!\n\x1d\x43OMPONENT_CATEGORY_EV_CHARGER\x10\x06\x12\x1d\n\x19\x43OMPONENT_CATEGORY_SENSOR\x10\x07\x12#\n\x1f\x43OMPONENT_CATEGORY_CRYPTO_MINER\x10\x08\x12#\n\x1f\x43OMPONENT_CATEGORY_ELECTROLYZER\x10\t\x12\x1a\n\x16\x43OMPONENT_CATEGORY_CHP\x10\n*]\n\x0b\x42\x61tteryType\x12\x1c\n\x18\x42\x41TTERY_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42\x41TTERY_TYPE_LI_ION\x10\x01\x12\x17\n\x13\x42\x41TTERY_TYPE_NA_ION\x10\x02*{\n\x0cInverterType\x12\x1d\n\x19INVERTER_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15INVERTER_TYPE_BATTERY\x10\x01\x12\x17\n\x13INVERTER_TYPE_SOLAR\x10\x02\x12\x18\n\x14INVERTER_TYPE_HYBRID\x10\x03*x\n\rEVChargerType\x12\x1e\n\x1a\x45VCHARGER_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45VCHARGER_TYPE_AC\x10\x01\x12\x15\n\x11\x45VCHARGER_TYPE_DC\x10\x02\x12\x19\n\x15\x45VCHARGER_TYPE_HYBRID\x10\x03*\xee\x01\n\nSensorType\x12\x1b\n\x17SENSOR_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17SENSOR_TYPE_THERMOMETER\x10\x01\x12\x1a\n\x16SENSOR_TYPE_HYGROMETER\x10\x02\x12\x19\n\x15SENSOR_TYPE_BAROMETER\x10\x03\x12\x1b\n\x17SENSOR_TYPE_PYRANOMETER\x10\x04\x12\x1a\n\x16SENSOR_TYPE_ANEMOMETER\x10\x05\x12\x1d\n\x19SENSOR_TYPE_ACCELEROMETER\x10\x06\x12\x17\n\x13SENSOR_TYPE_GENERAL\x10\x07\x62\x06proto3')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frequenz.api.common.components_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ _COMPONENTCATEGORY._serialized_start=73
24
+ _COMPONENTCATEGORY._serialized_end=454
25
+ _BATTERYTYPE._serialized_start=456
26
+ _BATTERYTYPE._serialized_end=549
27
+ _INVERTERTYPE._serialized_start=551
28
+ _INVERTERTYPE._serialized_end=674
29
+ _EVCHARGERTYPE._serialized_start=676
30
+ _EVCHARGERTYPE._serialized_end=796
31
+ _SENSORTYPE._serialized_start=799
32
+ _SENSORTYPE._serialized_end=1037
33
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,207 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Frequenz microgrid components definitions.
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
12
+ import builtins
13
+ import google.protobuf.descriptor
14
+ import google.protobuf.internal.enum_type_wrapper
15
+ import sys
16
+ import typing
17
+
18
+ if sys.version_info >= (3, 10):
19
+ import typing as typing_extensions
20
+ else:
21
+ import typing_extensions
22
+
23
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
24
+
25
+ class _ComponentCategory:
26
+ ValueType = typing.NewType("ValueType", builtins.int)
27
+ V: typing_extensions.TypeAlias = ValueType
28
+
29
+ class _ComponentCategoryEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ComponentCategory.ValueType], builtins.type):
30
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
31
+ COMPONENT_CATEGORY_UNSPECIFIED: _ComponentCategory.ValueType # 0
32
+ """An unknown component categories, useful for error handling, and marking
33
+ unknown components in a list of components with otherwise known categories.
34
+ """
35
+ COMPONENT_CATEGORY_GRID: _ComponentCategory.ValueType # 1
36
+ """The point where the local microgrid is connected to the grid."""
37
+ COMPONENT_CATEGORY_METER: _ComponentCategory.ValueType # 2
38
+ """A meter, for measuring electrical metrics, e.g., current, voltage, etc."""
39
+ COMPONENT_CATEGORY_INVERTER: _ComponentCategory.ValueType # 3
40
+ """An electricity generator, with batteries or solar energy."""
41
+ COMPONENT_CATEGORY_CONVERTER: _ComponentCategory.ValueType # 4
42
+ """A DC-DC converter."""
43
+ COMPONENT_CATEGORY_BATTERY: _ComponentCategory.ValueType # 5
44
+ """A storage system for electrical energy, used by inverters."""
45
+ COMPONENT_CATEGORY_EV_CHARGER: _ComponentCategory.ValueType # 6
46
+ """A station for charging electrical vehicles."""
47
+ COMPONENT_CATEGORY_SENSOR: _ComponentCategory.ValueType # 7
48
+ """A sensor for measuring ambient metrics, e.g., temperature, humidity, etc."""
49
+ COMPONENT_CATEGORY_CRYPTO_MINER: _ComponentCategory.ValueType # 8
50
+ """A crypto miner."""
51
+ COMPONENT_CATEGORY_ELECTROLYZER: _ComponentCategory.ValueType # 9
52
+ """An electrolyzer for converting water into hydrogen and oxygen."""
53
+ COMPONENT_CATEGORY_CHP: _ComponentCategory.ValueType # 10
54
+ """A heat and power combustion plant (CHP stands for combined heat and power)."""
55
+
56
+ class ComponentCategory(_ComponentCategory, metaclass=_ComponentCategoryEnumTypeWrapper):
57
+ """Enumrated component categories."""
58
+
59
+ COMPONENT_CATEGORY_UNSPECIFIED: ComponentCategory.ValueType # 0
60
+ """An unknown component categories, useful for error handling, and marking
61
+ unknown components in a list of components with otherwise known categories.
62
+ """
63
+ COMPONENT_CATEGORY_GRID: ComponentCategory.ValueType # 1
64
+ """The point where the local microgrid is connected to the grid."""
65
+ COMPONENT_CATEGORY_METER: ComponentCategory.ValueType # 2
66
+ """A meter, for measuring electrical metrics, e.g., current, voltage, etc."""
67
+ COMPONENT_CATEGORY_INVERTER: ComponentCategory.ValueType # 3
68
+ """An electricity generator, with batteries or solar energy."""
69
+ COMPONENT_CATEGORY_CONVERTER: ComponentCategory.ValueType # 4
70
+ """A DC-DC converter."""
71
+ COMPONENT_CATEGORY_BATTERY: ComponentCategory.ValueType # 5
72
+ """A storage system for electrical energy, used by inverters."""
73
+ COMPONENT_CATEGORY_EV_CHARGER: ComponentCategory.ValueType # 6
74
+ """A station for charging electrical vehicles."""
75
+ COMPONENT_CATEGORY_SENSOR: ComponentCategory.ValueType # 7
76
+ """A sensor for measuring ambient metrics, e.g., temperature, humidity, etc."""
77
+ COMPONENT_CATEGORY_CRYPTO_MINER: ComponentCategory.ValueType # 8
78
+ """A crypto miner."""
79
+ COMPONENT_CATEGORY_ELECTROLYZER: ComponentCategory.ValueType # 9
80
+ """An electrolyzer for converting water into hydrogen and oxygen."""
81
+ COMPONENT_CATEGORY_CHP: ComponentCategory.ValueType # 10
82
+ """A heat and power combustion plant (CHP stands for combined heat and power)."""
83
+ global___ComponentCategory = ComponentCategory
84
+
85
+ class _BatteryType:
86
+ ValueType = typing.NewType("ValueType", builtins.int)
87
+ V: typing_extensions.TypeAlias = ValueType
88
+
89
+ class _BatteryTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BatteryType.ValueType], builtins.type):
90
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
91
+ BATTERY_TYPE_UNSPECIFIED: _BatteryType.ValueType # 0
92
+ """Unspecified."""
93
+ BATTERY_TYPE_LI_ION: _BatteryType.ValueType # 1
94
+ """Li-ion batteries."""
95
+ BATTERY_TYPE_NA_ION: _BatteryType.ValueType # 2
96
+ """Sodium-ion batteries"""
97
+
98
+ class BatteryType(_BatteryType, metaclass=_BatteryTypeEnumTypeWrapper):
99
+ """Enumerated battery types."""
100
+
101
+ BATTERY_TYPE_UNSPECIFIED: BatteryType.ValueType # 0
102
+ """Unspecified."""
103
+ BATTERY_TYPE_LI_ION: BatteryType.ValueType # 1
104
+ """Li-ion batteries."""
105
+ BATTERY_TYPE_NA_ION: BatteryType.ValueType # 2
106
+ """Sodium-ion batteries"""
107
+ global___BatteryType = BatteryType
108
+
109
+ class _InverterType:
110
+ ValueType = typing.NewType("ValueType", builtins.int)
111
+ V: typing_extensions.TypeAlias = ValueType
112
+
113
+ class _InverterTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InverterType.ValueType], builtins.type):
114
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
115
+ INVERTER_TYPE_UNSPECIFIED: _InverterType.ValueType # 0
116
+ """Unspecified."""
117
+ INVERTER_TYPE_BATTERY: _InverterType.ValueType # 1
118
+ """Battery inverter."""
119
+ INVERTER_TYPE_SOLAR: _InverterType.ValueType # 2
120
+ """Solar inverter."""
121
+ INVERTER_TYPE_HYBRID: _InverterType.ValueType # 3
122
+ """Hybrid inverter."""
123
+
124
+ class InverterType(_InverterType, metaclass=_InverterTypeEnumTypeWrapper):
125
+ """Enumerated inverter types."""
126
+
127
+ INVERTER_TYPE_UNSPECIFIED: InverterType.ValueType # 0
128
+ """Unspecified."""
129
+ INVERTER_TYPE_BATTERY: InverterType.ValueType # 1
130
+ """Battery inverter."""
131
+ INVERTER_TYPE_SOLAR: InverterType.ValueType # 2
132
+ """Solar inverter."""
133
+ INVERTER_TYPE_HYBRID: InverterType.ValueType # 3
134
+ """Hybrid inverter."""
135
+ global___InverterType = InverterType
136
+
137
+ class _EVChargerType:
138
+ ValueType = typing.NewType("ValueType", builtins.int)
139
+ V: typing_extensions.TypeAlias = ValueType
140
+
141
+ class _EVChargerTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_EVChargerType.ValueType], builtins.type):
142
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
143
+ EVCHARGER_TYPE_UNSPECIFIED: _EVChargerType.ValueType # 0
144
+ """Default type."""
145
+ EVCHARGER_TYPE_AC: _EVChargerType.ValueType # 1
146
+ """The EV charging station supports AC charging only."""
147
+ EVCHARGER_TYPE_DC: _EVChargerType.ValueType # 2
148
+ """The EV charging station supports DC charging only."""
149
+ EVCHARGER_TYPE_HYBRID: _EVChargerType.ValueType # 3
150
+ """The EV charging station supports both AC and DC."""
151
+
152
+ class EVChargerType(_EVChargerType, metaclass=_EVChargerTypeEnumTypeWrapper):
153
+ """Enumerated EV charger types."""
154
+
155
+ EVCHARGER_TYPE_UNSPECIFIED: EVChargerType.ValueType # 0
156
+ """Default type."""
157
+ EVCHARGER_TYPE_AC: EVChargerType.ValueType # 1
158
+ """The EV charging station supports AC charging only."""
159
+ EVCHARGER_TYPE_DC: EVChargerType.ValueType # 2
160
+ """The EV charging station supports DC charging only."""
161
+ EVCHARGER_TYPE_HYBRID: EVChargerType.ValueType # 3
162
+ """The EV charging station supports both AC and DC."""
163
+ global___EVChargerType = EVChargerType
164
+
165
+ class _SensorType:
166
+ ValueType = typing.NewType("ValueType", builtins.int)
167
+ V: typing_extensions.TypeAlias = ValueType
168
+
169
+ class _SensorTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SensorType.ValueType], builtins.type):
170
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
171
+ SENSOR_TYPE_UNSPECIFIED: _SensorType.ValueType # 0
172
+ """Unspecified"""
173
+ SENSOR_TYPE_THERMOMETER: _SensorType.ValueType # 1
174
+ """Thermometer (temperature sensor)"""
175
+ SENSOR_TYPE_HYGROMETER: _SensorType.ValueType # 2
176
+ """Hygrometer (humidity sensor)"""
177
+ SENSOR_TYPE_BAROMETER: _SensorType.ValueType # 3
178
+ """Barometer (pressure sensor)."""
179
+ SENSOR_TYPE_PYRANOMETER: _SensorType.ValueType # 4
180
+ """Pyranometer (solar irradiance sensor)."""
181
+ SENSOR_TYPE_ANEMOMETER: _SensorType.ValueType # 5
182
+ """Anemometer (wind velocity and direction sensor)."""
183
+ SENSOR_TYPE_ACCELEROMETER: _SensorType.ValueType # 6
184
+ """Accelerometers (acceleration sensor)."""
185
+ SENSOR_TYPE_GENERAL: _SensorType.ValueType # 7
186
+ """General sensors, which do not fall in any of the above categories"""
187
+
188
+ class SensorType(_SensorType, metaclass=_SensorTypeEnumTypeWrapper):
189
+ """Enumerated sensor types."""
190
+
191
+ SENSOR_TYPE_UNSPECIFIED: SensorType.ValueType # 0
192
+ """Unspecified"""
193
+ SENSOR_TYPE_THERMOMETER: SensorType.ValueType # 1
194
+ """Thermometer (temperature sensor)"""
195
+ SENSOR_TYPE_HYGROMETER: SensorType.ValueType # 2
196
+ """Hygrometer (humidity sensor)"""
197
+ SENSOR_TYPE_BAROMETER: SensorType.ValueType # 3
198
+ """Barometer (pressure sensor)."""
199
+ SENSOR_TYPE_PYRANOMETER: SensorType.ValueType # 4
200
+ """Pyranometer (solar irradiance sensor)."""
201
+ SENSOR_TYPE_ANEMOMETER: SensorType.ValueType # 5
202
+ """Anemometer (wind velocity and direction sensor)."""
203
+ SENSOR_TYPE_ACCELEROMETER: SensorType.ValueType # 6
204
+ """Accelerometers (acceleration sensor)."""
205
+ SENSOR_TYPE_GENERAL: SensorType.ValueType # 7
206
+ """General sensors, which do not fall in any of the above categories"""
207
+ global___SensorType = SensorType
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -0,0 +1,11 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Frequenz microgrid components definitions.
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
@@ -0,0 +1,4 @@
1
+ # License: MIT
2
+ # Copyright © 2023 Frequenz Energy-as-a-Service GmbH
3
+
4
+ """Frequenz Common API definitions for metrics."""
@@ -0,0 +1,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: frequenz/api/common/metrics/electrical.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from frequenz.api.common import metrics_pb2 as frequenz_dot_api_dot_common_dot_metrics__pb2
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,frequenz/api/common/metrics/electrical.proto\x12&frequenz.api.common.metrics.electrical\x1a!frequenz/api/common/metrics.proto\"\xa4\x01\n\x02\x44\x43\x12\x34\n\x07voltage\x18\x01 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x34\n\x07\x63urrent\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x32\n\x05power\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\"\x80\x10\n\x02\x41\x43\x12\x36\n\tfrequency\x18\x01 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x34\n\x07\x63urrent\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12;\n\x0epower_apparent\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x39\n\x0cpower_active\x18\x04 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12;\n\x0epower_reactive\x18\x05 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12<\n\x0f\x65nergy_apparent\x18\x06 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12N\n\renergy_active\x18\x07 \x01(\x0b\x32\x37.frequenz.api.common.metrics.electrical.AC.ActiveEnergy\x12R\n\x0f\x65nergy_reactive\x18\x08 \x01(\x0b\x32\x39.frequenz.api.common.metrics.electrical.AC.ReactiveEnergy\x12T\n\x16harmonics_power_active\x18\t \x01(\x0b\x32\x34.frequenz.api.common.metrics.electrical.AC.Harmonics\x12\x18\n\x10thd_power_active\x18\n \x01(\x02\x12\x43\n\x07phase_1\x18\x0b \x01(\x0b\x32\x32.frequenz.api.common.metrics.electrical.AC.ACPhase\x12\x43\n\x07phase_2\x18\x0c \x01(\x0b\x32\x32.frequenz.api.common.metrics.electrical.AC.ACPhase\x12\x43\n\x07phase_3\x18\r \x01(\x0b\x32\x32.frequenz.api.common.metrics.electrical.AC.ACPhase\x1a\xc0\x01\n\x0c\x41\x63tiveEnergy\x12\x33\n\x06\x65nergy\x18\x01 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12<\n\x0f\x65nergy_consumed\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12=\n\x10\x65nergy_delivered\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x1a\xc4\x01\n\x0eReactiveEnergy\x12\x33\n\x06\x65nergy\x18\x01 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12>\n\x11\x65nergy_capacitive\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12=\n\x10\x65nergy_inductive\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x1a\xe9\x01\n\tHarmonics\x12\x12\n\nharmonic_1\x18\x01 \x01(\x02\x12\x12\n\nharmonic_2\x18\x02 \x01(\x02\x12\x12\n\nharmonic_3\x18\x03 \x01(\x02\x12\x12\n\nharmonic_4\x18\x04 \x01(\x02\x12\x12\n\nharmonic_5\x18\x05 \x01(\x02\x12\x12\n\nharmonic_6\x18\x06 \x01(\x02\x12\x12\n\nharmonic_7\x18\x07 \x01(\x02\x12\x12\n\nharmonic_8\x18\x08 \x01(\x02\x12\x12\n\nharmonic_9\x18\t \x01(\x02\x12\x13\n\x0bharmonic_10\x18\n \x01(\x02\x12\x13\n\x0bharmonic_11\x18\x0b \x01(\x02\x1a\xbf\x04\n\x07\x41\x43Phase\x12\x34\n\x07voltage\x18\x01 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x34\n\x07\x63urrent\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12\x39\n\x0cpower_active\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12;\n\x0epower_reactive\x18\x04 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12<\n\x0f\x65nergy_apparent\x18\x05 \x01(\x0b\x32#.frequenz.api.common.metrics.Metric\x12N\n\renergy_active\x18\x06 \x01(\x0b\x32\x37.frequenz.api.common.metrics.electrical.AC.ActiveEnergy\x12R\n\x0f\x65nergy_reactive\x18\x07 \x01(\x0b\x32\x39.frequenz.api.common.metrics.electrical.AC.ReactiveEnergy\x12T\n\x16harmonics_power_active\x18\x08 \x01(\x0b\x32\x34.frequenz.api.common.metrics.electrical.AC.Harmonics\x12\x18\n\x10thd_power_active\x18\t \x01(\x02\x62\x06proto3')
18
+
19
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frequenz.api.common.metrics.electrical_pb2', globals())
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+
23
+ DESCRIPTOR._options = None
24
+ _DC._serialized_start=124
25
+ _DC._serialized_end=288
26
+ _AC._serialized_start=291
27
+ _AC._serialized_end=2339
28
+ _AC_ACTIVEENERGY._serialized_start=1134
29
+ _AC_ACTIVEENERGY._serialized_end=1326
30
+ _AC_REACTIVEENERGY._serialized_start=1329
31
+ _AC_REACTIVEENERGY._serialized_end=1525
32
+ _AC_HARMONICS._serialized_start=1528
33
+ _AC_HARMONICS._serialized_end=1761
34
+ _AC_ACPHASE._serialized_start=1764
35
+ _AC_ACPHASE._serialized_end=2339
36
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,383 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Contains definitions for electrical metrics (AC and DC).
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
12
+ import builtins
13
+ import frequenz.api.common.metrics_pb2
14
+ import google.protobuf.descriptor
15
+ import google.protobuf.message
16
+ import sys
17
+
18
+ if sys.version_info >= (3, 8):
19
+ import typing as typing_extensions
20
+ else:
21
+ import typing_extensions
22
+
23
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
24
+
25
+ @typing_extensions.final
26
+ class DC(google.protobuf.message.Message):
27
+ """Metrics of a DC electrical connection."""
28
+
29
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
30
+
31
+ VOLTAGE_FIELD_NUMBER: builtins.int
32
+ CURRENT_FIELD_NUMBER: builtins.int
33
+ POWER_FIELD_NUMBER: builtins.int
34
+ @property
35
+ def voltage(self) -> frequenz.api.common.metrics_pb2.Metric:
36
+ """The DC voltage across the component.
37
+ In Volt (V).
38
+ """
39
+ @property
40
+ def current(self) -> frequenz.api.common.metrics_pb2.Metric:
41
+ """The DC current flowing away from the grid connection.
42
+ In passive sign convention:
43
+ +ve current means consumption, away from the grid.
44
+ -ve current means supply into the grid.
45
+ In Ampere (A).
46
+ """
47
+ @property
48
+ def power(self) -> frequenz.api.common.metrics_pb2.Metric:
49
+ """The DC power flowing away from the grid connection.
50
+ In passive sign convention:
51
+ +ve power means consumption, away from the grid.
52
+ -ve power means supply into the grid.
53
+ In Watt (W).
54
+ """
55
+ def __init__(
56
+ self,
57
+ *,
58
+ voltage: frequenz.api.common.metrics_pb2.Metric | None = ...,
59
+ current: frequenz.api.common.metrics_pb2.Metric | None = ...,
60
+ power: frequenz.api.common.metrics_pb2.Metric | None = ...,
61
+ ) -> None: ...
62
+ def HasField(self, field_name: typing_extensions.Literal["current", b"current", "power", b"power", "voltage", b"voltage"]) -> builtins.bool: ...
63
+ def ClearField(self, field_name: typing_extensions.Literal["current", b"current", "power", b"power", "voltage", b"voltage"]) -> None: ...
64
+
65
+ global___DC = DC
66
+
67
+ @typing_extensions.final
68
+ class AC(google.protobuf.message.Message):
69
+ """The current state and metrics of the electrical connections to the
70
+ inverter.
71
+ """
72
+
73
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
74
+
75
+ @typing_extensions.final
76
+ class ActiveEnergy(google.protobuf.message.Message):
77
+ """The active energy the inverter is consuming or generating."""
78
+
79
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
80
+
81
+ ENERGY_FIELD_NUMBER: builtins.int
82
+ ENERGY_CONSUMED_FIELD_NUMBER: builtins.int
83
+ ENERGY_DELIVERED_FIELD_NUMBER: builtins.int
84
+ @property
85
+ def energy(self) -> frequenz.api.common.metrics_pb2.Metric:
86
+ """The sum of the consumed and delivered energy.
87
+ This is a signed value in passive sign convention: if more energy is
88
+ consumed than delivered, this is a -ve number, otherwise +ve.
89
+ In Watt-hour (Wh).
90
+ """
91
+ @property
92
+ def energy_consumed(self) -> frequenz.api.common.metrics_pb2.Metric:
93
+ """The consumed energy.
94
+ In Watt-hour (Wh).
95
+ """
96
+ @property
97
+ def energy_delivered(self) -> frequenz.api.common.metrics_pb2.Metric:
98
+ """The delivered energy.
99
+ In Watt-hour (Wh).
100
+ """
101
+ def __init__(
102
+ self,
103
+ *,
104
+ energy: frequenz.api.common.metrics_pb2.Metric | None = ...,
105
+ energy_consumed: frequenz.api.common.metrics_pb2.Metric | None = ...,
106
+ energy_delivered: frequenz.api.common.metrics_pb2.Metric | None = ...,
107
+ ) -> None: ...
108
+ def HasField(self, field_name: typing_extensions.Literal["energy", b"energy", "energy_consumed", b"energy_consumed", "energy_delivered", b"energy_delivered"]) -> builtins.bool: ...
109
+ def ClearField(self, field_name: typing_extensions.Literal["energy", b"energy", "energy_consumed", b"energy_consumed", "energy_delivered", b"energy_delivered"]) -> None: ...
110
+
111
+ @typing_extensions.final
112
+ class ReactiveEnergy(google.protobuf.message.Message):
113
+ """The reactive energy the inverter is consuming or generating."""
114
+
115
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
116
+
117
+ ENERGY_FIELD_NUMBER: builtins.int
118
+ ENERGY_CAPACITIVE_FIELD_NUMBER: builtins.int
119
+ ENERGY_INDUCTIVE_FIELD_NUMBER: builtins.int
120
+ @property
121
+ def energy(self) -> frequenz.api.common.metrics_pb2.Metric:
122
+ """The sum of the capacitive and inductive energy.
123
+ This is a signed value. If more energy is capacitive than inductive,
124
+ this is a -ve number, otherwise +ve.
125
+ In Volt-Ampere-hour (VArh).
126
+ """
127
+ @property
128
+ def energy_capacitive(self) -> frequenz.api.common.metrics_pb2.Metric:
129
+ """The capacitive energy.
130
+ In Volt-Ampere-hour (VArh).
131
+ """
132
+ @property
133
+ def energy_inductive(self) -> frequenz.api.common.metrics_pb2.Metric:
134
+ """The inductive energy.
135
+ In Volt-Ampere-hour (VArh).
136
+ """
137
+ def __init__(
138
+ self,
139
+ *,
140
+ energy: frequenz.api.common.metrics_pb2.Metric | None = ...,
141
+ energy_capacitive: frequenz.api.common.metrics_pb2.Metric | None = ...,
142
+ energy_inductive: frequenz.api.common.metrics_pb2.Metric | None = ...,
143
+ ) -> None: ...
144
+ def HasField(self, field_name: typing_extensions.Literal["energy", b"energy", "energy_capacitive", b"energy_capacitive", "energy_inductive", b"energy_inductive"]) -> builtins.bool: ...
145
+ def ClearField(self, field_name: typing_extensions.Literal["energy", b"energy", "energy_capacitive", b"energy_capacitive", "energy_inductive", b"energy_inductive"]) -> None: ...
146
+
147
+ @typing_extensions.final
148
+ class Harmonics(google.protobuf.message.Message):
149
+ """The harmonics of the fast Fourier transform of the instantaneous values
150
+ and its total harmonic distortion.
151
+ In percent (%).
152
+ """
153
+
154
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
155
+
156
+ HARMONIC_1_FIELD_NUMBER: builtins.int
157
+ HARMONIC_2_FIELD_NUMBER: builtins.int
158
+ HARMONIC_3_FIELD_NUMBER: builtins.int
159
+ HARMONIC_4_FIELD_NUMBER: builtins.int
160
+ HARMONIC_5_FIELD_NUMBER: builtins.int
161
+ HARMONIC_6_FIELD_NUMBER: builtins.int
162
+ HARMONIC_7_FIELD_NUMBER: builtins.int
163
+ HARMONIC_8_FIELD_NUMBER: builtins.int
164
+ HARMONIC_9_FIELD_NUMBER: builtins.int
165
+ HARMONIC_10_FIELD_NUMBER: builtins.int
166
+ HARMONIC_11_FIELD_NUMBER: builtins.int
167
+ harmonic_1: builtins.float
168
+ harmonic_2: builtins.float
169
+ harmonic_3: builtins.float
170
+ harmonic_4: builtins.float
171
+ harmonic_5: builtins.float
172
+ harmonic_6: builtins.float
173
+ harmonic_7: builtins.float
174
+ harmonic_8: builtins.float
175
+ harmonic_9: builtins.float
176
+ harmonic_10: builtins.float
177
+ harmonic_11: builtins.float
178
+ def __init__(
179
+ self,
180
+ *,
181
+ harmonic_1: builtins.float = ...,
182
+ harmonic_2: builtins.float = ...,
183
+ harmonic_3: builtins.float = ...,
184
+ harmonic_4: builtins.float = ...,
185
+ harmonic_5: builtins.float = ...,
186
+ harmonic_6: builtins.float = ...,
187
+ harmonic_7: builtins.float = ...,
188
+ harmonic_8: builtins.float = ...,
189
+ harmonic_9: builtins.float = ...,
190
+ harmonic_10: builtins.float = ...,
191
+ harmonic_11: builtins.float = ...,
192
+ ) -> None: ...
193
+ def ClearField(self, field_name: typing_extensions.Literal["harmonic_1", b"harmonic_1", "harmonic_10", b"harmonic_10", "harmonic_11", b"harmonic_11", "harmonic_2", b"harmonic_2", "harmonic_3", b"harmonic_3", "harmonic_4", b"harmonic_4", "harmonic_5", b"harmonic_5", "harmonic_6", b"harmonic_6", "harmonic_7", b"harmonic_7", "harmonic_8", b"harmonic_8", "harmonic_9", b"harmonic_9"]) -> None: ...
194
+
195
+ @typing_extensions.final
196
+ class ACPhase(google.protobuf.message.Message):
197
+ """AC metrics of a single phase."""
198
+
199
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
200
+
201
+ VOLTAGE_FIELD_NUMBER: builtins.int
202
+ CURRENT_FIELD_NUMBER: builtins.int
203
+ POWER_ACTIVE_FIELD_NUMBER: builtins.int
204
+ POWER_REACTIVE_FIELD_NUMBER: builtins.int
205
+ ENERGY_APPARENT_FIELD_NUMBER: builtins.int
206
+ ENERGY_ACTIVE_FIELD_NUMBER: builtins.int
207
+ ENERGY_REACTIVE_FIELD_NUMBER: builtins.int
208
+ HARMONICS_POWER_ACTIVE_FIELD_NUMBER: builtins.int
209
+ THD_POWER_ACTIVE_FIELD_NUMBER: builtins.int
210
+ @property
211
+ def voltage(self) -> frequenz.api.common.metrics_pb2.Metric:
212
+ """The AC voltage between the line and the neutral wire.
213
+ In Volt (V).
214
+ """
215
+ @property
216
+ def current(self) -> frequenz.api.common.metrics_pb2.Metric:
217
+ """AC current.
218
+ +ve current means consumption, away from the grid.
219
+ -ve current means supply into the grid.
220
+ In Ampere (A).
221
+ """
222
+ @property
223
+ def power_active(self) -> frequenz.api.common.metrics_pb2.Metric:
224
+ """AC active power.
225
+ +ve power means consumption, away from the grid.
226
+ -ve power means supply into the grid.
227
+ In Watt (W).
228
+ """
229
+ @property
230
+ def power_reactive(self) -> frequenz.api.common.metrics_pb2.Metric:
231
+ """AC reactive power.
232
+ +ve power means inductive (leading).
233
+ -ve power means capacitive (lagging).
234
+ In Volt-Ampere reactive (VAr).
235
+ """
236
+ @property
237
+ def energy_apparent(self) -> frequenz.api.common.metrics_pb2.Metric:
238
+ """The total apparent energy. A Positive value represents the net apparent
239
+ energy supplied to the grid connection, and vice versa.
240
+ In Volt-Ampere-hour (VAh).
241
+ """
242
+ @property
243
+ def energy_active(self) -> global___AC.ActiveEnergy:
244
+ """The total active energy counters for the underlying component's
245
+ consumption and supply.
246
+ In Watt-hour (Wh).
247
+ """
248
+ @property
249
+ def energy_reactive(self) -> global___AC.ReactiveEnergy:
250
+ """The total reactive energy counters for the underlying component's
251
+ capacitive and inductive energy values.
252
+ In Volt-Ampere reactive hour (VArh).
253
+ """
254
+ @property
255
+ def harmonics_power_active(self) -> global___AC.Harmonics:
256
+ """Harmonics of the instantaneous active power at the component.
257
+ In percent (%).
258
+ """
259
+ thd_power_active: builtins.float
260
+ """Total harmonic distortion
261
+ of the instantaneous active power at the component.
262
+ In percent (%).
263
+ """
264
+ def __init__(
265
+ self,
266
+ *,
267
+ voltage: frequenz.api.common.metrics_pb2.Metric | None = ...,
268
+ current: frequenz.api.common.metrics_pb2.Metric | None = ...,
269
+ power_active: frequenz.api.common.metrics_pb2.Metric | None = ...,
270
+ power_reactive: frequenz.api.common.metrics_pb2.Metric | None = ...,
271
+ energy_apparent: frequenz.api.common.metrics_pb2.Metric | None = ...,
272
+ energy_active: global___AC.ActiveEnergy | None = ...,
273
+ energy_reactive: global___AC.ReactiveEnergy | None = ...,
274
+ harmonics_power_active: global___AC.Harmonics | None = ...,
275
+ thd_power_active: builtins.float = ...,
276
+ ) -> None: ...
277
+ def HasField(self, field_name: typing_extensions.Literal["current", b"current", "energy_active", b"energy_active", "energy_apparent", b"energy_apparent", "energy_reactive", b"energy_reactive", "harmonics_power_active", b"harmonics_power_active", "power_active", b"power_active", "power_reactive", b"power_reactive", "voltage", b"voltage"]) -> builtins.bool: ...
278
+ def ClearField(self, field_name: typing_extensions.Literal["current", b"current", "energy_active", b"energy_active", "energy_apparent", b"energy_apparent", "energy_reactive", b"energy_reactive", "harmonics_power_active", b"harmonics_power_active", "power_active", b"power_active", "power_reactive", b"power_reactive", "thd_power_active", b"thd_power_active", "voltage", b"voltage"]) -> None: ...
279
+
280
+ FREQUENCY_FIELD_NUMBER: builtins.int
281
+ CURRENT_FIELD_NUMBER: builtins.int
282
+ POWER_APPARENT_FIELD_NUMBER: builtins.int
283
+ POWER_ACTIVE_FIELD_NUMBER: builtins.int
284
+ POWER_REACTIVE_FIELD_NUMBER: builtins.int
285
+ ENERGY_APPARENT_FIELD_NUMBER: builtins.int
286
+ ENERGY_ACTIVE_FIELD_NUMBER: builtins.int
287
+ ENERGY_REACTIVE_FIELD_NUMBER: builtins.int
288
+ HARMONICS_POWER_ACTIVE_FIELD_NUMBER: builtins.int
289
+ THD_POWER_ACTIVE_FIELD_NUMBER: builtins.int
290
+ PHASE_1_FIELD_NUMBER: builtins.int
291
+ PHASE_2_FIELD_NUMBER: builtins.int
292
+ PHASE_3_FIELD_NUMBER: builtins.int
293
+ @property
294
+ def frequency(self) -> frequenz.api.common.metrics_pb2.Metric:
295
+ """Overall AC metrics.
296
+
297
+ The AC frequency.
298
+ In Hertz (Hz).
299
+ """
300
+ @property
301
+ def current(self) -> frequenz.api.common.metrics_pb2.Metric:
302
+ """The apparent 3-phase AC current. Positive values represent apparent energy
303
+ flowing towards the grid connection, and vice versa.
304
+ In Ampere (A).
305
+ """
306
+ @property
307
+ def power_apparent(self) -> frequenz.api.common.metrics_pb2.Metric:
308
+ """The apparent 3-phase AC power. Positive values represent apparent energy
309
+ flowing towards the grid connection, and vice versa.
310
+ In Volt-Ampere (VA).
311
+ """
312
+ @property
313
+ def power_active(self) -> frequenz.api.common.metrics_pb2.Metric:
314
+ """The total active 3-phase AC active power.
315
+ +ve power means consumption, away from the grid.
316
+ -ve power means supply into the grid.
317
+ In Watt (W).
318
+ """
319
+ @property
320
+ def power_reactive(self) -> frequenz.api.common.metrics_pb2.Metric:
321
+ """The reactive 3-phase AC power.
322
+ +ve power means inductive (leading).
323
+ -ve power means capacitive (lagging).
324
+ In Volt-Ampere reactive (VAr).
325
+ """
326
+ @property
327
+ def energy_apparent(self) -> frequenz.api.common.metrics_pb2.Metric:
328
+ """The total 3-phase apparent energy. A positive value represents the net
329
+ apparent energy supplied to the grid connection, and vice versa.
330
+ In Volt-Ampere-hour (VAh).
331
+ """
332
+ @property
333
+ def energy_active(self) -> global___AC.ActiveEnergy:
334
+ """The total 3-phase active energy counters for the underlying component's
335
+ consumption and supply.
336
+ In Watt-hour (Wh).
337
+ """
338
+ @property
339
+ def energy_reactive(self) -> global___AC.ReactiveEnergy:
340
+ """The total 3-phase reactive energy counters for the underlying component's
341
+ capacitive and inductive energy values.
342
+ In Volt-Ampere reactive hour (VArh).
343
+ FIXME: ReactiveEnergy says Volt-Ampere-hour (VAh).
344
+ """
345
+ @property
346
+ def harmonics_power_active(self) -> global___AC.Harmonics:
347
+ """The sums of the harmonics
348
+ of the instantaneous active power at the component across all 3 phases.
349
+ """
350
+ thd_power_active: builtins.float
351
+ """The sums of the total harmonic distortion
352
+ of the instantaneous active power at the component across all 3 phases.
353
+ """
354
+ @property
355
+ def phase_1(self) -> global___AC.ACPhase:
356
+ """AC metrics for phase/line 1."""
357
+ @property
358
+ def phase_2(self) -> global___AC.ACPhase:
359
+ """AC metrics for phase/line 2."""
360
+ @property
361
+ def phase_3(self) -> global___AC.ACPhase:
362
+ """AC metrics for phase/line 3."""
363
+ def __init__(
364
+ self,
365
+ *,
366
+ frequency: frequenz.api.common.metrics_pb2.Metric | None = ...,
367
+ current: frequenz.api.common.metrics_pb2.Metric | None = ...,
368
+ power_apparent: frequenz.api.common.metrics_pb2.Metric | None = ...,
369
+ power_active: frequenz.api.common.metrics_pb2.Metric | None = ...,
370
+ power_reactive: frequenz.api.common.metrics_pb2.Metric | None = ...,
371
+ energy_apparent: frequenz.api.common.metrics_pb2.Metric | None = ...,
372
+ energy_active: global___AC.ActiveEnergy | None = ...,
373
+ energy_reactive: global___AC.ReactiveEnergy | None = ...,
374
+ harmonics_power_active: global___AC.Harmonics | None = ...,
375
+ thd_power_active: builtins.float = ...,
376
+ phase_1: global___AC.ACPhase | None = ...,
377
+ phase_2: global___AC.ACPhase | None = ...,
378
+ phase_3: global___AC.ACPhase | None = ...,
379
+ ) -> None: ...
380
+ def HasField(self, field_name: typing_extensions.Literal["current", b"current", "energy_active", b"energy_active", "energy_apparent", b"energy_apparent", "energy_reactive", b"energy_reactive", "frequency", b"frequency", "harmonics_power_active", b"harmonics_power_active", "phase_1", b"phase_1", "phase_2", b"phase_2", "phase_3", b"phase_3", "power_active", b"power_active", "power_apparent", b"power_apparent", "power_reactive", b"power_reactive"]) -> builtins.bool: ...
381
+ def ClearField(self, field_name: typing_extensions.Literal["current", b"current", "energy_active", b"energy_active", "energy_apparent", b"energy_apparent", "energy_reactive", b"energy_reactive", "frequency", b"frequency", "harmonics_power_active", b"harmonics_power_active", "phase_1", b"phase_1", "phase_2", b"phase_2", "phase_3", b"phase_3", "power_active", b"power_active", "power_apparent", b"power_apparent", "power_reactive", b"power_reactive", "thd_power_active", b"thd_power_active"]) -> None: ...
382
+
383
+ global___AC = AC
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -0,0 +1,11 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Contains definitions for electrical metrics (AC and DC).
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: frequenz/api/common/metrics.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!frequenz/api/common/metrics.proto\x12\x1b\x66requenz.api.common.metrics\"&\n\x06\x42ounds\x12\r\n\x05lower\x18\x01 \x01(\x02\x12\r\n\x05upper\x18\x02 \x01(\x02\"\x9d\x02\n\x06Metric\x12\r\n\x05value\x18\x01 \x01(\x02\x12\x39\n\x0crated_bounds\x18\x02 \x01(\x0b\x32#.frequenz.api.common.metrics.Bounds\x12=\n\x10\x63omponent_bounds\x18\x03 \x01(\x0b\x32#.frequenz.api.common.metrics.Bounds\x12\x44\n\x17system_exclusion_bounds\x18\x04 \x01(\x0b\x32#.frequenz.api.common.metrics.Bounds\x12\x44\n\x17system_inclusion_bounds\x18\x05 \x01(\x0b\x32#.frequenz.api.common.metrics.Boundsb\x06proto3')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frequenz.api.common.metrics_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ _BOUNDS._serialized_start=66
24
+ _BOUNDS._serialized_end=104
25
+ _METRIC._serialized_start=107
26
+ _METRIC._serialized_end=392
27
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,142 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Metrics & bounds definitions.
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
12
+ import builtins
13
+ import google.protobuf.descriptor
14
+ import google.protobuf.message
15
+ import sys
16
+
17
+ if sys.version_info >= (3, 8):
18
+ import typing as typing_extensions
19
+ else:
20
+ import typing_extensions
21
+
22
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
23
+
24
+ @typing_extensions.final
25
+ class Bounds(google.protobuf.message.Message):
26
+ """A set of lower and upper bounds for any metric.
27
+ The units of the bounds are always the same as the related metric.
28
+ """
29
+
30
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
31
+
32
+ LOWER_FIELD_NUMBER: builtins.int
33
+ UPPER_FIELD_NUMBER: builtins.int
34
+ lower: builtins.float
35
+ """The lower bound."""
36
+ upper: builtins.float
37
+ """The upper bound."""
38
+ def __init__(
39
+ self,
40
+ *,
41
+ lower: builtins.float = ...,
42
+ upper: builtins.float = ...,
43
+ ) -> None: ...
44
+ def ClearField(self, field_name: typing_extensions.Literal["lower", b"lower", "upper", b"upper"]) -> None: ...
45
+
46
+ global___Bounds = Bounds
47
+
48
+ @typing_extensions.final
49
+ class Metric(google.protobuf.message.Message):
50
+ """A metric's value, with optional limits."""
51
+
52
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
53
+
54
+ VALUE_FIELD_NUMBER: builtins.int
55
+ RATED_BOUNDS_FIELD_NUMBER: builtins.int
56
+ COMPONENT_BOUNDS_FIELD_NUMBER: builtins.int
57
+ SYSTEM_EXCLUSION_BOUNDS_FIELD_NUMBER: builtins.int
58
+ SYSTEM_INCLUSION_BOUNDS_FIELD_NUMBER: builtins.int
59
+ value: builtins.float
60
+ """The current value of the metric."""
61
+ @property
62
+ def rated_bounds(self) -> global___Bounds:
63
+ """The manufacturer's rated bounds of the metric. This may differ from
64
+ `system_bounds` as it does not take into account the current state of the
65
+ overall system.
66
+ """
67
+ @property
68
+ def component_bounds(self) -> global___Bounds:
69
+ """The current bounds of the metric, as imposed by the component this metric
70
+ originates from.
71
+ """
72
+ @property
73
+ def system_exclusion_bounds(self) -> global___Bounds:
74
+ """These bounds indicate the range of values that are disallowed for the
75
+ metric.
76
+ If these bounds for a metric are [`lower`, `upper`], then this metric's
77
+ `value` needs to comply with the constraints
78
+ `value <= lower` OR `upper <= value`.
79
+
80
+ It is important to note that these bounds work together with
81
+ `system_inclusion_bounds`.
82
+
83
+ E.g., for the system to accept a charge command,
84
+ clients need to request power values within the bounds
85
+ `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
86
+ This means that clients can only request charge commands with values that
87
+ are within the `system_inclusion_bounds`, but not within
88
+ `system_exclusion_bounds`.
89
+ Similarly, for the system to accept a discharge command,
90
+ clients need to request power values within the bounds
91
+ `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.
92
+
93
+ The following diagram illustrates the relationship between the bounds.
94
+ ```
95
+ inclusion.lower inclusion.upper
96
+ <-------|============|------------------|============|--------->
97
+ exclusion.lower exclusion.upper
98
+ ```
99
+ ---- values here are disallowed and wil be rejected
100
+ ==== vales here are allowed and will be accepted
101
+ """
102
+ @property
103
+ def system_inclusion_bounds(self) -> global___Bounds:
104
+ """These bounds indicate the range of values that are allowed for the metric.
105
+ If these bounds for a metric are [`lower`, `upper`], then this metric's
106
+ `value` needs to comply with the constraint `lower <= value <= upper`
107
+
108
+ It is important to note that these bounds work together with
109
+ `system_exclusion_bounds`.
110
+
111
+ E.g., for the system to accept a charge command,
112
+ clients need to request power values within the bounds
113
+ `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
114
+ This means that clients can only request charge commands with values that
115
+ are within the `system_inclusion_bounds`, but not within
116
+ `system_exclusion_bounds`.
117
+ Similarly, for the system to accept a discharge command,
118
+ clients need to request power values within the bounds
119
+ `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.
120
+
121
+ The following diagram illustrates the relationship between the bounds.
122
+ ```
123
+ inclusion.lower inclusion.upper
124
+ <-------|============|------------------|============|--------->
125
+ exclusion.lower exclusion.upper
126
+ ```
127
+ ---- values here are disallowed and wil be rejected
128
+ ==== vales here are allowed and will be accepted
129
+ """
130
+ def __init__(
131
+ self,
132
+ *,
133
+ value: builtins.float = ...,
134
+ rated_bounds: global___Bounds | None = ...,
135
+ component_bounds: global___Bounds | None = ...,
136
+ system_exclusion_bounds: global___Bounds | None = ...,
137
+ system_inclusion_bounds: global___Bounds | None = ...,
138
+ ) -> None: ...
139
+ def HasField(self, field_name: typing_extensions.Literal["component_bounds", b"component_bounds", "rated_bounds", b"rated_bounds", "system_exclusion_bounds", b"system_exclusion_bounds", "system_inclusion_bounds", b"system_inclusion_bounds"]) -> builtins.bool: ...
140
+ def ClearField(self, field_name: typing_extensions.Literal["component_bounds", b"component_bounds", "rated_bounds", b"rated_bounds", "system_exclusion_bounds", b"system_exclusion_bounds", "system_inclusion_bounds", b"system_inclusion_bounds", "value", b"value"]) -> None: ...
141
+
142
+ global___Metric = Metric
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -0,0 +1,11 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Metrics & bounds definitions.
5
+
6
+ Copyright:
7
+ Copyright 2023 Frequenz Energy-as-a-Service GmbH
8
+
9
+ License:
10
+ MIT
11
+ """
File without changes
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Frequenz Energy-as-a-Service GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.1
2
+ Name: frequenz-api-common
3
+ Version: 0.0.1
4
+ Summary: Frequenz common gRPC API and bindings
5
+ Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
+ License: MIT
7
+ Project-URL: Changelog, https://github.com/frequenz-floss/frequenz-api-common/releases
8
+ Project-URL: Repository, https://github.com/frequenz-floss/frequenz-api-common
9
+ Project-URL: Issues, https://github.com/frequenz-floss/frequenz-api-common/issues
10
+ Project-URL: Support, https://github.com/frequenz-floss/frequenz-api-common/discussions/categories/support
11
+ Keywords: frequenz,api,microgrid,grpc,common
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Requires-Python: <4,>=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: googleapis-common-protos (<2,>=1.56.2)
22
+ Requires-Dist: grpcio (<2,>=1.51.1)
23
+ Provides-Extra: dev
24
+ Requires-Dist: frequenz-api-common[dev-docstrings,dev-formatting,dev-mypy,dev-noxfile,dev-pylint,dev-pytest] ; extra == 'dev'
25
+ Provides-Extra: dev-docstrings
26
+ Requires-Dist: pydocstyle (==6.3.0) ; extra == 'dev-docstrings'
27
+ Requires-Dist: darglint (==1.8.1) ; extra == 'dev-docstrings'
28
+ Provides-Extra: dev-formatting
29
+ Requires-Dist: black (==23.3.0) ; extra == 'dev-formatting'
30
+ Requires-Dist: isort (==5.12.0) ; extra == 'dev-formatting'
31
+ Provides-Extra: dev-mypy
32
+ Requires-Dist: mypy (==1.1.1) ; extra == 'dev-mypy'
33
+ Requires-Dist: frequenz-api-common[dev-noxfile,dev-pytest] ; extra == 'dev-mypy'
34
+ Provides-Extra: dev-noxfile
35
+ Requires-Dist: nox (==2022.11.21) ; extra == 'dev-noxfile'
36
+ Requires-Dist: frequenz-repo-config[api] (==0.1.0) ; extra == 'dev-noxfile'
37
+ Provides-Extra: dev-pylint
38
+ Requires-Dist: pylint (==2.17.1) ; extra == 'dev-pylint'
39
+ Requires-Dist: frequenz-api-common[dev-noxfile,dev-pytest] ; extra == 'dev-pylint'
40
+ Provides-Extra: dev-pytest
41
+ Requires-Dist: pytest (==7.2.2) ; extra == 'dev-pytest'
42
+
43
+ # frequenz-api-common
44
+ Common definitions for frequenz GRPC APIs
@@ -0,0 +1,20 @@
1
+ frequenz/api/common/__init__.py,sha256=ZLbpFmfPtTV1oZv__VyouHxLBWH4bCWd9FDunPN7_qc,109
2
+ frequenz/api/common/components_pb2.py,sha256=OQW2Rbk6mUzV_IRYhLGvJt_7meOzy7If8kBiR16TnK4,2827
3
+ frequenz/api/common/components_pb2.pyi,sha256=rnznC-GroJ11C2tVNbh4rukhX4oFqsouQl0gc6mgzuA,9339
4
+ frequenz/api/common/components_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
5
+ frequenz/api/common/components_pb2_grpc.pyi,sha256=9dM5DDWgKHR0FsTf7WwVkFDT37dzYstTN4-I8JNR5m0,194
6
+ frequenz/api/common/metrics_pb2.py,sha256=d3_5WeeyrT4OowbgkvQDyqb4G9k1pB2Ort4Eqd6qkpI,1537
7
+ frequenz/api/common/metrics_pb2.pyi,sha256=yF7gq_gVfuXsb1gB3WTSQrfxc5tRkoppZvVBiwnLKuM,5895
8
+ frequenz/api/common/metrics_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
9
+ frequenz/api/common/metrics_pb2_grpc.pyi,sha256=-_fp5vGddjdIyt7POhz64WoVPfb-T3PWnEfFb4lsbPk,181
10
+ frequenz/api/common/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ frequenz/api/common/metrics/__init__.py,sha256=ArEp_JN7ikRD0ok4KePn2bLyBwnpyb-xptDoM6BpoUE,121
12
+ frequenz/api/common/metrics/electrical_pb2.py,sha256=xDsHnCxBIPnKV-tn_NJPo9ajZwUqfWeLlfX0nWJpMoc,4813
13
+ frequenz/api/common/metrics/electrical_pb2.pyi,sha256=ZmxfC1niILk4tWpqoq5cen869FDKfXsuJJS7xUdg86U,17746
14
+ frequenz/api/common/metrics/electrical_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
15
+ frequenz/api/common/metrics/electrical_pb2_grpc.pyi,sha256=K-iOV0LBd_KXJCxW4cooqHfQN5wpv40pCsxuGy32Yd0,208
16
+ frequenz_api_common-0.0.1.dist-info/LICENSE,sha256=gX5kdsO01CbEhdW0VjzW8HYxCrAnG3rZnYrd1ZPQ1b8,1090
17
+ frequenz_api_common-0.0.1.dist-info/METADATA,sha256=az3FVNpUwfk44dasN7WXwv9fDL8q3V0fZiV5SlHcqMw,2159
18
+ frequenz_api_common-0.0.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
19
+ frequenz_api_common-0.0.1.dist-info/top_level.txt,sha256=x08GRcWytsyKXa2Ayme9e5pg3L5Kcq6lw_BaQmToMO4,9
20
+ frequenz_api_common-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.40.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ frequenz