|
2 | 2 |
|
3 | 3 | ## Summary |
4 | 4 |
|
5 | | -The most notable changes are the addition of `microgrid.grid` and `microgrid.frequency()`, as the many improvements to the `MovingWindow`. |
| 5 | +<!-- Here goes a general summary of what this release is about --> |
6 | 6 |
|
7 | 7 | ## Upgrading |
8 | 8 |
|
9 | | -- The battery pool metric methods no longer return `None` when no batteries are available. Instead, the value of the `Sample` or `PowerMetric` is set to `None`. |
10 | | - |
11 | | -- The power distribution `Result` is now a union of all different types of results rather than a base class. This means we can now also use `match` to check for result types instead of only using `isinstance()`. The following example shows how `Result` can be used for matching power distribution results: |
12 | | - |
13 | | - ```python |
14 | | - from typing import assert_never |
15 | | - result: Result = some_operation() |
16 | | - match result: |
17 | | - case Success() as success: |
18 | | - print(f"Power request was successful: {success}") |
19 | | - case PartialFailure() as partial_failure: |
20 | | - print(f"Power request was partially successful: {partial_failure}") |
21 | | - case OutOfBounds() as out_of_bounds: |
22 | | - print(f"Power request was out of bounds: {out_of_bounds}") |
23 | | - case Error() as error: |
24 | | - print(f"Power request failed: {error}") |
25 | | - case _ as unreachable: |
26 | | - assert_never(unreachable) |
27 | | - ``` |
28 | | - |
29 | | -- `Averager` was removed from `FormulaEngine`. |
| 9 | +<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with --> |
30 | 10 |
|
31 | 11 | ## New Features |
32 | 12 |
|
33 | | -- Calling `microgrid.initialize()` now also initializes the microgrid's grid connection point as a singleton object of a newly added type `Grid`. This object can be obtained by calling `microgrid.grid.get()`. This object exposes the max current that can course through the grid connection point, which is useful for the power distribution algorithm. The max current is provided by the Microgrid API, and can be obtained by calling `microgrid.grid.get().fuse.max_current`. |
34 | | - |
35 | | - Note that a microgrid is allowed to have zero or one grid connection point. Microgrids configured as islands will have zero grid connection points, and microgrids configured as grid-connected will have one grid connection point. |
36 | | - |
37 | | -- A new method `microgrid.frequeny()` was added to allow easy access to the current frequency of the grid. |
38 | | - |
39 | | -- A new class `Fuse` has been added to represent fuses. This class has a member variable `max_current` which represents the maximum current that can course through the fuse. If the current flowing through a fuse is greater than this limit, then the fuse will break the circuit. |
40 | | - |
41 | | -- `MovingWindow` and `OrderedRingBuffer`: |
42 | | - - NaN values are treated as missing when gaps are determined in the `OrderedRingBuffer`. |
43 | | - - Provide access to `capacity` (maximum number of elements) in `MovingWindow`. |
44 | | - - Methods to retrieve oldest and newest timestamp of valid samples are added to both. |
45 | | - - `MovingWindow` exposes underlying buffers `window` method. |
46 | | - - `len(window)` and `len(buffer)` should be replaced with `window.count_valid()` and `buffer.count_valid()`, respectively. |
47 | | - - `OrderedRingBuffer.window`: |
48 | | - - By default returns a copy. |
49 | | - - Can also return a view if the window contains `None` values and if `force_copy` is set to `True`. |
50 | | - |
51 | | -- Now when printing `FormulaEngine` for debugging purposes the the formula will be shown in infix notation, which should be easier to read. |
52 | | - |
53 | | -- The CI now runs cross-arch tests on `arm64` architectures. |
54 | | - |
55 | | -- The `min` and `max` functions in the `FormulaEngine` are now public. Note that the same functions have been public in the builder. |
| 13 | +<!-- Here goes the main new features and examples or instructions on how to use them --> |
56 | 14 |
|
57 | 15 | ## Bug Fixes |
58 | 16 |
|
59 | | -- `OrderedRingBuffer.window`: |
60 | | - - Fixed `force_copy` option for specific case. |
61 | | - - Removed buggy enforcement of copies when None values in queried window. |
62 | | - - Fixed behavior for start equals end case. |
| 17 | +<!-- Here goes notable bug fixes that are worth a special mention or explanation --> |
0 commit comments