From c67fa1d3b9d88de83e99400713737212f6fb9adc Mon Sep 17 00:00:00 2001 From: Flora Date: Tue, 1 Oct 2024 13:43:00 +0200 Subject: [PATCH] Change zero to nan for lack of data Signed-off-by: Flora --- RELEASE_NOTES.md | 2 +- src/frequenz/reporting/_reporting.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1471b48..a144d93 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -14,4 +14,4 @@ ## Bug Fixes - +* Change 0.0 to nan if there is no data available diff --git a/src/frequenz/reporting/_reporting.py b/src/frequenz/reporting/_reporting.py index 1948957..b960733 100644 --- a/src/frequenz/reporting/_reporting.py +++ b/src/frequenz/reporting/_reporting.py @@ -114,7 +114,7 @@ async def cumulative_energy( elif last_value_diff < 0: production += last_value_diff else: - consumption = production = 0.0 + consumption = production = float("nan") return CumulativeEnergy( start_time=start_time,