Skip to content

Commit 5b25cf3

Browse files
Remove prod/cons formulas from battery pool
Signed-off-by: Matthias Wende <[email protected]>
1 parent 47d1379 commit 5b25cf3

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -261,60 +261,6 @@ def power(self) -> FormulaEngine[Power]:
261261
assert isinstance(engine, FormulaEngine)
262262
return engine
263263

264-
@property
265-
def production_power(self) -> FormulaEngine[Power]:
266-
"""Fetch the total production power of the batteries in the pool.
267-
268-
This formula produces positive values when producing power and 0 otherwise.
269-
270-
If a formula engine to calculate this metric is not already running, it will be
271-
started.
272-
273-
A receiver from the formula engine can be obtained by calling the `new_receiver`
274-
method.
275-
276-
Returns:
277-
A FormulaEngine that will calculate and stream the total production power of
278-
all batteries in the pool.
279-
"""
280-
engine = self._battery_pool._formula_pool.from_power_formula_generator(
281-
"battery_pool_production_power",
282-
BatteryPowerFormula,
283-
FormulaGeneratorConfig(
284-
component_ids=self._battery_pool._batteries,
285-
formula_type=FormulaType.PRODUCTION,
286-
),
287-
)
288-
assert isinstance(engine, FormulaEngine)
289-
return engine
290-
291-
@property
292-
def consumption_power(self) -> FormulaEngine[Power]:
293-
"""Fetch the total consumption power of the batteries in the pool.
294-
295-
This formula produces positive values when consuming power and 0 otherwise.
296-
297-
If a formula engine to calculate this metric is not already running, it will be
298-
started.
299-
300-
A receiver from the formula engine can be obtained by calling the `new_receiver`
301-
method.
302-
303-
Returns:
304-
A FormulaEngine that will calculate and stream the total consumption
305-
power of all batteries in the pool.
306-
"""
307-
engine = self._battery_pool._formula_pool.from_power_formula_generator(
308-
"battery_pool_consumption_power",
309-
BatteryPowerFormula,
310-
FormulaGeneratorConfig(
311-
component_ids=self._battery_pool._batteries,
312-
formula_type=FormulaType.CONSUMPTION,
313-
),
314-
)
315-
assert isinstance(engine, FormulaEngine)
316-
return engine
317-
318264
@property
319265
def soc(self) -> ReceiverFetcher[Sample[Percentage]]:
320266
"""Fetch the normalized average weighted-by-capacity SoC values for the pool.

tests/timeseries/_battery_pool/test_battery_pool.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,23 +483,15 @@ async def test_battery_pool_power(mocker: MockerFixture) -> None:
483483

484484
battery_pool = microgrid.battery_pool()
485485
power_receiver = battery_pool.power.new_receiver()
486-
consumption_receiver = battery_pool.consumption_power.new_receiver()
487-
production_receiver = battery_pool.production_power.new_receiver()
488486

489487
await mockgrid.mock_resampler.send_bat_inverter_power([2.0, 3.0])
490488
assert (await power_receiver.receive()).value == Power.from_watts(5.0)
491-
assert (await consumption_receiver.receive()).value == Power.from_watts(5.0)
492-
assert (await production_receiver.receive()).value == Power.from_watts(0.0)
493489

494490
await mockgrid.mock_resampler.send_bat_inverter_power([-2.0, -5.0])
495491
assert (await power_receiver.receive()).value == Power.from_watts(-7.0)
496-
assert (await consumption_receiver.receive()).value == Power.from_watts(0.0)
497-
assert (await production_receiver.receive()).value == Power.from_watts(7.0)
498492

499493
await mockgrid.mock_resampler.send_bat_inverter_power([2.0, -5.0])
500494
assert (await power_receiver.receive()).value == Power.from_watts(-3.0)
501-
assert (await consumption_receiver.receive()).value == Power.from_watts(0.0)
502-
assert (await production_receiver.receive()).value == Power.from_watts(3.0)
503495

504496
await mockgrid.cleanup()
505497

0 commit comments

Comments
 (0)