@@ -83,13 +83,16 @@ def __init__(
8383 self ,
8484 resampler_config : ResamplerConfig ,
8585 api_power_request_timeout : timedelta = timedelta (seconds = 5.0 ),
86+ battery_power_manager_algorithm : PowerManagerAlgorithm = PowerManagerAlgorithm .SHIFTING_MATRYOSHKA , # noqa: E501
8687 ) -> None :
8788 """Create a `DataPipeline` instance.
8889
8990 Args:
9091 resampler_config: Config to pass on to the resampler.
9192 api_power_request_timeout: Timeout to use when making power requests to
9293 the microgrid API.
94+ battery_power_manager_algorithm: The power manager algorithm to use for
95+ batteries.
9396 """
9497 self ._resampler_config : ResamplerConfig = resampler_config
9598
@@ -103,7 +106,7 @@ def __init__(
103106 self ._battery_power_wrapper = PowerWrapper (
104107 self ._channel_registry ,
105108 api_power_request_timeout = api_power_request_timeout ,
106- power_manager_algorithm = PowerManagerAlgorithm . SHIFTING_MATRYOSHKA ,
109+ power_manager_algorithm = battery_power_manager_algorithm ,
107110 default_power = DefaultPower .ZERO ,
108111 component_class = Battery ,
109112 )
@@ -514,6 +517,7 @@ async def _stop(self) -> None:
514517async def initialize (
515518 resampler_config : ResamplerConfig ,
516519 api_power_request_timeout : timedelta = timedelta (seconds = 5.0 ),
520+ battery_power_manager_algorithm : PowerManagerAlgorithm = PowerManagerAlgorithm .SHIFTING_MATRYOSHKA , # noqa: E501
517521) -> None :
518522 """Initialize a `DataPipeline` instance.
519523
@@ -523,6 +527,8 @@ async def initialize(
523527 the microgrid API. When requests to components timeout, they will
524528 be marked as blocked for a short duration, during which time they
525529 will be unavailable from the corresponding component pools.
530+ battery_power_manager_algorithm: The power manager algorithm to use for
531+ batteries.
526532
527533 Raises:
528534 RuntimeError: if the DataPipeline is already initialized.
@@ -531,7 +537,9 @@ async def initialize(
531537
532538 if _DATA_PIPELINE is not None :
533539 raise RuntimeError ("DataPipeline is already initialized." )
534- _DATA_PIPELINE = _DataPipeline (resampler_config , api_power_request_timeout )
540+ _DATA_PIPELINE = _DataPipeline (
541+ resampler_config , api_power_request_timeout , battery_power_manager_algorithm
542+ )
535543
536544
537545def frequency () -> GridFrequency :
0 commit comments