mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-30 17:24:29 +01:00
Get values for every parameter
This commit is contained in:
parent
1dad0e14b8
commit
5fc6245806
@ -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))
|
||||||
|
@ -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))]
|
||||||
|
Loading…
Reference in New Issue
Block a user