Releases: frequenz-floss/frequenz-sdk-python
Release list
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
ConfigManagingActornow takes multiple configuration files as input, and the argument was renamed fromconfig_filetoconfig_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
MovingWindownow take all arguments as keyword-only to avoid mistakes. -
The
frequenz-quantitiesdependency was bumped to1.0.0rc3. -
The
ComponentMetricsRequestnow produces a channel name without thestart_dateif thestart_dateisNone. If you are somehow relying on the old behavior, please update your code.
New Features
- The
ConfigManagingActorcan 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_dataclasses with correct type hints. - Implement and standardize logging configuration with the following changes:
- Add
LoggerConfigandLoggingConfigto standardize logging configuration. - Create
LoggingConfigUpdaterto 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
ComponentandConnectionin 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
ComponentMetricsRequestdocumentation 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
Quantityand its sub-classes (Power,Current, etc.) in thefrequenz.sdk.timeseriesmodule with the externalfrequenz-quantitiespackage. Please add the new library as a dependency and adapt your imports if you are using these types. - The
QuantityThas been moved to thefrequenz.sdk.timeseries._base_typesmodule. - The
QuantityTdoesn'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_powerto 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
v1.0.0-rc901
Frequenz Python SDK Release Notes
Bug Fixes
ConfigManagingActor: Fixed an issue where the actor was unable to process events after being restarted.
What's Changed
- Clear release notes by @llucax in #1069
- Create FileWatcher when ConfigManagingActor runs by @daniel-zullo-frequenz in #1074
Full Changelog: v1.0.0-rc900...v1.0.0-rc901
v1.0.0-rc900
Frequenz Python SDK Release Notes
Summary
This release mainly introduces a new feature that allows fallback components to be used in generated formulas, but it also fixes a few bugs and gets rid of betterproto/grpclib and goes back to Google's implementation.
Upgrading
- The
frequenz-client-microgriddependency was bumped to0.5.0. This can cause dependency issues if you are using other API clients and thefrequenz-client-basedependencies don't match.
New Features
- Fallback components are used in generated formulas. If primary components is unavailable, formula will generate metric from fallback components. Fallback formulas are implemented for:
- PVPowerFormula
- ProducerPowerFormula
- BatteryPowerFormula
- ConsumerPowerFormula
- GridPowerFormula
Bug Fixes
-
Allow setting
api_power_request_timeoutinmicrogrid.initialize(). -
Fix an issue where in grid meters could be identified as {pv/ev/battery/chp} meters in some component graph configurations.
What's Changed
- Force
grpclibto be at least 0.4.8rc2 by @llucax in #1012 - Clear release notes by @shsms in #1047
- Merge v1.0.0-rc7xx into v1.x.x by @shsms in #1049
- Allow setting
api_power_request_timeoutinmicrogrid.initialize()by @shsms in #1050 - Distinguish between grid meters and other meters by @shsms in #1052
- Fallback components in generated formulas by @ela-kotulska-frequenz in #1037
- Bump frequenz-repo-config to 0.10.0 by @llucax in #1059
- Make dependabot do minor updates for the microgrid client separately by @llucax in #1060
- Revert "Change receiver limit in mock_resampler" by @ela-kotulska-frequenz in #1061
- Bump the
frequenz-client-microgriddependency to0.5.0by @llucax in #1057 - Remove the redundant
--platform=${TARGETPLATFORM}inDockerfileby @llucax in #1062 - Bump the required group across 1 directory with 14 updates by @dependabot in #1064
- Bump the required group with 3 updates by @dependabot in #1065
- Unpin mkdocs-autorefs and fix multple URLs for warnings by @llucax in #1051
- Bump
frequenz-client-microgridto 0.5.1 by @llucax in #1068 - Bump types-setuptools from 71.1.0.20240726 to 74.0.0.20240831 by @dependabot in #1066
Full Changelog: v1.0.0-rc800...v1.0.0-rc900
v1.0.0-rc801
Frequenz Python SDK Release Notes
Bug Fixes
- Bump the
grpclibdependency to pull a fix for using IPv6 addresses.
What's Changed
- Force
grpclibto be at least 0.4.8rc2 by @llucax in #1012 - Merge v1.0.0-rc7xx into v1.0.0-rc8xx by @shsms in #1048
Full Changelog: v1.0.0-rc800...v1.0.0-rc801
v1.0.0-rc800
Frequenz Python SDK Release Notes
Summary
This release makes some breaking changes to the SDK's public interface aimed at improving clarity and correctness. It also includes several bug fixes in core components like the resampler, the power distributor, and the moving window.
Upgrading
-
The
frequenz.sdk.microgrid.*_poolmethods have been renamed tonew_*_pool, to make it explicit that they create new instances of the pool classes.battery_pool->new_battery_poolev_charger_pool->new_ev_charger_poolpv_pool->new_pv_pool
-
The following component metric streams have been renamed to clarify that they stream per-phase values:
frequenz.sdk.microgrid.voltage->voltage_per_phasegrid.current->grid.current_per_phaseev_charger_pool.current->ev_charger_pool.current_per_phase
-
Passing a
request_timeoutin calls to*_pool.propose_poweris no longer supported. It may be specified at application startup, through the new optionalapi_power_request_timeoutparameter in themicrogrid.initialize()method. -
Power distribution results are no longer available through the
power_statusstreams in the*Pools. They can now be accessed as a stream from a separate propertypower_distribution_results, which is available from all the*Pools. -
The
ConfigManagingActornow usescollections.abc.Mappingas the output sender type. This change indicates that the broadcasted configuration is intended to be read-only. -
The
ConfigManagingActorhas moved fromfrequenz.sdk.actortofrequenz.sdk.config. -
The following core actors are no longer part of the public API:
PowerDistributingActorComponentMetricsResamplingActorDataSourcingActor
-
The following two types which are used for communicating with the data sourcing and resampling actors are also no longer part of the public API:
ComponentMetricIdComponentMetricRequest
-
The
ChannelRegistryis no longer part of the public API. -
The
Resulttypes for the power distribution results are now exposed through thefrequenz.sdk.microgrid.battery_poolmodule.
New Features
- Classes
BoundsandSystemBoundsnow implement the__contains__method, allowing the use of theinoperator to check whether a value falls within the bounds or not.
Enhancements
- The resampler now shows an error message where it is easier to identify the component and metric when it can't find relevant data for the current resampling window.
Bug Fixes
- Fixed a typing issue that occurs in some cases when composing formulas with constants.
- Fixed a bug where sending tasks in the data sourcing actor might not have been awaited.
- Updated the logical meter documentation to reflect the latest changes.
- Fixed a bug in the code examples in the getting-started tutorial.
- Fixed a bug in
ConfigManagingActorthat was not properly comparing the event path to the config file path when the config file is a relative path. - Re-expose
ComponentMetricIdto the docs. - Fixed typing ambiguities when building composite formulas on streaming data.
- Fixed a bug that was causing the
PowerDistributorto exit if power requests to PV inverters or EV chargers timeout. - Fix the handling of canceled tasks in the data sourcing and resampling actor.
- Fix a bug in PV power distribution by excluding inverters that haven't sent any data since startup.
- Prevent stacking of power requests to avoid delays in processing when the power request frequency exceeds the processing time.
- Fixes a bug in the ring buffer in case the updated value is missing and creates a gap in time.
What's Changed
- Clear release notes by @llucax in #978
- Update glossary by @cwasicki in #952
- Rename
microgrid.*_poolconstructors tonew_*_poolby @shsms in #979 - Fix typing for composing constants with formula builders by @shsms in #980
- Filter out irrelevant logs when checking for expected logs by @llucax in #983
- Properly keep references and await for concurrent tasks by @llucax in #984
- Add contains function to Bounds and SystemBounds by @0o111 in #962
- Cleanup
*Reportclasses as simple protocols with only methods by @shsms in #981 - Improve naming for per-phase component metric streams by @shsms in #987
- Fix battery manager string representation by @llucax in #989
- Update logical meter documentation by @matthias-wende-frequenz in #986
- Remove dependency to polars by @llucax in #991
- Bump brettcannon/check-for-changed-files from 1.2.0 to 1.2.1 by @dependabot in #994
- Bump docker/build-push-action from 5 to 6 by @dependabot in #993
- Bump the required group with 9 updates by @dependabot in #995
- Remove
request_timeoutparameter frompropose_powermethods by @shsms in #1000 - Remove power distribution results from
Reportobjects by @shsms in #998 - Remove extra comma from tutorial docs by @shsms in #1004
- Switch to the
LatestValueCachefrom the channels package by @shsms in #1002 - Fix ConfigManagingActor to handle relative paths by @daniel-zullo-frequenz in #1005
- Fix microgrid API URL in example by @llucax in #1006
- Use a more descriptive channel name for the resampler by @llucax in #1007
- Update sender type in ConfigManagingActor by @daniel-zullo-frequenz in #1010
- Expose
ComponentMetricIdin the public API by @llucax in #990 - Fix FormulaEngine typing by @shsms in #1011
- Use solipsism, time-machine in
*Pooltests by @shsms in #1013 - Fix PV power distribution by @daniel-zullo-frequenz in #1015
- Bump types-setuptools from 70.1.0.20240627 to 71.1.0.20240726 by @dependabot in #1019
- Fixes to the PowerDistributingActor by @shsms in #1020
- Make actor example loop forever by @llucax in #1029
- Handle
CancelledErrors properly by @llucax in #1027 - Fix PV inverters power distribution by @daniel-zullo-frequenz in #1028
- Prevent stacking of power requests by @daniel-zullo-frequenz in #1023
- Fix gap in ring buffer when updating missing values by @cwasicki in #1034
- Fix exit-on-timeout issue in PowerDistributor by @shsms in #1035
- Fix typo and improve formatting by @llucax in #1033
- Cleanup the
actorpackage by @shsms in #1031 - Fix grammar in release notes by @shsms in #1040
- Fix glossary links and restrict
mkdocs-autorefsupdates by @llucax in #1043 - Merge v1.0.0-rc6xx into v1.x.x by @llucax in #1042
- Prepare release notes for v1.0.0-rc800 by @shsms in #1046
Full Changelog: v1.0.0rc700...v1.0.0-rc800
v1.0.0-rc603
Frequenz Python SDK Release Notes
Bug Fixes
-
Fixes a bug in the ring buffer in case the updated value is missing and creates a gap in time.
-
Fixed a bug that was causing the
PowerDistributorto exit if power requests to PV inverters or EV chargers timeout.
What's Changed
- Fix gap in ring buffer when updating missing values by @cwasicki in #1034
- Fix exit-on-timeout issue in PowerDistributor by @shsms in #1035
Full Changelog: v1.0.0-rc602...v1.0.0-rc603
v1.0.0-rc602
Frequenz Python SDK Release Notes
Bug Fixes
- Fix PV power distribution excluding inverters that haven't sent any data since the application started.
What's Changed
- Fix PV power distribution by @daniel-zullo-frequenz in #1015
Full Changelog: v1.0.0-rc601...v1.0.0-rc602
v1.0.0rc701
Frequenz Python SDK Release Notes
Bug Fixes
- Bump the
grpclibdependency to pull a fix for using IPv6 addresses.
What's Changed
Full Changelog: v1.0.0rc700...v1.0.0rc701
v1.0.0rc700
Frequenz Python SDK Release Notes
Upgrading
-
The
frequenz-client-microgriddependency was bumped to v0.4.0. If you are using the client directly in your code, you will need to upgrade too. -
Calls to
microgrid.*_poolmethods now always need to specified a priority value, corresponding to the requirements/priority of the actor making the call. -
The
microgrid.*_poolmethods would only accept keyword arguments from now on. -
The
microgrid.initialize()method now takes aserver_urlinstead of ahostandport.The following format is expected:
grpc://hostname{:port}{?ssl=ssl}, where the port should be an int between0and65535(defaulting to9090) andsslshould be a boolean (defaulting tofalse). For example:grpc://localhostorgrpc://localhost:1090?ssl=true.The default was also removed, so you always need to specify the server URL.
This applies to the
ConnectionManageras well, which also now doesn't expose thehostandportattributes, only theserver_url. If you need to extract the host or port from theserver_url, you can use the standard Pythonurllib.parse.urlparse()function. -
The
Configclass was removed and theConfigManagingActornow sends a plain dictionary rather than aConfigobject.
New Features
- Calls to
microgrid.*_poolmethods now accept an optionalset_operating_pointparameter, for setting an operating point for the other actors. This would shift the target power by the operating point before actually applying it to the components.
Bug Fixes
- When the PowerDistributor receives a zero power request for PV inverters, it now correctly sets zero power to the inverters, and no longer crashes.
What's Changed
- Clear release notes by @llucax in #931
- Always require a priority argument in calls to
microgrid.*_poolmethods by @shsms in #944 - Set zero power for PV inverters not neccessary to reach target power by @shsms in #946
- Update protobuf requirement from <5,>=4.21.6 to >=4.21.6,<6 by @dependabot in #936
- Code quality improvements in the
DataPipelineand*Poolclasses by @shsms in #948 - Bump types-protobuf from 4.24.0.20240129 to 5.26.0.20240422 by @dependabot in #937
- Add support for Python 3.12 by @daniel-zullo-frequenz in #947
- Miscelaneous improvements and fixes by @llucax in #953
- Bump types-setuptools from 69.5.0.20240423 to 70.0.0.20240524 by @dependabot in #959
- Improve code comment in power distribution to PV inverters by @shsms in #960
- Support power requests from shifting actors in the PowerManager by @shsms in #957
- Upgrade to microgrid client v0.4.0 by @llucax in #955
- Bump the required group across 1 directory with 8 updates by @dependabot in #964
- Update ConfigManagingActor to send a dictionary by @daniel-zullo-frequenz in #969
- Don't sleep on PowerDistributor startup by @shsms in #971
- Stop using a deprecated way to replace the event loop in tests by @llucax in #976
- Rename parameter
in_shifting_group→set_operating_pointby @shsms in #970 - Make some minor improvements for LastValueCache by @llucax in #974
- Prepare release notes for v1.0.0rc700 by @llucax in #977
Full Changelog: v1.0.0-rc601...v1.0.0rc700