Get values for every parameter
This commit is contained in:
parent
1dad0e14b8
commit
5fc6245806
2 changed files with 10 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
from typing import Dict, Any
|
||||
from typing import Dict, Any, List
|
||||
|
||||
from pyhon.parameter.base import HonParameter
|
||||
|
||||
|
@ -19,3 +19,7 @@ class HonParameterFixed(HonParameter):
|
|||
def value(self, value: str | float) -> None:
|
||||
# Fixed values seems being not so fixed as thought
|
||||
self._value = value
|
||||
|
||||
@property
|
||||
def values(self) -> List[str]:
|
||||
return list(str(self.value))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Dict, Any
|
||||
from typing import Dict, Any, List
|
||||
|
||||
from pyhon.parameter.base import HonParameter
|
||||
|
||||
|
@ -47,3 +47,7 @@ class HonParameterRange(HonParameter):
|
|||
raise ValueError(
|
||||
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))]
|
||||
|
|
Loading…
Reference in a new issue