Skip to content

Commit 9cc781a

Browse files
Use measurements from EV chargers when calculating grid power (#172)
... if the ev chargers are directly connected to the grid.
2 parents aaa5465 + 47bc211 commit 9cc781a

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

pyproject.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,22 @@ line-length = 88
7474
target-version = ['py38']
7575
include = '\.pyi?$'
7676

77-
[tool.pylint]
78-
[tool.pylint.'SIMILARITIES']
79-
ignore-comments=['yes']
80-
ignore-docstrings=['yes']
81-
ignore-imports=['no']
82-
min-similarity-lines=40
77+
[tool.pylint.similarities]
78+
ignore-comments=['yes']
79+
ignore-docstrings=['yes']
80+
ignore-imports=['no']
81+
min-similarity-lines=40
8382

84-
[tool.pylint.messages_control]
85-
disable = [
86-
"too-few-public-methods",
87-
# disabled because it conflicts with isort
88-
"wrong-import-order",
89-
"ungrouped-imports"
90-
]
83+
[tool.pylint.messages_control]
84+
disable = [
85+
"too-few-public-methods",
86+
# disabled because it conflicts with isort
87+
"wrong-import-order",
88+
"ungrouped-imports"
89+
]
9190

92-
[tool.pylint.'DESIGN']
93-
max-attributes=12
91+
[tool.pylint.design]
92+
max-attributes=12
9493

9594
[tool.isort]
9695
profile = "black"

src/frequenz/sdk/timeseries/logical_meter/_formula_generators/_battery_power_formula.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def generate(
4646
)
4747

4848
if not battery_inverters:
49-
logging.warning(
49+
logger.warning(
5050
"Unable to find any battery inverters in the component graph. "
5151
"Subscribing to the resampling actor with a non-existing "
5252
"component id, so that `0` values are sent from the formula."

src/frequenz/sdk/timeseries/logical_meter/_formula_generators/_grid_power_formula.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ async def generate(
5353
#
5454
# This is not possible for Meters, so when they produce `None`
5555
# values, those values get propagated as the output.
56-
if comp.category == ComponentCategory.INVERTER:
56+
if comp.category in (
57+
ComponentCategory.INVERTER,
58+
ComponentCategory.EV_CHARGER,
59+
):
5760
nones_are_zeros = True
5861
elif comp.category == ComponentCategory.METER:
5962
nones_are_zeros = False

src/frequenz/sdk/timeseries/logical_meter/_formula_generators/_pv_power_formula.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def generate(self) -> FormulaEngine:
3636
)
3737

3838
if not pv_inverters:
39-
logging.warning(
39+
logger.warning(
4040
"Unable to find any PV inverters in the component graph. "
4141
"Subscribing to the resampling actor with a non-existing "
4242
"component id, so that `0` values are sent from the formula."

0 commit comments

Comments
 (0)