frequenz-client-microgrid 0.2.0__tar.gz → 0.3.0__tar.gz

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.
Files changed (23) hide show
  1. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/PKG-INFO +5 -4
  2. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/README.md +4 -3
  3. frequenz-client-microgrid-0.3.0/RELEASE_NOTES.md +5 -0
  4. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/pyproject.toml +1 -1
  5. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_component.py +10 -0
  6. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_component_data.py +120 -18
  7. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_metadata.py +4 -2
  8. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz_client_microgrid.egg-info/PKG-INFO +5 -4
  9. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz_client_microgrid.egg-info/requires.txt +1 -1
  10. frequenz-client-microgrid-0.2.0/RELEASE_NOTES.md +0 -10
  11. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/LICENSE +0 -0
  12. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/MANIFEST.in +0 -0
  13. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/setup.cfg +0 -0
  14. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/__init__.py +0 -0
  15. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_client.py +0 -0
  16. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_component_states.py +0 -0
  17. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_connection.py +0 -0
  18. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/_constants.py +0 -0
  19. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/conftest.py +0 -0
  20. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz/client/microgrid/py.typed +0 -0
  21. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz_client_microgrid.egg-info/SOURCES.txt +0 -0
  22. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz_client_microgrid.egg-info/dependency_links.txt +0 -0
  23. {frequenz-client-microgrid-0.2.0 → frequenz-client-microgrid-0.3.0}/src/frequenz_client_microgrid.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frequenz-client-microgrid
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Microgrid API client for Python
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -38,9 +38,10 @@ License-File: LICENSE
38
38
 
39
39
  ## Introduction
40
40
 
