From 097d5823eae933b8910c04bbd6f0b0a9e54cdcaa Mon Sep 17 00:00:00 2001 From: vcai122 Date: Wed, 13 Sep 2023 10:48:33 -0400 Subject: [PATCH] remove add boolean --- backend/penndata/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/penndata/views.py b/backend/penndata/views.py index 99ad9237..c09cf993 100644 --- a/backend/penndata/views.py +++ b/backend/penndata/views.py @@ -370,7 +370,7 @@ def get_usage(self, room, date, num_samples, group_by, field): usage = self.get_usage_on_date(room, curr, field) # usage for curr # incorporate usage safely considering None (no data) values usage_aggs = [ - (self.safe_add(sum, val), count + (val is not None)) + (self.safe_add(sum, val), count + (1 if val is not None else 0)) for (sum, count), val in zip(usage_aggs, usage) ] # update min and max date if any data was logged