From 120762912762bca70a742f4b4fab0916d055735c Mon Sep 17 00:00:00 2001 From: Jan Pecinovsky Date: Fri, 19 Jul 2024 10:32:24 +0000 Subject: [PATCH] key validation to 3 decimal values --- openenergyid/energysharing/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openenergyid/energysharing/models.py b/openenergyid/energysharing/models.py index d869d13..fa28457 100644 --- a/openenergyid/energysharing/models.py +++ b/openenergyid/energysharing/models.py @@ -34,7 +34,7 @@ class KeyInput(TimeDataFrame): def model_post_init(self, __context: Any) -> None: """Post-initialization validation.""" for row in self.data: - if round(sum(row), 6) != 1: + if round(sum(row), 3) != 1.0: raise ValueError("Each row must sum to 1.") return super().model_post_init(__context)