41
- Microgrid API client for Python
42
-
43
- TODO(cookiecutter): Improve the README file
41
+ This project provides a Python client for the [Frequenz Microgrid
42
+ API](https://frequenz-floss.github.io/frequenz-api-microgrid/) that is more
43
+ idiomatic to use in Python than the automatically-generated gRPC client
44
+ provided by `protoc`.
44
45
 
45
46
  ## Supported Platforms
46
47
 
@@ -6,9 +6,10 @@
6
6
 
7
7
  ## Introduction
8
8
 
9
- Microgrid API client for Python
10
-
11
- TODO(cookiecutter): Improve the README file
9
+ This project provides a Python client for the [Frequenz Microgrid
10
+ API](https://frequenz-floss.github.io/frequenz-api-microgrid/) that is more
11
+ idiomatic to use in Python than the automatically-generated gRPC client
12
+ provided by `protoc`.
12
13
 
13
14
  ## Supported Platforms
14
15
 
@@ -0,0 +1,5 @@
1
+ # Frequenz Microgrid API Client Release Notes
2
+
3
+ ## New Features
4
+
5
+ - The `reactive_power` is exposed for meters, inverters and EV chargers.
@@ -37,7 +37,7 @@ classifiers = [
37
37
  requires-python = ">= 3.11, < 4"
38
38
  dependencies = [
39
39
  "frequenz-api-microgrid >= 0.15.3, < 0.16.0",
40
- "frequenz-channels == 1.0.0-rc1",
40
+ "frequenz-channels >= 1.0.0-rc1, < 2.0.0",
41
41
  "frequenz-client-base >= 0.3.0, < 0.4.0",
42
42
  "grpcio >= 1.54.2, < 2",
43
43
  "protobuf >= 4.21.6, < 5",
@@ -207,6 +207,16 @@ class ComponentMetricId(Enum):
207
207
  ACTIVE_POWER_PHASE_3 = "active_power_phase_3"
208
208
  """Active power in phase 3."""
209
209
 
210
+ REACTIVE_POWER = "reactive_power"
211
+ """Reactive power."""
212
+
213
+ REACTIVE_POWER_PHASE_1 = "reactive_power_phase_1"
214
+ """Reactive power in phase 1."""
215
+ REACTIVE_POWER_PHASE_2 = "reactive_power_phase_2"
216
+ """Reactive power in phase 2."""
217
+ REACTIVE_POWER_PHASE_3 = "reactive_power_phase_3"
218
+ """Reactive power in phase 3."""
219
+
210
220
  CURRENT_PHASE_1 = "current_phase_1"
211
221
  """Current in phase 1."""
212
222
  CURRENT_PHASE_2 = "current_phase_2"
@@ -70,18 +70,46 @@ class MeterData(ComponentData):
70
70
  """A wrapper class for holding meter data."""
71
71
 
72
72
  active_power: float
73
- """The 3-phase active power, in Watts, represented in the passive sign convention.
74
- +ve current means consumption, away from the grid.
75
- -ve current means supply into the grid.
73
+ """The total active 3-phase AC power, in Watts (W).
74
+
75
+ Represented in the passive sign convention.
76
+
77
+ * Positive means consumption from the grid.
78
+ * Negative means supply into the grid.
76
79
  """
77
80
 
78
81
  active_power_per_phase: tuple[float, float, float]
79
- """The AC active power for phase/line 1,2 and 3 respectively."""
82
+ """The per-phase AC active power for phase 1, 2, and 3 respectively, in Watt (W).
83
+
84
+ Represented in the passive sign convention.
85
+
86
+ * Positive means consumption from the grid.
87
+ * Negative means supply into the grid.
88
+ """
89
+
90
+ reactive_power: float
91
+ """The total reactive 3-phase AC power, in Volt-Ampere Reactive (VAr).
92
+
93
+ * Positive power means capacitive (current leading w.r.t. voltage).
94
+ * Negative power means inductive (current lagging w.r.t. voltage).
95
+ """
96
+
97
+ reactive_power_per_phase: tuple[float, float, float]
98
+ """The per-phase AC reactive power, in Volt-Ampere Reactive (VAr).
99
+
100
+ The provided values are for phase 1, 2, and 3 respectively.
101
+
102
+ * Positive power means capacitive (current leading w.r.t. voltage).
103
+ * Negative power means inductive (current lagging w.r.t. voltage).
104
+ """
80
105
 
81
106
  current_per_phase: tuple[float, float, float]
82
107
  """AC current in Amperes (A) for phase/line 1,2 and 3 respectively.
83
- +ve current means consumption, away from the grid.
84
- -ve current means supply into the grid.
108
+
109
+ Represented in the passive sign convention.
110
+
111
+ * Positive means consumption from the grid.
112
+ * Negative means supply into the grid.
85
113
  """
86
114
 
87
115
  voltage_per_phase: tuple[float, float, float]
@@ -111,6 +139,12 @@ class MeterData(ComponentData):
111
139
  raw.meter.data.ac.phase_2.power_active.value,
112
140
  raw.meter.data.ac.phase_3.power_active.value,
113
141
  ),
142
+ reactive_power=raw.meter.data.ac.power_reactive.value,
143
+ reactive_power_per_phase=(
144
+ raw.meter.data.ac.phase_1.power_reactive.value,
145
+ raw.meter.data.ac.phase_2.power_reactive.value,
146
+ raw.meter.data.ac.phase_3.power_reactive.value,
147
+ ),
114
148
  current_per_phase=(
115
149
  raw.meter.data.ac.phase_1.current.value,
116
150
  raw.meter.data.ac.phase_2.current.value,
@@ -241,18 +275,46 @@ class InverterData(ComponentData): # pylint: disable=too-many-instance-attribut
241
275
  """A wrapper class for holding inverter data."""
242
276
 
243
277
  active_power: float
244
- """The 3-phase active power, in Watts, represented in the passive sign convention.
245
- +ve current means consumption, away from the grid.
246
- -ve current means supply into the grid.
278
+ """The total active 3-phase AC power, in Watts (W).
279
+
280
+ Represented in the passive sign convention.
281
+
282
+ * Positive means consumption from the grid.
283
+ * Negative means supply into the grid.
247
284
  """
248
285
 
249
286
  active_power_per_phase: tuple[float, float, float]
250
- """The AC active power for phase/line 1, 2 and 3 respectively."""
287
+ """The per-phase AC active power for phase 1, 2, and 3 respectively, in Watt (W).
288
+
289
+ Represented in the passive sign convention.
290
+
291
+ * Positive means consumption from the grid.
292
+ * Negative means supply into the grid.
293
+ """
294
+
295
+ reactive_power: float
296
+ """The total reactive 3-phase AC power, in Volt-Ampere Reactive (VAr).
297
+
298
+ * Positive power means capacitive (current leading w.r.t. voltage).
299
+ * Negative power means inductive (current lagging w.r.t. voltage).
300
+ """
301
+
302
+ reactive_power_per_phase: tuple[float, float, float]
303
+ """The per-phase AC reactive power, in Volt-Ampere Reactive (VAr).
304
+
305
+ The provided values are for phase 1, 2, and 3 respectively.
306
+
307
+ * Positive power means capacitive (current leading w.r.t. voltage).
308
+ * Negative power means inductive (current lagging w.r.t. voltage).
309
+ """
251
310
 
252
311
  current_per_phase: tuple[float, float, float]
253
312
  """AC current in Amperes (A) for phase/line 1, 2 and 3 respectively.
254
- +ve current means consumption, away from the grid.
255
- -ve current means supply into the grid.
313
+
314
+ Represented in the passive sign convention.
315
+
316
+ * Positive means consumption from the grid.
317
+ * Negative means supply into the grid.
256
318
  """
257
319
 
258
320
  voltage_per_phase: tuple[float, float, float]
@@ -335,6 +397,12 @@ class InverterData(ComponentData): # pylint: disable=too-many-instance-attribut
335
397
  raw.inverter.data.ac.phase_2.power_active.value,
336
398
  raw.inverter.data.ac.phase_3.power_active.value,
337
399
  ),
400
+ reactive_power=raw.inverter.data.ac.power_reactive.value,
401
+ reactive_power_per_phase=(
402
+ raw.inverter.data.ac.phase_1.power_reactive.value,
403
+ raw.inverter.data.ac.phase_2.power_reactive.value,
404
+ raw.inverter.data.ac.phase_3.power_reactive.value,
405
+ ),
338
406
  current_per_phase=(
339
407
  raw.inverter.data.ac.phase_1.current.value,
340
408
  raw.inverter.data.ac.phase_2.current.value,
@@ -363,18 +431,46 @@ class EVChargerData(ComponentData): # pylint: disable=too-many-instance-attribu
363
431
  """A wrapper class for holding ev_charger data."""
364
432
 
365
433
  active_power: float
366
- """The 3-phase active power, in Watts, represented in the passive sign convention.
367
- +ve current means consumption, away from the grid.
368
- -ve current means supply into the grid.
434
+ """The total active 3-phase AC power, in Watts (W).
435
+
436
+ Represented in the passive sign convention.
437
+
438
+ * Positive means consumption from the grid.
439
+ * Negative means supply into the grid.
369
440
  """
370
441
 
371
442
  active_power_per_phase: tuple[float, float, float]
372
- """The AC active power for phase/line 1,2 and 3 respectively."""
443
+ """The per-phase AC active power for phase 1, 2, and 3 respectively, in Watt (W).
444
+
445
+ Represented in the passive sign convention.
446
+
447
+ * Positive means consumption from the grid.
448
+ * Negative means supply into the grid.
449
+ """
373
450
 
374
451
  current_per_phase: tuple[float, float, float]
375
452
  """AC current in Amperes (A) for phase/line 1,2 and 3 respectively.
376
- +ve current means consumption, away from the grid.
377
- -ve current means supply into the grid.
453
+
454
+ Represented in the passive sign convention.
455
+
456
+ * Positive means consumption from the grid.
457
+ * Negative means supply into the grid.
458
+ """
459
+
460
+ reactive_power: float
461
+ """The total reactive 3-phase AC power, in Volt-Ampere Reactive (VAr).
462
+
463
+ * Positive power means capacitive (current leading w.r.t. voltage).
464
+ * Negative power means inductive (current lagging w.r.t. voltage).
465
+ """
466
+
467
+ reactive_power_per_phase: tuple[float, float, float]
468
+ """The per-phase AC reactive power, in Volt-Ampere Reactive (VAr).
469
+
470
+ The provided values are for phase 1, 2, and 3 respectively.
471
+
472
+ * Positive power means capacitive (current leading w.r.t. voltage).
473
+ * Negative power means inductive (current lagging w.r.t. voltage).
378
474
  """
379
475
 
380
476
  voltage_per_phase: tuple[float, float, float]
@@ -455,6 +551,12 @@ class EVChargerData(ComponentData): # pylint: disable=too-many-instance-attribu
455
551
  raw.ev_charger.data.ac.phase_2.power_active.value,
456
552
  raw.ev_charger.data.ac.phase_3.power_active.value,
457
553
  ),
554
+ reactive_power=raw.ev_charger.data.ac.power_reactive.value,
555
+ reactive_power_per_phase=(
556
+ raw.ev_charger.data.ac.phase_1.power_reactive.value,
557
+ raw.ev_charger.data.ac.phase_2.power_reactive.value,
558
+ raw.ev_charger.data.ac.phase_3.power_reactive.value,
559
+ ),
458
560
  current_per_phase=(
459
561
  raw.ev_charger.data.ac.phase_1.current.value,
460
562
  raw.ev_charger.data.ac.phase_2.current.value,
@@ -24,8 +24,10 @@ class Location:
24
24
  timezone: ZoneInfo | None = None
25
25
  """The timezone of the microgrid.
26
26
 
27
- The timezone will be set to None if the latitude or longitude points
28
- are not set or the timezone cannot be found given the location points.
27
+ If not passed during construction (or `None` is passed), and there is a `longitude`
28
+ and `latitude`, then the timezone wil be looked up in a database based on the
29
+ coordinates. This lookup could fail, in which case the timezone will still be
30
+ `None`.
29
31
  """
30
32
 
31
33
  def __post_init__(self) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frequenz-client-microgrid
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Microgrid API client for Python
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -38,9 +38,10 @@ License-File: LICENSE
38
38
 
39
39
  ## Introduction
40
40
 
41
- Microgrid API client for Python
42
-
43
- TODO(cookiecutter): Improve the README file
41
+ This project provides a Python client for the [Frequenz Microgrid
42
+ API](https://frequenz-floss.github.io/frequenz-api-microgrid/) that is more
43
+ idiomatic to use in Python than the automatically-generated gRPC client
44
+ provided by `protoc`.
44
45
 
45
46
  ## Supported Platforms
46
47
 
@@ -1,5 +1,5 @@
1
1
  frequenz-api-microgrid<0.16.0,>=0.15.3
2
- frequenz-channels==1.0.0-rc1
2
+ frequenz-channels<2.0.0,>=1.0.0-rc1
3
3
  frequenz-client-base<0.4.0,>=0.3.0
4
4
  grpcio<2,>=1.54.2
5
5
  protobuf<5,>=4.21.6
@@ -1,10 +0,0 @@
1
- # Frequenz Microgrid API Client Release Notes
2
-
3
- ## Summary
4
-
5
- This release updates the minimum required `frequenz-channels` version is updated
6
- to v1.0.0-rc1. This is a breaking change, because the channels API has changed.
7
-
8
- ## Upgrading
9
-
10
- Follow the upgrading instructions from the new channel release: [v1.0.0-rc1](https://github.com/frequenz-floss/frequenz-channels-python/releases/tag/v1.0.0-rc.1).