Releases: frequenz-floss/frequenz-sdk-python
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.*_pool
methods have been renamed tonew_*_pool
, to make it explicit that they create new instances of the pool classes.battery_pool
->new_battery_pool
ev_charger_pool
->new_ev_charger_pool
pv_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_phase
grid.current
->grid.current_per_phase
ev_charger_pool.current
->ev_charger_pool.current_per_phase
-
Passing a
request_timeout
in calls to*_pool.propose_power
is no longer supported. It may be specified at application startup, through the new optionalapi_power_request_timeout
parameter in themicrogrid.initialize()
method. -
Power distribution results are no longer available through the
power_status
streams in the*Pool
s. They can now be accessed as a stream from a separate propertypower_distribution_results
, which is available from all the*Pool
s. -
The
ConfigManagingActor
now usescollections.abc.Mapping
as the output sender type. This change indicates that the broadcasted configuration is intended to be read-only. -
The
ConfigManagingActor
has moved fromfrequenz.sdk.actor
tofrequenz.sdk.config
. -
The following core actors are no longer part of the public API:
PowerDistributingActor
ComponentMetricsResamplingActor
DataSourcingActor
-
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:
ComponentMetricId
ComponentMetricRequest
-
The
ChannelRegistry
is no longer part of the public API. -
The
Result
types for the power distribution results are now exposed through thefrequenz.sdk.microgrid.battery_pool
module.
New Features
- Classes
Bounds
andSystemBounds
now implement the__contains__
method, allowing the use of thein
operator 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
ConfigManagingActor
that was not properly comparing the event path to the config file path when the config file is a relative path. - Re-expose
ComponentMetricId
to the docs. - Fixed typing ambiguities when building composite formulas on streaming data.
- Fixed a bug that was causing the
PowerDistributor
to 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.*_pool
constructors tonew_*_pool
by @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
*Report
classes 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_timeout
parameter frompropose_power
methods by @shsms in #1000 - Remove power distribution results from
Report
objects by @shsms in #998 - Remove extra comma from tutorial docs by @shsms in #1004
- Switch to the
LatestValueCache
from 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
ComponentMetricId
in the public API by @llucax in #990 - Fix FormulaEngine typing by @shsms in #1011
- Use solipsism, time-machine in
*Pool
tests 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
CancelledError
s 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
actor
package by @shsms in #1031 - Fix grammar in release notes by @shsms in #1040
- Fix glossary links and restrict
mkdocs-autorefs
updates 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
PowerDistributor
to 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
grpclib
dependency 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-microgrid
dependency 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.*_pool
methods now always need to specified a priority value, corresponding to the requirements/priority of the actor making the call. -
The
microgrid.*_pool
methods would only accept keyword arguments from now on. -
The
microgrid.initialize()
method now takes aserver_url
instead of ahost
andport
.The following format is expected:
grpc://hostname{:port}{?ssl=ssl}
, where the port should be an int between0
and65535
(defaulting to9090
) andssl
should be a boolean (defaulting tofalse
). For example:grpc://localhost
orgrpc://localhost:1090?ssl=true
.The default was also removed, so you always need to specify the server URL.
This applies to the
ConnectionManager
as well, which also now doesn't expose thehost
andport
attributes, 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
Config
class was removed and theConfigManagingActor
now sends a plain dictionary rather than aConfig
object.
New Features
- Calls to
microgrid.*_pool
methods now accept an optionalset_operating_point
parameter, 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.*_pool
methods 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
DataPipeline
and*Pool
classes 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_point
by @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
v1.0.0-rc601
Frequenz Python SDK Release Notes
In this release we have changed the versioning scheme for pre-releases. rc601
means rc6.1
, which we can't use due to limitations on the Python version specification. From now on rc versions will have 3 digits, so next rc will be rc700
, and then rc800
etc, so we have some room to make patch releases in case it is necessary (which will be named rc701
, rc702
, etc.).
Bug Fixes
- Fix getting reactive power from meters, inverters and EV chargers.
What's Changed
- Clear release notes by @llucax in #617
- Initialize a
Grid
object with a givenFuse
limit by @tiyash-basu-frequenz in #610 - Upgrade to repo-config v0.6.1 by @llucax in #620
- Bump polars from 0.18.15 to 0.19.1 by @dependabot in #626
- Bump the optional group with 4 updates by @dependabot in #634
- Bump types-setuptools from 68.1.0.0 to 68.1.0.1 by @dependabot in #635
- Don't return
None
from battery pool methods by @stefan-brus-frequenz in #612 - Clarify documentation of BatteryPool soc and capacity methods by @stefan-brus-frequenz in #637
- Document class and module attributes by @daniel-zullo-frequenz in #618
- Add microgrid.frequency() by @Marenz in #579
- Treat NaN as gap in ring buffer by @cwasicki in #641
- Replace obsolete types by @daniel-zullo-frequenz in #644
- Move "fake_time" fixture to conftest.py by @stefan-brus-frequenz in #639
- Improve formula formatting to use infix notation by @christianparpart in #613
- Merge v0.25.1 by @llucax in #652
- Add a glossary to the documentation by @llucax in #647
- Add capacity, oldest and newest timestamp to moving window by @cwasicki in #598
- [ci] Add tests for non-native architectures by @tiyash-basu-frequenz in #622
- Bump actions/checkout from 3 to 4 by @dependabot in #655
- ci: Fix publishing of documentation on push by @llucax in #657
- Add a job to join the
nox
matrix jobs by @llucax in #661 - Add more formula tests for min and max functions by @matthias-wende-frequenz in #623
- Fixes on copy behavior in ring buffer window method by @cwasicki in #638
- Drop formula step Averager by @christianparpart in #645
- Refactor power distribution Result by @daniel-zullo-frequenz in #659
- Adjust the glossary to 80 columns by @llucax in #666
- Replace len magic with count_valid method in ring buffer and moving window by @cwasicki in #664
- Prepare release notes for the 1.0.0-rc1 release by @llucax in #674
- Clear the release notes by @llucax in #675
- Bump the optional group with 9 updates by @dependabot in #683
- Bump docker/setup-buildx-action from 2 to 3 by @dependabot in #680
- Bump docker/setup-qemu-action from 2 to 3 by @dependabot in #681
- Bump docker/build-push-action from 4 to 5 by @dependabot in #682
- Add mkdocs-macros plugin by @llucax in #667
- docs: Add an introduction to actors by @llucax in #679
- mkdocs: Fix numbered code annotations by @llucax in #684
- Add getting started tutorial and tutorial section by @matthias-wende-frequenz in #656
- Remove setitem magic from ring buffer by @cwasicki in #670
- Allow using macros in docstrings by @llucax in #687
- Rename datetime_to_index to to_internal_index by @cwasicki in #686
- Fix mermaid diagrams custom renderer by @llucax in #690
- Update obsolete comment about networkx-stubs by @daniel-zullo-frequenz in #685
- Move Actors documentation to the
actor
module by @llucax in #688 - Don't use generics unnecessarily by @llucax in #698
- Improve Actors documentation by @llucax in #689
- Increment port in microgrid API client tests by @llucax in #699
- Support int indices and slice index behavior in ring buffer and moving window by @cwasicki in #668
- Fix single element access for moving window by @cwasicki in #672
- Rename
Introduction
toUser Guide
and moveTutorials
next to it by @llucax in #701 - Bump types-pytz from 2023.3.1.0 to 2023.3.1.1 by @dependabot in #695
- Bump types-protobuf from 4.24.0.1 to 4.24.0.2 by @dependabot in #696
- Bump types-pyyaml from 6.0.12.11 to 6.0.12.12 by @dependabot in #694
- PowerDistributing: Add support for n:m relations in invs:bats by @Marenz in #660
- Fix bug in how failed batteries are tracked in PowerDistributor by @shsms in #705
- Update pydantic to v2.3 by @daniel-zullo-frequenz in #703
- Add option to impute missing values in window method for moving window by @cwasicki in #669
- Bump pydoclint from 0.3.2 to 0.3.3 by @dependabot in #710
- Implement the PowerManagingActor by @shsms in #692
- Prepare release notes for v1.0.0-rc2 by @llucax in #723
- Remove support for
include_broken_batteries
in control commands by @shsms in #713 - Improve code reusability/modularity in PowerDistributor by @Marenz in #717
- Document microgrid concepts from an SDK perspective by @shsms in #722
- Documentation for the FormulaEngine by @shsms in #731
- Bump types-protobuf from 4.24.0.2 to 4.24.0.3 by @dependabot in #734
- Expose
ComponentGraph
from its own module by @shsms in #738 - Document methods for creating data pipeline interface objects by @shsms in #739
- Add a restart delay to actors to avoid spam-restarting of buggy actors by @christianparpart in #741
- Rename datetime to timestamp variables by @daniel-zullo-frequenz in #742
- Redesign access to migrogrid.grid() by @christianparpart in #707
- Set
resent_latest=True
forBatteryPool.power_status
's channels by @shsms in #743 - Clean warnings in tests by @daniel-zullo-frequenz in #744
- Add consumtion and production operations to Formula Engine by @matthias-wende-frequenz in #746
- Use exclusion bounds while calculating target powers in PowerManager by @shsms in #755
- Remove the consumption and ...
v1.0.0-rc6
Frequenz Python SDK Release Notes
Summary
The most notable features for this release is the addition of the PVPool
(exposed via microgrid.pv_pool()
), which can be used to manage PV arrays as a single entity and the EVChargerPool
(microgrid.ev_charger_pool()
) learning to manage power for the whole pool (before it could only be used to control chargers individually).
Another notable change is the microgrid API client being moved to its own repository.
Upgrading
-
The SDK is now using the microgrid API client from
frequenz-client-microgrid
. You should update your code if you are using the microgrid API client directly. -
The minimum required
frequenz-channels
version is nowv1.0.0-rc1
. -
The set of battery IDs managed by a battery pool are now available through
BatteryPool.component_ids
, and no longer throughBatteryPool.battery_ids
. This is done to have a consistent interface with other*Pool
s. -
The
maxsize
parameter in calls toBatteryPool.{soc/capacity/temperature}.new_receiver()
methods have now been renamed tolimit
, to be consistent with the channels repository. -
Support for per-component interaction in
EVChargerPool
has been removed. Please use the newpropose_power()
method to manage power for the whole pool. If you still need to manage power of chargers individually, you can create one pool per charger. -
PV power is now available from
microgrid.pv_pool().power
, and no longer frommicrogrid.logical_meter().pv_power
.
New Features
-
EVChargerPool
/microgrid.ev_charger_pool()
: Newpropose_power
andpower_status
methods have been added, similar to theBatteryPool
. These method interface with thePowerManager
andPowerDistributor
, which currently uses a first-come-first-serve algorithm to distribute power to EVs. -
A PV pool (
PVPool
/microgrid.pv_pool()
) was added, withpropose_power
,power_status
andpower
methods similar to Battery and EV pools. -
The microgrid API client now exposes the reactive power for inverters, meters and EV chargers.
Enhancements
-
Warning messages are logged when multiple instances of
*Pool
s are created for the same set of batteries, with the same priority values. -
A warning message will now be logged if no relevant samples are found in a component for resampling.
Bug Fixes
-
A bug was fixed where the grid fuse was not created properly and would end up with a
max_current
with typefloat
instead ofCurrent
. -
BatteryPool.propose_discharge
now converts power values to the passive-sign convention. Earlier it was not doing this and that was causing it to charge instead of discharge. -
Fix a bug that was causing the power managing actor to crash and restart when cleaning up old proposals.
What's Changed
- Clear release notes by @llucax in #617
- Initialize a
Grid
object with a givenFuse
limit by @tiyash-basu-frequenz in #610 - Upgrade to repo-config v0.6.1 by @llucax in #620
- Bump polars from 0.18.15 to 0.19.1 by @dependabot in #626
- Bump the optional group with 4 updates by @dependabot in #634
- Bump types-setuptools from 68.1.0.0 to 68.1.0.1 by @dependabot in #635
- Don't return
None
from battery pool methods by @stefan-brus-frequenz in #612 - Clarify documentation of BatteryPool soc and capacity methods by @stefan-brus-frequenz in #637
- Document class and module attributes by @daniel-zullo-frequenz in #618
- Add microgrid.frequency() by @Marenz in #579
- Treat NaN as gap in ring buffer by @cwasicki in #641
- Replace obsolete types by @daniel-zullo-frequenz in #644
- Move "fake_time" fixture to conftest.py by @stefan-brus-frequenz in #639
- Improve formula formatting to use infix notation by @christianparpart in #613
- Merge v0.25.1 by @llucax in #652
- Add a glossary to the documentation by @llucax in #647
- Add capacity, oldest and newest timestamp to moving window by @cwasicki in #598
- [ci] Add tests for non-native architectures by @tiyash-basu-frequenz in #622
- Bump actions/checkout from 3 to 4 by @dependabot in #655
- ci: Fix publishing of documentation on push by @llucax in #657
- Add a job to join the
nox
matrix jobs by @llucax in #661 - Add more formula tests for min and max functions by @matthias-wende-frequenz in #623
- Fixes on copy behavior in ring buffer window method by @cwasicki in #638
- Drop formula step Averager by @christianparpart in #645
- Refactor power distribution Result by @daniel-zullo-frequenz in #659
- Adjust the glossary to 80 columns by @llucax in #666
- Replace len magic with count_valid method in ring buffer and moving window by @cwasicki in #664
- Prepare release notes for the 1.0.0-rc1 release by @llucax in #674
- Clear the release notes by @llucax in #675
- Bump the optional group with 9 updates by @dependabot in #683
- Bump docker/setup-buildx-action from 2 to 3 by @dependabot in #680
- Bump docker/setup-qemu-action from 2 to 3 by @dependabot in #681
- Bump docker/build-push-action from 4 to 5 by @dependabot in #682
- Add mkdocs-macros plugin by @llucax in #667
- docs: Add an introduction to actors by @llucax in #679
- mkdocs: Fix numbered code annotations by @llucax in #684
- Add getting started tutorial and tutorial section by @matthias-wende-frequenz in #656
- Remove setitem magic from ring buffer by @cwasicki in #670
- Allow using macros in docstrings by @llucax in #687
- Rename datetime_to_index to to_internal_index by @cwasicki in #686
- Fix mermaid diagrams custom renderer by @llucax in #690
- Update obsolete comment about networkx-stubs by @daniel-zullo-frequenz in #685
- Move Actors documentation to the
actor
module by @llucax in #688 - Don't use generics unnecessarily by @llucax in #698
- Improve Actors documentation by @llucax in #689
- Increment port in microgrid API client tests by @llucax in #699
- Support int indices and slice index behavior in ring buffer and moving window by @cwasicki in #668
- Fix single element access for moving window by @cwasicki in #672
- Rename
Introduction
toUser Guide
and moveTutorials
next to it by @llucax in #701 - Bump types-pytz from 2023.3.1.0 to 2023.3.1.1 by @dependabot in #695
- Bump types-protobuf from 4.24.0.1 to 4.24.0.2 by @dependabot in #696
- Bump types-pyyaml from 6.0.12.11 to 6.0.12.12 by @dependabot in #694
- PowerDistributing: Add support for n:m relations in invs:bats by @Marenz in #660
- Fix bug in how failed batteries are tracked in PowerDistributor by @shsms in #705
- Update pydantic to v2.3 by @daniel-zullo-frequenz in #703
- Add option to impute missing values in window method for moving windo...
v1.0.0-rc5
Frequenz Python SDK Release Notes
Summary
This is a minor non-breaking release that adds new features and fixes a few bug.
New Features
- Allow multiplying and dividing any
Quantity
by afloat
. This just scales theQuantity
value. - Allow dividing any
Quantity
by another quaintity of the same type. This just returns a ration between both quantities. - The battery pool
power
method now supports scenarios where one or more inverters can have multiple batteries connected to it and one or more batteries can have multiple inverters connected to it.
Bug Fixes
- Fix grid current formula generator to add the operator
+
to the engine only when the component category is handled. - Fix bug where sometimes the
base_value
of aQuantity
could be of a different type thanfloat
.
What's Changed
- Clear release notes by @llucax in #871
- Fetch and stream 3-phase power by @daniel-zullo-frequenz in #847
- Remove remaining traces of darglint by @llucax in #873
- Make sure
base_value
is alwaysfloat
by @llucax in #874 - Remove the last reference to darglint by @llucax in #877
- Mock resampler: Improve variable names by @llucax in #879
- Allow multiplying
Quantity
byfloat
by @llucax in #875 - Remove unnecessary send adapter by @llucax in #878
- Bump actions/{up,down}load-artifact from 3 to 4 by @dependabot in #833
- Allow all quantities division by
float | Self
by @llucax in #876 - Cleanup and modularization of Power Manager, Power Distributor and DataPipeline by @shsms in #881
- More updates for n:m support - battery pool's power formula by @Marenz in #730
- Prepare release notes for 1.0.0-rc5 by @llucax in #884
Full Changelog: v1.0.0-rc4...v1.0.0-rc5
v1.0.0-rc4
Frequenz Python SDK Release Notes
Summary
This release represents 3 months of work so it includes a lot of changes. Most of them are (breaking) API changes, in the hopes to make a more consistent and easier to use SDK 1.0. There are also quite a few bug fixes and a couple of new features.
Upgrading
-
The
BatteryPool.power_status
method now streams objects of typeBatteryPoolReport
, replacing the previousReport
objects. -
Channels
has been upgraded to version 1.0.0b2, for information on how to upgrade please read Channels release notes. -
In
BatteryPoolReport.distribution_result
,- the following fields have been renamed:
Result.succeeded_batteries
→Result.succeeded_components
Result.failed_batteries
→Result.failed_components
Request.batteries
→Request.component_ids
- and the following fields are now type-hinted as
collections.abc.Set
, to clearly indicate that they are read-only:Result.succeeded_components
Result.failed_components
- the following fields have been renamed:
-
The
Fuse
class has been moved to thefrequenz.sdk.timeseries
module. -
microgrid.grid()
-
A
Grid
object is always instantiated now, even if the microgrid is not connected to the grid (islanded microgrids). -
The rated current of the grid fuse is set to
Current.zero()
in case of islanded microgrids. -
The grid fuse is set to
None
when the grid connection component metadata lacks information about the fuse. -
Grid power and current metrics were moved from
microgrid.logical_meter()
tomicrogrid.grid()
.Previously,
logical_meter = microgrid.logical_meter() grid_power_recv = logical_meter.grid_power.new_receiver() grid_current_recv = logical_meter.grid_current.new_receiver()
Now,
grid = microgrid.grid() grid_power_recv = grid.power.new_receiver() grid_current_recv = grid.current.new_receiver()
-
-
Consumer and producer power formulas were moved from
microgrid.logical_meter()
tomicrogrid.consumer()
andmicrogrid.producer()
, respectively.Previously,
logical_meter = microgrid.logical_meter() consumer_power_recv = logical_meter.consumer_power.new_receiver() producer_power_recv = logical_meter.producer_power.new_receiver()
Now,
consumer_power_recv = microgrid.consumer().power.new_receiver() producer_power_recv = microgrid.producer().power.new_receiver()
-
The
ComponentGraph.components()
parameterscomponent_id
andcomponent_category
were renamed tocomponent_ids
andcomponent_categories
, respectively. -
The
GridFrequency.component
property was renamed toGridFrequency.source
-
The
microgrid.frequency()
method no longer supports passing thecomponent
parameter. Instead the best component is automatically selected. -
The
actor.ChannelRegistry
was rewritten to be type-aware and just a container of channels. You now need to provide the type of message that will be contained by the channel and use theget_or_create()
method to get a channel and thestop_and_remove()
method to stop and remove a channel. Once you get a channel you can create new senders and receivers, or set channel options, as usual. Please read the docs for a full description, but in general this:r = registry.new_receiver(name) s = registry.new_sender(name)
Should be replaced by:
r = registry.get_or_create(T, name).new_receiver() s = registry.get_or_create(T, name).new_sender()
-
The
ReceiverFetcher
interface was slightly changed to makemaxsize
a keyword-only argument. This is to make it compatible with theBroadcast
channel, so it can be considered aReceiverFetcher
.
New Features
-
A new method
microgrid.voltage()
was added to allow easy access to the phase-to-neutral 3-phase voltage of the microgrid. -
The
actor.ChannelRegistry
is now type-aware. -
A new class method
Quantity.from_string()
has been added to allow the creation ofQuantity
objects from strings.
Bug Fixes
-
0W power requests are now not adjusted to exclusion bounds by the
PowerManager
andPowerDistributor
, and are sent over to the microgrid API directly. -
microgrid.frequency()
/GridFrequency
:- Fix sent samples to use
Frequency
objects instead of rawQuantity
. - Handle
None
values in the received samples properly. - Convert
nan
values in the received samples toNone
.
- Fix sent samples to use
-
The resampler now properly handles sending zero values.
A bug made the resampler interpret zero values as
None
when generating new samples, so if the result of the resampling is zero, the resampler would just produceNone
values. -
The PowerManager no longer holds on to proposals from dead actors forever. If an actor hasn't sent a new proposal in 60 seconds, the available proposal from that actor is dropped.
-
Fix
Quantity.__format__()
sometimes skipping the number for very small values. -
Not strictly a bug fix, but the microgrid API version was bumped to v0.15.3, which indirectly bumps the common API dependency to v0.5.x, so the SDK can be compatible with other APIs using a newer version of the common API.
Downstream projects that require a
frequenz-api-common
v0.5.x and want to ensure proper dependency resolution should update their minimum SDK version to this release.
What's Changed
- Clear release notes by @llucax in #777
- Make
PowerManagingActor
more modular and generic by @shsms in #773 - Fix type hint errors in microgrid client by @daniel-zullo-frequenz in #778
- Use custom loggers for each module by @daniel-zullo-frequenz in #780
- Bump types-protobuf from 4.24.0.3 to 4.24.0.4 by @dependabot in #749
- Modularize status tracking for pools of components in the power distributing actor by @shsms in #779
- Generalize PowerDistributingActor by @shsms in #786
- Move Fuse to timeseries module by @daniel-zullo-frequenz in #781
- Move grid power and current metrics to Grid by @daniel-zullo-frequenz in #758
- Bump frequenz-channels from 0.16 to 1.0.0b2 by @christianparpart in #764
- Rename
ComponentGraph.components()
parameters to be plural by @Marenz in #791 - Update some tests to use time machine by @matthias-wende-frequenz in #798
- Un-Peekable-ification of the PowerDistributingActor by @shsms in #800
- Pass through 0W requests to the microgrid API independent of exclusion bounds by @shsms in #801
- Update
frequency()
to no longer have parameters by @Marenz in #788 - Fix frequency sending
Quantity
by @Marenz in #804 - Fix the resampler handling of output zeros by @llucax in #811
- Fetch and stream 3-phase voltage by @daniel-zullo-frequenz in #815
- Speedup tests by lowering the actors restart delay by @llucax in #828
- Bump actions/setup-python from 4 to 5 by @dependabot in #834
- Add missing type hints to instance members by @llucax in #809
- Fix bug in
GridFrequency
quantity conversion by @llucax in #807 - Improve (and fix some) test finalization by @llucax in #838
- Make the registry type-aware by @llucax in #830
- Improve BatteryPool's SoC accuracy at the edges by @shsms in #843
- Some component status cleanup by @shsms in #839
- Drop old propsals from the PowerManager by @shsms in #845
- Improvements to EVChargerData coming from the microgrid API by @shsms in #848
- Use a sentinel in
LatestValueCache
to denote if the cache is empty by @shsms in #846 - Move consumer and producer formulas out from logical meter by @daniel-zullo-frequenz in #799
- Parse Quantity Strings by @Marenz in #824
- Bump frequenz-api-microgrid to 0.15.3 by @llucax in #855
- Bump the optional group with 14 updates by @dependabot in #837
- Bump types-protobuf from 4.24.0.4 to 4.24.0.20240129 by @dependabot in #867
- Bump flake8 from 6.1.0 to 7.0.0 by @dependabot in #860
- Bump setuptools re...
v0.25.2
Frequenz Python SDK Release Notes
Bug Fixes
-
The resampler now properly handles sending zero values.
A bug made the resampler interpret zero values as
None
when generating new samples, so if the result of the resampling is zero, the resampler would just produceNone
values.
What's Changed
- Reset release notes by @matthias-wende-frequenz in #653
- Fix the resampler handling of output zeros by @llucax in #812
Full Changelog: v0.25.1...v0.25.2