Skip to content

Commit 3e84751

Browse files
committed
Add release notes for previously merged changes
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 7c531c9 commit 3e84751

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

RELEASE_NOTES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,32 @@
66

77
## Upgrading
88

9+
- `Sample` objects no longer hold `float`s, but rather `Quantity` or one of its subclasses, like `Power`, `Current`, `Energy`, etc. based on the type of values being streamed.
10+
11+
```python
12+
sample: Sample[Power] = await battery_pool.power.new_receiver().receive()
13+
power: float = sample.value.as_watts()
14+
```
15+
16+
- `BatteryPool.soc` now streams values of type `Sample[Quantity]`, and `BatteryPool.capacity` now streams values of type `Sample[Energy]`.
17+
18+
```python
19+
battery_pool = microgrid.battery_pool()
20+
soc_sample: Sample[Quantity] = await battery_pool.soc.new_receiver().receive()
21+
soc: float = soc_sample.value.base_value
22+
23+
capacity_sample: Sample[Energy] = await battery_pool.capacity.new_receiver().receive()
24+
capacity: float = soc_sample.value.as_watt_hours()
25+
```
26+
927
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1028

1129
## New Features
1230

1331
- The logical meter has a new method that returns producer power, that is the sum of all energy producers.
1432

33+
- `Quantity` types (`Power`, `Current`, `Energy`, `Voltage`) for providing type- and unit-safety when dealing with physical quantities.
34+
1535
<!-- Here goes the main new features and examples or instructions on how to use them -->
1636

1737
## Bug Fixes

0 commit comments

Comments
 (0)