Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,16 @@

## Summary

This release provides an experimental, opt-in, time-jumps resilient resampler, that can be enabled by using the new `ResamplerConfig2` class.
<!-- Here goes a general summary of what this release is about -->

## Upgrading

* The resampling function now takes plain `float`s as values instead of `Quantity` objects.
* `frequenz.sdk.timeseries.UNIX_EPOCH` was removed, use [`frequenz.core.datetime.UNIX_EPOCH`](https://frequenz-floss.github.io/frequenz-core-python/latest/reference/frequenz/core/datetime/#frequenz.core.datetime.UNIX_EPOCH) instead.
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

## New Features

- A new configuration mode was added to the resampler (and thus the resampling actor and microgrid high-level interface). When passing a new `ResamplerConfig2` instance to the resampler, it will use a wall clock timer instead of a monotonic clock timer. This timer adjustes sleeps to account for drifts in the monotonic clock, and thus allows for more accurate resampling in cases where the monotonic clock drifts away from the wall clock. The monotonic clock timer option will be deprecated in the future, as it is not really suitable for resampling. The new `ResamplerConfig2` class accepts a `WallClockTimerConfig` to fine-tune the wall clock timer behavior, if necessary.

Example usage:

```python
from frequenz.sdk import microgrid
from frequenz.sdk.timeseries import ResamplerConfig2

await microgrid.initialize(
MICROGRID_API_URL,
# Just replace the old `ResamplerConfig` with the new `ResamplerConfig2`
resampler_config=ResamplerConfig2(resampling_period=timedelta(seconds=1.0)),
)
```
<!-- Here goes the main new features and examples or instructions on how to use them -->

## Bug Fixes

- When using the new wall clock timer in the resampmler, it will now resync to the system time if it drifts away for more than a resample period, and do dynamic adjustments to the timer if the monotonic clock has a small drift compared to the wall clock.

- A power distributor logging issue is fixed, that was causing the power for multiple batteries connected to the same inverter to be reported incorrectly.
- The log level for when components are transitioning to a `WORKING` state is lowered to `INFO`, and the log message has been improved.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def _handle_ev_data(self, ev_data: EVChargerData) -> ComponentStatusEnum:

if self._is_working(ev_data):
if self._last_status == ComponentStatusEnum.NOT_WORKING:
_logger.warning(
"EV charger %s is in WORKING state.",
_logger.info(
"EV charger %s: state changed to WORKING.",
self._component_id,
)
return ComponentStatusEnum.WORKING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def _handle_pv_inverter_data(self, pv_data: InverterData) -> ComponentStatusEnum

if self._is_working(pv_data):
if self._last_status == ComponentStatusEnum.NOT_WORKING:
_logger.warning(
"PV inverter %s is in WORKING state.",
_logger.info(
"PV inverter %s: state changed to WORKING.",
self._component_id,
)
return ComponentStatusEnum.WORKING
Expand Down