Releases: frequenz-floss/frequenz-dispatch-python
v0.6.0
Dispatch Highlevel Interface Release Notes
Summary
This release introduces a more flexible and powerful mechanism for managing dispatch events with new strategies for merging intervals, enhanced customization options, and better overall alignment with evolving SDK dependencies. It also simplifies actor initialization while maintaining robust support for diverse dispatch scenarios.
Upgrading
A new simplified way to manage actors has been introduced:
Change your code from:
dispatcher = Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
key=key
)
dispatcher.start()
status_receiver = dispatcher.new_running_state_event_receiver("EXAMPLE_TYPE")
managing_actor = ActorDispatcher(
actor_factory=MyActor.new_with_dispatch,
running_status_receiver=status_receiver,
)
await run(managing_actor)
to
async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
key=key
) as dispatcher:
await dispatcher.start_managing(
dispatch_type="EXAMPLE_TYPE",
actor_factory=MyActor.new_with_dispatch, # now async factory!
merge_strategy=MergeByType,
)
await dispatcher
Further changes:
Dispatcher.start
is no longerasync
. Removeawait
when calling it.- Two properties have been replaced by methods that require a type as parameter.
Dispatcher.lifecycle_events
has been replaced by the methodDispatcher.new_lifecycle_events_receiver(self, dispatch_type: str)
.Dispatcher.running_status_change
has been replaced by the methodDispatcher.new_running_state_event_receiver(self, dispatch_type: str, merge_strategy: MergeStrategy)
.
- The managing actor constructor no longer requires the
dispatch_type
parameter. Instead you're expected to pass the type to the new_receiver function. - The
DispatchManagingActor
class has been renamed toDispatchActorsService
.- It's interface has been simplified and now only requires an actor factory and a running status receiver.
- It only starts/stops a single actor at a time now instead of a set of actors.
- Refer to the updated usage example for more information.
DispatchUpdate
was renamed toDispatchInfo
.
New Features
- A new feature "merge strategy" (
MergeByType
,MergeByTypeTarget
) has been added to theDispatcher.new_running_state_event_receiver
method. Using it, you can automatically merge consecutive and overlapping dispatch start/stop events of the same type. E.g. dispatchA
starting at 10:10 and ending at 10:30 and dispatchB
starts at 10:30 until 11:00, with the feature enabled this would in total trigger one start event, one reconfigure event at 10:30 and one stop event at 11:00. - The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1800.
- Actor management with dispatches has been simplified:
Dispatcher.start_managing(dispatch_type, actor_factory, merge_strategy, retry_interval)
to manage your actor for the given type and merge strategy. All you need provide is an actor factory.Dispatcher.stop_managing(dispatch_type)
to stop dispatching for the given type.Dispatcher.is_managed(dispatch_type)
to check if dispatching is active for the given type.- Dispatches that failed to start will now be retried after a delay.
- A new method
Dispatcher.wait_for_initialization()
has been added to wait for all actors to be initialized. - When using
async with Dispatcher(..) as dispatcher
, the dispatcher will first wait for the dispatch service to be initialized before entering the block.
What's Changed
- Bump types-markdown from 3.7.0.20240822 to 3.7.0.20241204 by @dependabot in #91
- Bump the required group across 1 directory with 7 updates by @dependabot in #92
- Interface enhancements by @Marenz in #89
- Merge & unify running state event intervals by @Marenz in #94
- Clean up API a bit by @Marenz in #97
- Fix flakey tests by @Marenz in #99
- Widen the SDK dependency range to support 1.0.0rc1500 by @llucax in #102
- Bump black from 24.10.0 to 25.1.0 by @dependabot in #106
- Bump the required group with 6 updates by @dependabot in #105
- Bump isort from 5.13.2 to 6.0.0 by @dependabot in #107
- Redesign actor service by @Marenz in #103
- Implement merge strategy based on TYPE+TARGET by @Marenz in #98
- Support multiple target actors for one type of dispatch by @Marenz in #104
- Set cross-arch-ci timeout to 8 minutes by @Marenz in #110
- Widen frequenz-sdk dependency to v1.0.0-rc1800 by @ela-kotulska-frequenz in #109
- Bump nox from 2024.10.9 to 2025.2.9 by @dependabot in #112
- Some final preparations by @Marenz in #108
- Rename stop_dispatching to stop_managing in Dispatcher by @Marenz in #115
- Enhancements from the last PR by @Marenz in #114
New Contributors
- @ela-kotulska-frequenz made their first contribution in #109
Full Changelog: v0.5.0...v0.6.0
v0.5.1
Dispatch Highlevel Interface Release Notes
Summary
- The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1600
What's Changed
- Widen the SDK dependency range to support 1.0.0rc1500 by @llucax in #100
- Update release notes for the release by @llucax in #101
Full Changelog: v0.5.0...v0.5.1
v0.5.0
Dispatch Highlevel Interface Release Notes
Summary
Upgrading
- The method
Dispatch.running(type: str)
was replaced with the propertyDispatch.started: bool
. - The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1500
New Features
Bug Fixes
- Fixed a crash when reading a Dispatch with frequency YEARLY.
What's Changed
- Bump setuptools-scm[toml] from 7.1.0 to 8.1.0 by @dependabot in #80
- Update dispatch and sdk dependencies by @Marenz in #83
- Reset release notes by @Marenz in #84
- Bump the required group across 1 directory with 7 updates by @dependabot in #85
- Bump setuptools from 68.1.0 to 75.6.0 by @dependabot in #79
- Remove methods that were moved to client repo by @Marenz in #82
- Add note about SDK dependency change by @Marenz in #88
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Dispatch Highlevel Interface Release Notes
Summary
- Updates lots of dependencies and through those gets a few new features:
start_immediately
when creating dispatches is now supported.http2 keepalive
is now supported and enabled by default.- Some bugfixes from the channels & sdk libraries. are now included.
Upgrading
Dispatch.selector
was renamed toDispatch.target
, theComponentSelector
type was accordingly renamedTargetComponents
New Features
Bug Fixes
- Fixed a crash in the
DispatchManagingActor
when dispatches shared an equal start time.
What's Changed
- Bump the required group with 9 updates by @dependabot in #72
- Bump types-python-dateutil from 2.9.0.20240906 to 2.9.0.20241003 by @dependabot in #73
- Fix crash when dispatches share equal start time by @Marenz in #75
- Update dependencies by @Marenz in #76
Full Changelog: v0.3.4...v0.4.0
v0.3.4
Dispatch Highlevel Interface Release Notes
Summary
This is a hot fix for recurrence not working
What's Changed
Full Changelog: v0.3.3...v0.3.4
v0.3.3
Dispatch Highlevel Interface Release Notes
Summary
frequenz-sdk
dependency has been extended to include version1.0.0-rc1000
.
What's Changed
- Extend
frequenz-sdk
dependency by @daniel-zullo-frequenz in #70
Full Changelog: v0.3.2...v0.3.3
v0.3.2
Dispatch Highlevel Interface Release Notes
Summary
- This fixes a crash when the
YEARLY
frequency is used in a dispatch.
What's Changed
- Bump the required group with 8 updates by @dependabot in #63
- Fix crash when YEARLY is used by @Marenz in #69
Full Changelog: v0.3.1...v0.3.2
v0.3.1
Dispatch Highlevel Interface Release Notes
Summary
Upgrading
Dispatcher.running_state_change
now also sends a message when the duration specified in the dispatch has passed. If no duration is specified, no STOPPED message will be sent.
New Features
- We now provide the
DispatchManagingActor
class, a class to manage actors based on incoming dispatches.
Bug Fixes
What's Changed
- Send stop signal when duration is reached by @Marenz in #53
- Relax frequenz-sdk version constraints by @daniel-zullo-frequenz in #59
- Fix SDK dependency version constraint by @daniel-zullo-frequenz in #60
- Dispatch Managing Actor by @Marenz in #54
- Fix overwritten fix for sdk dependency by @Marenz in #67
- Bump types-python-dateutil from 2.9.0.20240821 to 2.9.0.20240906 by @dependabot in #65
Full Changelog: v0.3.0...v0.3.1
v0.3.0
Dispatch Highlevel Interface Release Notes
Summary
Upgrading
- The dispatch high level interface now depends on
frequenz-sdk
versionv1.0.0-rc900
. - We are now using the version
0.6.0
of the underlyingfrequenz-client-dispatch
client library. - The init parameter of the
Dispatcher
class has been changed to accept aserver_url
instead.
New Features
- Using the new dispatch client, we now have support for pagination in the dispatch list request.
- The new client version also supports streaming, however it is not yet used internally in the high level interface.
Bug Fixes
- Fix documentation cross-linking to the
frequenz-client-dispatch
package.
What's Changed
- Bump the cross-ref object DB version to match the dependency version by @llucax in #42
- Bump the required group with 10 updates by @dependabot in #43
- Update frequenz-SDK to 1.0.0-rc801 by @daniel-zullo-frequenz in #46
- Configure the new label by @llucax in #48
- Bump the required group with 14 updates by @dependabot in #49
- Bump types-python-dateutil from 2.9.0.20240316 to 2.9.0.20240821 by @dependabot in #50
- Update to latest SDK and dispatch-client versions by @Marenz in #51
New Contributors
- @daniel-zullo-frequenz made their first contribution in #46
Full Changelog: v0.2.0...v0.3.0
v0.2.0
Dispatch Highlevel Interface Release Notes
Upgrading
- An API key for authorization must now be passed to the client.
What's Changed
- Reset Release Notes after release by @Marenz in #31
- Bump the required group with 11 updates by @dependabot in #32
- Add key authentication by @Marenz in #34
- Bump brettcannon/check-for-changed-files from 1.2.0 to 1.2.1 by @dependabot in #35
- Bump docker/build-push-action from 5 to 6 by @dependabot in #36
- Bump the required group with 9 updates by @dependabot in #37
- Update to new client by @Marenz in #39
- Update to client v0.5.0 by @Marenz in #40
Full Changelog: v0.1.0...v0.2.0