Skip to content

Commit 58ca166

Browse files
authored
Prepare for release v0.23.0 (#559)
- Improve test that raises an exception - Fix and add missing release notes
2 parents 3e53f01 + b1a4c79 commit 58ca166

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,31 @@
22

33
## Summary
44

5-
<!-- Here goes a general summary of what this release is about -->
5+
This release ships many small improvements and bug fixes to `Quantity`s. It also depends on [channels](https://github.com/frequenz-floss/frequenz-channels-python/) v0.16.0, so users must update the dependency too.
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10-
11-
- `Channels` has been upgraded to version 0.16.0, for information on how to upgrade visit https://github.com/frequenz-floss/frequenz-channels-python/releases/tag/v0.16.0
9+
- `Channels` has been upgraded to version 0.16.0, for information on how to upgrade please read the [channels v0.16.0 release notes](visit https://github.com/frequenz-floss/frequenz-channels-python/releases/tag/v0.16.0).
1210
- `Quantity` objects are no longer hashable. This is because of the pitfalls of hashing `float` values.
1311

1412
## New Features
1513

1614
- Quantities
1715

16+
* Add support for the unary negative operator (negation of a quantity).
1817
* Add `abs()`.
1918
* Add a `isclose()` method on quantities to compare them to other values of the same type. Because `Quantity` types are just wrappers around `float`s, direct comparison might not always be desirable.
2019
* Add `zero()` constructor (which returns a singleton) to easily get a zero value.
2120
* Add multiplication by `Percentage` types.
2221
* Add a new quantity class `Frequency` for frequency values.
22+
* Add a new quantity class `Temperature` for temperature values.
2323

24-
- `FormulaEngine` arithmetics now supports scalar multiplication with floats and addition with Quantities
25-
- Add a new method for streaming average temperature values for the battery pool.
24+
- `FormulaEngine` arithmetics now supports scalar multiplication with `float`s and addition with `Quantity`s.
25+
- Add a new `temperature` method for streaming average temperature values for the battery pool.
2626

2727
## Bug Fixes
2828

2929
- Fix formatting issue for `Quantity` objects with zero values.
30-
- Fix formatting isuse for `Quantity` when the base value is float.inf or float.nan.
30+
- Fix formatting issue for `Quantity` when the base value fulfills `math.isinf()` or `math.isnan()`.
3131
- Fix clamping to 100% for the battery pool SoC scaling calculation.
32-
33-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
32+
- Fix indexing for empty `MovingWindow`s (now it properly raises an `IndexError`).

tests/timeseries/test_moving_window.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,8 @@ async def test_access_window_by_ts_slice() -> None:
114114
async def test_access_empty_window() -> None:
115115
"""Test accessing an empty window, should throw IndexError"""
116116
window, _ = init_moving_window(timedelta(seconds=5))
117-
try:
118-
window[42]
119-
except IndexError as index_error:
120-
assert str(index_error) == "The buffer is empty."
121-
else:
122-
assert False
117+
with pytest.raises(IndexError, match=r"^The buffer is empty\.$"):
118+
_ = window[42]
123119

124120

125121
async def test_window_size() -> None:

0 commit comments

Comments
 (0)