From 8a46bd4b53565ee420a443dc93a3f34344107f0f Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 4 Feb 2024 03:39:06 +0100 Subject: [PATCH] Fix for float steps #22 --- pyhon/parameter/range.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyhon/parameter/range.py b/pyhon/parameter/range.py index 6eef53e..76bd2b6 100644 --- a/pyhon/parameter/range.py +++ b/pyhon/parameter/range.py @@ -69,4 +69,11 @@ class HonParameterRange(HonParameter): @property def values(self) -> List[str]: + if isinstance(self.step, float): + result = [] + i = self.min + while i <= self.max: + i += self.step + result.append(str(i)) + return result return [str(i) for i in range(int(self.min), int(self.max) + 1, int(self.step))]