Releases: frequenz-floss/frequenz-sdk-python
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
v1.0.0-rc1600
Frequenz Python SDK Release Notes
New Features
- The
MovingWindow
now has an asyncwait_for_samples
method that waits for a given number of samples to become available in the moving window and then returns.
Bug Fixes
-
Fixed a bug that was preventing power proposals to go through if there once existed some proposals with overlapping component IDs, even if the old proposals have expired.
-
Fixed a bug that was causing formulas to fallback to CHPs, when the CHP meters didn't have data. CHPs are not supported in the data sourcing actor and in the client, so we can't fallback to CHPs.
What's Changed
- Clear release notes by @llucax in #1154
- Drop empty Matryoshka buckets by @shsms in #1155
- Rewrite CI: use reusable actions, native arm and faster PR testing by @llucax in #1153
- Bump black from 24.10.0 to 25.1.0 by @dependabot in #1158
- Bump the required group with 7 updates by @dependabot in #1156
- Bump isort from 5.13.2 to 6.0.0 by @dependabot in #1157
- Add a
wait_for_samples
method to theMovingWindow
by @shsms in #1159 - Don't fallback to CHPs by @shsms in #1161
- Prepare release notes for rc1600 by @llucax in #1163
Full Changelog: v1.0.0-rc1500...v1.0.0-rc1600
v1.0.0-rc1500
Frequenz Python SDK Release Notes
Summary
This release includes a new ConfigManager
class to simplify managing the configuration, and ships other improvements and fixes to the config system in general.
Upgrading
-
frequenz.sdk.config
-
LoggingConfigUpdater
- Renamed to
LoggingConfigUpdatingActor
to follow the actor naming convention. - The actor must now be constructed using a
ConfigManager
instead of a receiver. - Make all arguments to the constructor keyword-only, except for the
config_manager
argument. - If the configuration is removed, the actor will now load back the default configuration.
- Renamed to
-
LoggingConfig
- The
load()
method was removed. Please usefrequenz.sdk.config.load_config()
instead. - The class is now a standard
dataclass
instead of amarshmallow_dataclass
. - The class is now immutable.
- The constructor now accepts only keyword arguments.
- The
-
LoggerConfig
- The class is now a standard
dataclass
instead of amarshmallow_dataclass
. - The class is now immutable.
- The constructor now accepts only keyword arguments.
- The class is now a standard
-
load_config()
:- The
base_schema
argument is now keyword-only and defaults toBaseConfigSchema
(and because of this, it usesunknown=EXCLUDE
by default). - The arguments forwarded to
marshmallow.Schema.load()
now must be passed explicitly via themarshmallow_load_kwargs
argument, as adict
, to improve the type-checking. - Will now raise a
ValueError
ifunknown
is set toINCLUDE
inmarshmallow_load_kwargs
.
- The
-
ConfigManagingActor
: Raise aValueError
if theconfig_files
argument an empty sequence.
-
New Features
-
frequenz.sdk.config
-
Logging was improved in general.
-
Added documentation and user guide.
-
LoggingConfigUpdatingActor
- Added a new
name
argument to the constructor to be able to override the actor's name.
- Added a new
-
ConfigManager
: Added a class to simplify managing the configuration. It takes care of instantiating the config actors and provides a convenient method for creating receivers with a lot of common functionality. -
BaseConfigSchema
: Added amarshmallow
baseSchema
that includes custom fields forfrequenz-quantities
. In the futute more commonly used fields might be added. -
wait_for_first()
: Added a function to make it easy to wait for the first configuration to be received with a timeout. -
ConfigManagingActor
: Allow passing a single configuration file.
-
Bug Fixes
-
Fix a bug in
BackgroundService
where it won't try toself.cancel()
andawait self.wait()
if there are no internal tasks. This prevented to properly implement custom stop logic without having to redefine thestop()
method too. -
Fix a bug where if a string was passed to the
ConfigManagingActor
it would be interpreted as a sequence of 1 character strings. -
Remove a confusing log message in the power distributing actor.
-
Close all receivers owned by a *pool when stopping the pool.
What's Changed
- Bump the required group with 4 updates by @dependabot in #1123
- Clear release notes by @llucax in #1122
- Reorganize the
config
module by @llucax in #1126 - Improve the logging config actor by @llucax in #1127
- Make
LoggerConfig
andLoggingConfig
frozen and keyword-only by @llucax in #1128 - Add load_shedding example by @Marenz in #1131
- Improve logging and API of the
config
module by @llucax in #1133 - Fix cross-arch CI tests by @llucax in #1141
- Bump types-markdown from 3.7.0.20240822 to 3.7.0.20241204 by @dependabot in #1138
- Bump types-setuptools from 75.6.0.20241126 to 75.6.0.20241223 by @dependabot in #1139
- Don't allow checking if
None
is within the bounds by @llucax in #1140 - Revamp config management by @llucax in #1134
- Bump the required group across 1 directory with 8 updates by @dependabot in #1143
- Move default
unknown=EXCLUDE
toBaseConfigSchema
by @llucax in #1149 - Remove "Checking battery" log message by @shsms in #1151
- Disable warn on overflow in config channel receivers by @llucax in #1152
- Close all *pool's receivers when stopping the pool by @shsms in #1150
Full Changelog: v1.0.0-rc1400...v1.0.0-rc1500
v1.0.0-rc1400
Frequenz Python SDK Release Notes
Summary
This is a minor release with just a few bug fixes but also one breaking change in the ConfigManagingActor
.
Upgrading
- The
ConfigManagingActor
now only reacts toCREATE
andMODIFY
events.DELETE
is not supported anymore and are ignored. - Remove the
event_types
argument from theConfigManagingActor
constructor.
Bug Fixes
- Fix bugs with
ConfigManagingActor
:- Raising unhandled exceptions when any file in config directory was deleted.
- Raising unhandled exception if not all config files exist.
- Eliminate recursive actor crashes when all config files were missing.
What's Changed
- Fix
ConfigManagingActor
raising unhandled exceptions when file doesn't exist by @ela-kotulska-frequenz in #1116 - Prepare release notes for v1.0.0-rc1400 by @llucax in #1121
Full Changelog: v1.0.0-rc1302...v1.0.0-rc1400
v1.0.0-rc1302
Frequenz Python SDK Release Notes
Improvements
- Many tasks, senders and receivers now have proper names for easier debugging.
- The resample log was improved to show more details.
- The
Sample
class now has a nice__str__
representation.
Bug Fixes
- Fix a bug in the resampler that could end up with an IndexError: list index out of range exception when a new resampler was added while awaiting the existing resampler to finish resampling.
What's Changed
- Fix IndexError: list index out of range in resampler by @llucax in #1117
- Small debugging enhancements by @Marenz in #1119
Full Changelog: v1.0.0-rc1301...v1.0.0-rc1302
v1.0.0-rc1301
Frequenz Python SDK Release Notes
Bug Fixes
- Fix bug with
LoggingConfigUpdater
not updating root logger level. - The
frequenz-quantities
dependency requirement was widened to allow any v1.x version (it was pinned to1.0.0rc3
before).
What's Changed
- Widen the quantities version requirement by @llucax in #1110
- Update to repo-config v0.11.0 by @llucax in #1111
- Bump types-setuptools from 74.0.0.20240831 to 75.5.0.20241122 by @dependabot in #1114
- Fix ConfigLoggingUpdater not changing root logging level by @ela-kotulska-frequenz in #1112
- Bump the required group with 3 updates by @dependabot in #1113
- Update release notes for release 1.0.0-rc1301 by @llucax in #1115
Full Changelog: v1.0.0-rc1300...v1.0.0-rc1301
v1.0.0-rc1300
Frequenz Python SDK Release Notes
Summary
Upgrading
New Features
- The
MicrogridApiClient
was updated to the latest version.
Bug Fixes
What's Changed
- Reset release notes by @ela-kotulska-frequenz in #1108
- Update microgrid client to latest version by @Marenz in #1109
Full Changelog: v1.0.0-rc1200...v1.0.0-rc1300
v1.0.0-rc1200
Frequenz Python SDK Release Notes
Upgrading
New Features
frequenz.sdk.config.load_config()
can now use a base schema to customize even further how data is loaded.
What's Changed
- Clear release notes by @llucax in #1100
- Check that load_config raises ValidationError if config is None by @ela-kotulska-frequenz in #1102
- Allow passing a
base_schema
toload_config()
by @llucax in #1103 - Restore support for marshmallow_dataclass by @ela-kotulska-frequenz in #1106
- Prepare release notes for next release by @ela-kotulska-frequenz in #1107
Full Changelog: v1.0.0-rc1100...v1.0.0-rc1200
v1.0.0-rc1100
Frequenz Python SDK Release Notes
Summary
This release focus on improving the config management, but also introduces other minor improvements and fixes an important bug.
Upgrading
-
The
ConfigManagingActor
now takes multiple configuration files as input, and the argument was renamed fromconfig_file
toconfig_files
. If you are using this actor, please update your code. For example:# Old actor = ConfigManagingActor(config_file="config.toml") # New actor = ConfigManagingActor(config_files=["config.toml"])
-
The
MovingWindow
now take all arguments as keyword-only to avoid mistakes. -
The
frequenz-quantities
dependency was bumped to1.0.0rc3
. -
The
ComponentMetricsRequest
now produces a channel name without thestart_date
if thestart_date
isNone
. If you are somehow relying on the old behavior, please update your code.
New Features
- The
ConfigManagingActor
can now take multiple configuration files as input, allowing to override default configurations with custom configurations. - A new
frequenz.sdk.config.load_config()
function is available to load configurations usingmarshmallow_dataclass
es with correct type hints. - Implement and standardize logging configuration with the following changes:
- Add
LoggerConfig
andLoggingConfig
to standardize logging configuration. - Create
LoggingConfigUpdater
to handle runtime config updates. - Support individual log level settings for each module.
- Add
Bug Fixes
- Fixes an issue where PV and EV system bounds were not available to the Power Manager sometimes when requested after startup.
What's Changed
- Clear release notes by @shsms in #1090
- config: Allow reading from multiple files by @llucax in #1091
- Store the original
Component
andConnection
in the component graph by @llucax in #1093 - Bump the required group across 1 directory with 12 updates by @dependabot in #1094
- Implement and standardize logging configuration via config file by @ela-kotulska-frequenz in #1095
- Bump dependency to 1.0.0rc3 by @ela-kotulska-frequenz in #1096
- Add a function to load configurations with correct type hints by @llucax in #1097
- Improve
ComponentMetricsRequest
documentation by @llucax in #1092 - Update bound-streaming channels to resend latest to new receivers by @shsms in #1098
- Prepare release notes for rc1100 by @llucax in #1099
Full Changelog: v1.0.0-rc1000...v1.0.0-rc1100
v1.0.0-rc1000
Frequenz Python SDK Release Notes
Summary
The SDK starts using the frequenz-quantities
package with this release.
A new method for streaming reactive power at the grid connection point has been added, and the ConfigManagingActor
has been improved.
Upgrading
- Replace
Quantity
and its sub-classes (Power
,Current
, etc.) in thefrequenz.sdk.timeseries
module with the externalfrequenz-quantities
package. Please add the new library as a dependency and adapt your imports if you are using these types. - The
QuantityT
has been moved to thefrequenz.sdk.timeseries._base_types
module. - The
QuantityT
doesn't include itself (QuantityT
) anymore.
New Features
-
ConfigManagingActor
: The file polling mechanism is now forced by default. Two new parameters have been added:force_polling
: Whether to force file polling to check for changes. Default isTrue
.polling_interval
: The interval to check for changes. Only relevant if polling is enabled. Default is 1 second.
-
Add a new method
microgrid.grid().reactive_power
to stream reactive power at the grid connection point.
Bug Fixes
- Many long running async tasks including metric streamers in the BatteryPool now have automatic recovery in case of exceptions.
What's Changed
- Prepare release notes for rc901 by @llucax in #1076
- Clear release notes by @llucax in #1077
- Add polling parameters to ConfigManagingActor by @daniel-zullo-frequenz in #1082
- Remove redundant check in BatteryPool tests by @ela-kotulska-frequenz in #1085
- Improve resiliency of long-running async tasks by @shsms in #1081
- Clean some duplicated and unused code by @llucax in #1088
- Use frequenz-quantities library by @ela-kotulska-frequenz in #1087
- Implement GridReactivePowerFormula by @ela-kotulska-frequenz in #1086
- Prepare for v1.0.0-rc1000 by @shsms in #1089
Full Changelog: v1.0.0-rc901...v1.0.0-rc1000