Releases: frequenz-floss/frequenz-sdk-python
v1.0.0-rc2101
Frequenz Python SDK Release Notes
Summary
This release provides an experimental, opt-in, time-jumps resilient resampler, that can be enabled by using the new ResamplerConfig2
class.
Upgrading
- The resampling function now takes plain
float
s as values instead ofQuantity
objects. frequenz.sdk.timeseries.UNIX_EPOCH
was removed, usefrequenz.core.datetime.UNIX_EPOCH
instead.
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 newResamplerConfig2
class accepts aWallClockTimerConfig
to fine-tune the wall clock timer behavior, if necessary.Example usage:
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)), )
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.
What's Changed
- Bump the minor group across 1 directory with 6 updates by @dependabot[bot] in #1240
- Improve resampler structure and performance by @llucax in #1242
- Bump pytest-asyncio from 0.26.0 to 1.0.0 by @dependabot[bot] in #1244
- Bump the patch group with 6 updates by @dependabot[bot] in #1243
- Remove obsolete
hpack
logging adjustment from examples by @Copilot in #1247 - Bump async-solipsism from 0.7 to 0.8 by @dependabot[bot] in #1257
- Bump pytest-asyncio from 1.0.0 to 1.1.0 by @dependabot[bot] in #1256
- Bump types-setuptools from 80.9.0.20250529 to 80.9.0.20250801 by @dependabot[bot] in #1255
- Bump types-markdown from 3.8.0.20250415 to 3.8.0.20250708 by @dependabot[bot] in #1253
- Bump mkdocs-material from 9.6.15 to 9.6.16 in the patch group by @dependabot[bot] in #1250
- Bump the compatible group with 2 updates by @dependabot[bot] in #1258
- Bump types-protobuf from 6.30.2.20250516 to 6.30.2.20250703 by @dependabot[bot] in #1254
- Bump the minor group with 2 updates by @dependabot[bot] in #1251
- Remove unncessary use of
tzdata
in tests by @denini08 in #1261 - Add a wall clock attached timer by @llucax in #1249
- Bump mkdocstrings[python] from 0.29.1 to 0.30.0 in the mkdocstrings group by @dependabot[bot] in #1252
- Fix log when multiple batteries are attached to an inverter by @shsms in #1262
- Bump types-protobuf from 6.30.2.20250703 to 6.30.2.20250822 by @dependabot[bot] in #1272
- Bump mkdocstrings-python from 1.16.12 to 1.18.2 in the mkdocstrings group by @dependabot[bot] in #1267
- Bump the patch group with 3 updates by @dependabot[bot] in #1265
- Bump hypothesis from 6.136.8 to 6.138.13 in the minor group by @dependabot[bot] in #1266
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #1264
- Bump pydoclint from 0.6.6 to 0.7.1 by @dependabot[bot] in #1268
- Bump setuptools-scm[toml] from 8.3.1 to 9.2.0 by @dependabot[bot] in #1271
- Bump actions/download-artifact from 4 to 5 in the artifacts group by @dependabot[bot] in #1263
- Bump types-markdown from 3.8.0.20250708 to 3.8.0.20250809 by @dependabot[bot] in #1270
- Bump types-setuptools from 80.9.0.20250801 to 80.9.0.20250822 by @dependabot[bot] in #1269
- Prepare release notes for the release by @llucax in #1273
New Contributors
Full Changelog: v1.0.0-rc2100...v1.0.0-rc2101
v1.0.0-rc2100
Frequenz Python SDK Release Notes
Summary
Upgrading
- The microgrid client dependency has been updated to version 0.9.0
New Features
Bug Fixes
What's Changed
- Update release notes by @ela-kotulska-frequenz in #1233
- Update microgrid client by @Marenz in #1230
- Attempt to fix ci-gets-stuck in shutdown loop by @Marenz in #1237
- Fix test typing by @florian-wagner-frequenz in #1235
- CI cleanup fixes by @Marenz in #1239
New Contributors
- @florian-wagner-frequenz made their first contribution in #1235
Full Changelog: v1.0.0-rc2001...v1.0.0-rc2100
v1.0.0-rc2002
Frequenz Python SDK Release Notes
Summary
Upgrading
- The microgrid client dependency has been updated to version 0.9.0
New Features
Bug Fixes
What's Changed
- Update release notes by @ela-kotulska-frequenz in #1233
- Update microgrid client by @Marenz in #1230
- Attempt to fix ci-gets-stuck in shutdown loop by @Marenz in #1237
- Fix test typing by @florian-wagner-frequenz in #1235
- CI cleanup fixes by @Marenz in #1239
New Contributors
- @florian-wagner-frequenz made their first contribution in #1235
Full Changelog: v1.0.0-rc2001...v1.0.0-rc2002
v1.0.0-rc2001
Frequenz Python SDK Release Notes
Bug Fixes
- Fix TypeError raised by BatteryManager when distributing power
What's Changed
- Reset release notes by @ela-kotulska-frequenz in #1225
- Bump types-protobuf from 5.29.1.20250403 to 6.30.2.20250516 by @dependabot in #1229
- Bump the patch group with 6 updates by @dependabot in #1226
- Bug fix: Print Power as str instead of decimal by @ela-kotulska-frequenz in #1232
Full Changelog: v1.0.0-rc2000...v1.0.0-rc2001
v1.0.0-rc2000
Frequenz Python SDK Release Notes
New Features
- The SDK now officially support Python 3.13.
Bug Fixes
- Fixed issue where actors would restart instead of stopping when exceptions occurred during cancellation. Actors now properly stop and surface the unhandled exception.
What's Changed
- Clear release notes by @shsms in #1220
- Update tests to support latest time-machine by @shsms in #1221
- Add missing PV and EV components to datapipeline's
stop
method by @shsms in #1222 - Add support for Python 3.13 by @llucax in #1219
- Fix issue with actor restarting instead of stopping by @ela-kotulska-frequenz in #1223
- Update release notes by @ela-kotulska-frequenz in #1224
Full Changelog: v1.0.0-rc1900...v1.0.0-rc2000
v1.0.0-rc1900
Frequenz Python SDK Release Notes
Summary
This release introduces a number of breaking changes in the config manager, the new ComponentId
/MicrogridId
types and the numpy
version update. It also includes bug-fixes to the component graph and power management.
Upgrading
-
Includes a major update of the numpy dependency to v2.x.
-
The logging configuration was changed, and now the logger name needs to be specified explicitly (the configuration key was used as the name before). This is to be compatible with configuration generated by the UI, which doesn't quote sub-key properly.
-
Before:
[logging.loggers."frequenz.sdk.config"] level = "DEBUG"
-
Now:
[logging.loggers.frequenz_config] name = "frequenz.sdk.config" level = "DEBUG"
-
-
The logging configuration now uses a separate class for the root logger configuration:
RootLoggerConfig
.-
Before:
LoggingConfig(root_logger=LoggerConfig(level="ERROR"))
-
Now:
LoggingConfig(root_logger=RootLoggerConfig(level="ERROR"))
-
-
The SDK now depends on the
frequenz-client-microgrid
v0.7.x series. The main change is now all component and microgrid IDs need to be passed using the wrapper classesComponentId
/MicrogridId
instead ofint
.
Bug Fixes
-
The power manager used to just forgot components when all proposals to them are withdrawn, leaving them at their last set power values. This has been fixed by getting the power manager to set the components to their default powers, based on the component category (according to the table below), as the last step.
component category default power Battery 0.0 PV Minimum power (aka max production power) EV Chargers Maximum power (aka max consumption power) -
PV Pool instances can now be created in sites without any PV. This allows for writing generic code that works for all locations, that depends on the PV power formula, for example.
-
Success/PartialFailure
results fromPVPool.power_distribution_results
now report correctsucceeded_power
values. -
The
find_first_descendant_component
method in the component graph was allowing non-root components to be used as the root component during traversal. This was leading to confusing behaviour when the root component couldn't be identified deterministically. For example, if the root category was specified as a meter, it could start traversing from a different meter each time. It is no-longer possible to specify a root category anymore and it always traverses from theGRID
component.
What's Changed
- Clear release notes by @shsms in #1203
- Bump setuptools from 78.1.0 to 80.1.0 by @dependabot in #1209
- Update marshmallow requirement from <4,>=3.19.0 to >=3.19.0,<5 by @dependabot in #1210
- Bump types-setuptools from 78.1.0.20250329 to 80.0.0.20250429 by @dependabot in #1211
- Bump the patch group with 3 updates by @dependabot in #1206
- Bump pydoclint from 0.6.5 to 0.6.6 by @dependabot in #1208
- Reset components to default power when all proposals are withdrawn by @shsms in #1212
- Bump the minor group across 1 directory with 7 updates by @dependabot in #1213
- Update numpy dependency to v2 by @cwasicki in #1160
- Update the logging config actor configuration format by @llucax in #1204
- Allow create PVPool instances in locations without PV by @shsms in #1215
- Use
Power
instead offloat
in PowerDistributor's battery manager by @shsms in #1214 - Ensure root component is as close as possible to the grid component by @shsms in #1216
- Upgrade to microgrid client v0.7 by @llucax in #1182
- Fix
succeeded_power
calculation in PV power distribution by @shsms in #1217 - Prepare for v1.0.0-rc1900 by @shsms in #1218
Full Changelog: v1.0.0-rc1802...v1.0.0-rc1900
v1.0.0-rc1802
Frequenz Python SDK Release Notes
Bug Fixes
- The additive
ShiftingMatryoshka
algorithm was made for batteries, but got set as the default algorithm for PV and EV chargers. This is now reversed and PV and EV chargers are back to using the originalMatryoshka
algorithm.
What's Changed
- Clear release notes by @shsms in #1201
- Use the additive
ShiftingMatryoshka
algorithm only for batteries by @shsms in #1202
Full Changelog: v1.0.0-rc1801...v1.0.0-rc1802
v1.0.0-rc1801
Frequenz Python SDK Release Notes
Bug Fixes
- Fixes a bug where battery pool metrics would stop for one actor when another actor managing the same components stops its pool.
What's Changed
- Clear release notes by @shsms in #1198
- Don't stop pools by @shsms in #1199
- Prepare for release v1.0.0-rc1801 by @shsms in #1200
Full Changelog: v1.0.0-rc1800...v1.0.0-rc1801
v1.0.0-rc1800
Frequenz Python SDK Release Notes
Upgrading
- The
microgrid.new_*_pool
methods no longer accept aset_operating_point
parameter. - The power manager now uses a new algorithm described here.
Bug Fixes
- Fix
MetricFetcher
leaks when a requested metric fetcher already existed.
What's Changed
- Bump nox from 2024.10.9 to 2025.2.9 by @dependabot in #1173
- Bump types-protobuf from 5.29.1.20241207 to 5.29.1.20250208 by @dependabot in #1174
- Update build status badge by @llucax in #1171
- Avoid creating dangling
MetricFetcher
s by @llucax in #1179 - Fix ordering issues with
set
s ofint
s by @llucax in #1177 - Improve docs and tests and fix minor issues by @llucax in #1178
- Clear release notes by @shsms in #1181
- Implement the
ShiftingMatryoshka
algorithm for the PowerManager by @shsms in #1146 - Update to repo-config v0.13 by @llucax in #1186
- Bump the patch group with 5 updates by @dependabot in #1187
- Bump the minor group with 4 updates by @dependabot in #1188
- Bump pydoclint from 0.6.0 to 0.6.5 by @dependabot in #1189
- Bump types-setuptools from 75.8.0.20250110 to 78.1.0.20250329 by @dependabot in #1191
- Bump pytest-asyncio from 0.25.3 to 0.26.0 by @dependabot in #1192
- Bump types-markdown from 3.7.0.20241204 to 3.7.0.20250322 by @dependabot in #1190
- Bump setuptools from 75.8.0 to 78.1.0 by @dependabot in #1193
- Bump types-protobuf from 5.29.1.20250208 to 5.29.1.20250403 by @dependabot in #1194
- Log power allocations per actor in the PowerManager by @shsms in #1196
- Prepare for release v1.0.0-rc1800 by @shsms in #1197
Full Changelog: v1.0.0-rc1700...v1.0.0-rc1800
v1.0.0-rc1700
Frequenz Python SDK Release Notes
Summary
New Features
-
Add a
stop()
method to theFormulaEngine
. Now it is possible to stop custom formulas. -
Stop fallback formulas when primary formula starts working again.
Bug Fixes
-
Fixed a bug with formulas raising exception when stopped.
-
Fixed a bug that raised
CancelledError
when actor was started withfrequenz.sdk.actor.run
and stopped. -
Stop catching
BaseException
infrequenz.sdk.actor.run
. OnlyCancelledError
andException
are caught now.
What's Changed
- Stop formula engine by @ela-kotulska-frequenz in #1165
- Clear release notes by @shsms in #1167
- Stop raising CancelledError when actor is cancelled by @ela-kotulska-frequenz in #1166
- mypy: Check all files by default by @llucax in #1164
- Prepare release notes for rc1700 by @llucax in #1170
Full Changelog: v1.0.0-rc1600...v1.0.0-rc1700