v0.20.0
Release Notes
Summary
The main feature in the release is the high-level interface. Now all base pipeline actors are created automatically when the SDK is initialized, and the wrapper classes can be accessed directly via frequenz.sdk.microgrid
: logical_meter()
, battery_pool()
and ev_charger_pool()
.
Upgrading
-
Battery power is no longer available through the
LogicalMeter
, but through theBatteryPool
(#338)battery_power_receiver = microgrid.battery_pool().power.new_receiver()
-
Formulas composition has changed (#327)
- Receivers from formulas are no longer composable.
- Formula composition is now done by composing FormulaEngine instances.
- Automatic formulas from the logical meter and *pools, are now properties, and return
FormulaEngine
instances, which can be composed further, or can provide a receiver to fetch values.
grid_power_receiver = microgrid.logical_meter().grid_power.new_receiver() self._inverter_power = ( microgrid.logical_meter().pv_power + microgrid.battery_pool().power ).build("inverter_power") inverter_power_receiver = self._inverter_power.new_receiver()
-
Update
BatteryStatus
to mark battery with unknown capacity as not working (#263) -
The channels dependency was updated to v0.14.0 (#292)
-
Some properties for
PowerDistributingActor
results were renamed to be more consistent betweenSuccess
andPartialFailure
:- The
Success.used_batteries
property was renamed tosucceeded_batteries
. - The
PartialFailure.success_batteries
property was renamed tosucceeded_batteries
. - The
succeed_power
property was renamed tosucceeded_power
for bothSuccess
andPartialFailure
.
- The
-
MovingWindow
-
The class is now publicly available in the
frequenz.sdk.timeseries
package. -
Accept the
size
parameter astimedelta
instead ofint
(#269).This change allows users to define the time span of the moving window more intuitively, representing the duration over which samples will be stored.
-
The input data will be resampled if a
resampler_config
is passed (#269).This allows controlling the granularity of the samples to be stored in the underlying buffer.
Note that the parameter
sampling_period
has been renamed toinput_sampling_period
to better distinguish it from the sampling period parameter in theresampler_config
. -
Rename the constructor argument
window_alignment
toalign_to
and change the default toUNIX_EPOCH
. This is to make it more consistent with theResamplerConfig
.
-
-
Resampler
-
The
ResamplerConfig
class is now publicly available in thefrequenz.sdk.timeseries
package. -
The
ResamplerConfig
now takes the resampling period as atimedelta
. The configuration was renamed fromresampling_period_s
toresampling_period
accordingly. -
The
SourceProperties
of the resampler now uses atimedelta
for the input sampling period. The attribute was renamed fromsampling_period_s
tosampling_period
accordingly. -
The periods are now aligned to the
UNIX_EPOCH
by default.To use the old behaviour (aligning to the time the resampler was created), pass
align_to=None
to theResamplerConfig
.
-
New Features
-
The core data-pipeline actors are now created automatically (#270).
This eliminates a lot of boiler plate code and makes it much simpler to deploy apps.
For example:
async def run(): await microgrid.initialize( host=HOST, port=PORT, resampler_config=ResamplerConfig(resampling_period_s=1.0) ) grid_power = microgrid.logical_meter().grid_power()
-
The
Result
class (and subclasses) for thePowerDistributingActor
are nowdataclass
es, so logging them will produce a more detailed output. -
The
Resampler
can now can align the resampling period to an arbitrarydatetime
.This can be configured via the new
align_to
option in theResamplerConfig
. By default the resampling period is aligned to theUNIX_EPOCH
.
Bug Fixes
-
Change
PowerDistributor
to use all batteries when none are working (#258) -
Update the ordered ring buffer used by the
MovingWindow
to fix thelen()
function so that it returns a value equal to or greater than zero, as expected (#274)
What's Changed
- Power Distributing: Documentation enhancements by @mathias-baumann-frequenz in #257
- Clean release notes by @ela-kotulska-frequenz in #271
- Check battery capacity in BatteryStatus by @ela-kotulska-frequenz in #263
- Use all batteries when none are working in PowerDistributor by @ela-kotulska-frequenz in #258
- Configure dependabot to automated version updates by @daniel-zullo-frequenz in #268
- Bump pylint from 2.17.0 to 2.17.1 by @dependabot in #288
- Bump mypy from 1.0.1 to 1.1.1 by @dependabot in #286
- Bump actions/labeler from 4.0.1 to 4.0.3 by @dependabot in #279
- Bump pytest from 7.2.1 to 7.2.2 by @dependabot in #287
- Bump black from 23.1.0 to 23.3.0 by @dependabot in #284
- Update channels dependency to v0.14.0 by @mathias-baumann-frequenz in #295
- Various small fixes by @mathias-baumann-frequenz in #277
- Fix len() of the OrderedRingBuffer by @daniel-zullo-frequenz in #274
- Bump pytest-asyncio from 0.20.3 to 0.21.0 by @dependabot in #281
- Bump mkdocstrings[python] from 0.19.1 to 0.20.0 by @dependabot in #283
- Update networkx requirement from <3,>=2.8 to >=2.8,<4 by @dependabot in #282
- Bump mkdocs-material from 8.5.11 to 9.1.5 by @dependabot in #298
- Add a
DataPipeline
implementation by @shsms in #270 - Bump pylint from 2.17.1 to 2.17.2 by @dependabot in #300
- Use a bigger request receiver buffer size in data pipeline actors by @shsms in #302
- Refactor power distributor's
Result
s by @leandro-lucarella-frequenz in #305 - Bump mkdocstrings[python] from 0.20.0 to 0.21.1 by @dependabot in #308
- Add
component_data
method to EVChargerPool by @shsms in #266 - benchmark data sourcing actor by @mathias-baumann-frequenz in #211
- Add ringbuffer memory benchmark by @mathias-baumann-frequenz in #278
- Update MovingWindow to add resampler by @daniel-zullo-frequenz in #272
- Bump mkdocs-material from 9.1.5 to 9.1.6 by @dependabot in #312
- Add a
EVChargerPool.set_bounds
method for setting current bounds by @shsms in #297 - Bump mkdocstrings[python] from 0.21.1 to 0.21.2 by @dependabot in #309
- Bump pytest from 7.2.2 to 7.3.0 by @dependabot in #313
- Bump mypy from 1.1.1 to 1.2.0 by @dependabot in #310
- Add BatteryPool and PowerDistributingActor to the DataPipeline by @sahas-subramanian-frequenz in #317
- Expose BatteryPool and PowerDistributingHandle from
sdk.microgrid
by @sahas-subramanian-frequenz in #323 - Fix ring buffer benchmarks by @daniel-zullo-frequenz in #324
- Make interface for serializing a ringbuffer more flexible. by @mathias-baumann-frequenz in #326
- Ringbuffer: Moved files into a package by @mathias-baumann-frequenz in #329
- Update
BatteryPool
tests, examples to usemicrogrid.battery_pool()
by @sahas-subramanian-frequenz in #336 - Bump pytest from 7.3.0 to 7.3.1 by @dependabot in #339
- Make the resampler use timedelta for periods by @leandro-lucarella-frequenz in #334
- Bump frequenz-floss/setup-git-user from 1 to 2 by @dependabot in #345
- Make FormulaEngine instances composable, instead of FormulaReceivers by @sahas-subramanian-frequenz in #327
- Add
power
formula toBatteryPool
by @sahas-subramanian-frequenz in #338 - Add an option to align resampling windows by @leandro-lucarella-frequenz in #335
- Increase sample_rate in some formula tests to reduce flakiness by @sahas-subramanian-frequenz in #351
- Bump mkdocs-material from 9.1.6 to 9.1.7 by @dependabot in #353
- Bump nox from 2022.11.21 to 2023.4.22 by @dependabot in #354
- Rename custom loggers to
_logger
by @sahas-subramanian-frequenz in #347 - Rename alignment arguments to
align_to
and make them default toUNIX_EPOCH
by @leandro-lucarella-frequenz in #349 - Make the
MovingWindow
public and remove public mentions to theRingBuffer
by @leandro-lucarella-frequenz in #355 - Bump mkdocs-material from 9.1.7 to 9.1.8 by @dependabot in #357
- Bump pylint from 2.17.2 to 2.17.3 by @dependabot in #356
New Contributors
- @dependabot made their first contribution in #288
Full Changelog: v0.19.0...v0.20.0