Skip to content

Commit 9108ac5

Browse files
authored
Merge pull request #82 from cyiallou/fix/include-latest-day
Fix: Include current-day production
2 parents 844ea55 + 0b6781c commit 9108ac5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
## Bug Fixes
1616

1717
- Introduced `NoDataAvailableError` exception to represent situations where no data is available and to skip such cases during workflow execution and plotting.
18+
- Fixed a bug introduced in version `v0.5.2` where the microgrid tabular overview excluded current-day values from the total production for the past 30 and 365 days, causing inconsistencies with metrics that included today's data.

src/frequenz/lib/notebooks/solar/maintenance/plotter_data_preparer.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,7 @@ def _prepare_data(self, df: pd.DataFrame) -> pd.DataFrame:
477477
"{:.2f}".format(
478478
df.loc[
479479
current.replace(hour=0, minute=0, second=0)
480-
- pd.Timedelta(days=30) : current.replace(
481-
hour=23, minute=59, second=59
482-
)
483-
- pd.Timedelta(days=1)
480+
- pd.Timedelta(days=30) : current
484481
].energy_kWh.sum()
485482
)
486483
)
@@ -503,10 +500,7 @@ def _prepare_data(self, df: pd.DataFrame) -> pd.DataFrame:
503500
"{:.2f}".format(
504501
df.loc[
505502
current.replace(hour=0, minute=0, second=0)
506-
- pd.Timedelta(days=365) : current.replace(
507-
hour=23, minute=59, second=59
508-
)
509-
- pd.Timedelta(days=1)
503+
- pd.Timedelta(days=365) : current
510504
].energy_MWh.sum()
511505
)
512506
)

0 commit comments

Comments
 (0)