Skip to content

Commit

Permalink
Get values for every parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Apr 22, 2023
1 parent 1dad0e1 commit 5fc6245
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pyhon/parameter/fixed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, List

from pyhon.parameter.base import HonParameter

Expand All @@ -19,3 +19,7 @@ def value(self) -> str | float:
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))
6 changes: 5 additions & 1 deletion pyhon/parameter/range.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, List

from pyhon.parameter.base import HonParameter

Expand Down Expand Up @@ -47,3 +47,7 @@ def value(self, value: float) -> None:
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))]

0 comments on commit 5fc6245

Please sign in to comment.