Get values for every parameter

This commit is contained in:
Andre Basche 2023-04-22 23:08:44 +02:00
parent 1dad0e14b8
commit 5fc6245806
2 changed files with 10 additions and 2 deletions

View file

@ -1,4 +1,4 @@
from typing import Dict, Any from typing import Dict, Any, List
from pyhon.parameter.base import HonParameter from pyhon.parameter.base import HonParameter
@ -19,3 +19,7 @@ class HonParameterFixed(HonParameter):
def value(self, value: str | float) -> None: def value(self, value: str | float) -> None:
# Fixed values seems being not so fixed as thought # Fixed values seems being not so fixed as thought
self._value = value self._value = value
@property
def values(self) -> List[str]:
return list(str(self.value))

View file

@ -1,4 +1,4 @@
from typing import Dict, Any from typing import Dict, Any, List
from pyhon.parameter.base import HonParameter from pyhon.parameter.base import HonParameter
@ -47,3 +47,7 @@ class HonParameterRange(HonParameter):
raise ValueError( raise ValueError(
f"Allowed: min {self._min} max {self._max} step {self._step}" f"Allowed: min {self._min} max {self._max} step {self._step}"
) )
@property
def values(self) -> List[str]:
return [str(i) for i in range(int(self.min), int(self.max) + 1, int(self.step))]