Skip to content

Commit b23f47a

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

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py

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

190-
@property
191-
def production_power(self) -> FormulaEngine[Power]:
192-
"""Fetch the total power produced by the EV Chargers in the pool.
193-
194-
This formula produces positive values when producing power and 0 otherwise.
195-
196-
If a formula engine to calculate EV Charger power is not already running, it
197-
will be started.
198-
199-
A receiver from the formula engine can be created using the `new_receiver`
200-
method.
201-
202-
Returns:
203-
A FormulaEngine that will calculate and stream the production power of all
204-
EV Chargers.
205-
"""
206-
engine = self._formula_pool.from_power_formula_generator(
207-
"ev_charger_production_power",
208-
EVChargerPowerFormula,
209-
FormulaGeneratorConfig(
210-
component_ids=self._component_ids,
211-
formula_type=FormulaType.PRODUCTION,
212-
),
213-
)
214-
assert isinstance(engine, FormulaEngine)
215-
return engine
216-
217-
@property
218-
def consumption_power(self) -> FormulaEngine[Power]:
219-
"""Fetch the total power consumed by the EV Chargers in the pool.
220-
221-
This formula produces positive values when consuming power and 0 otherwise.
222-
223-
If a formula engine to calculate EV Charger power is not already running, it
224-
will be started.
225-
226-
A receiver from the formula engine can be created using the `new_receiver`
227-
method.
228-
229-
Returns:
230-
A FormulaEngine that will calculate and stream the consumption power of all
231-
EV Chargers.
232-
"""
233-
engine = self._formula_pool.from_power_formula_generator(
234-
"ev_charger_consumption_power",
235-
EVChargerPowerFormula,
236-
FormulaGeneratorConfig(
237-
component_ids=self._component_ids,
238-
formula_type=FormulaType.CONSUMPTION,
239-
),
240-
)
241-
assert isinstance(engine, FormulaEngine)
242-
return engine
243-
244190
def component_data(self, component_id: int) -> Receiver[EVChargerData]:
245191
"""Stream 3-phase current values and state of an EV Charger.
246192

tests/timeseries/test_ev_charger_pool.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,12 @@ async def test_ev_power( # pylint: disable=too-many-locals
8585

8686
ev_pool = microgrid.ev_charger_pool()
8787
power_receiver = ev_pool.power.new_receiver()
88-
production_receiver = ev_pool.production_power.new_receiver()
89-
consumption_receiver = ev_pool.consumption_power.new_receiver()
9088

9189
await mockgrid.mock_resampler.send_evc_power([2.0, 4.0, 10.0])
9290
assert (await power_receiver.receive()).value == Power.from_watts(16.0)
93-
assert (await production_receiver.receive()).value == Power.from_watts(0.0)
94-
assert (await consumption_receiver.receive()).value == Power.from_watts(16.0)
9591

9692
await mockgrid.mock_resampler.send_evc_power([2.0, 4.0, -10.0])
9793
assert (await power_receiver.receive()).value == Power.from_watts(-4.0)
98-
assert (await production_receiver.receive()).value == Power.from_watts(4.0)
99-
assert (await consumption_receiver.receive()).value == Power.from_watts(0.0)
10094

10195
await mockgrid.cleanup()
10296

0 commit comments

Comments
 (0)