mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-22 02:45:10 -04:00
Use class for attributes
This commit is contained in:
parent
310d1bafd7
commit
f6139db0b5
10 changed files with 61 additions and 19 deletions
pyhon/parameter
|
@ -1,15 +1,9 @@
|
|||
from typing import Dict, Any, List
|
||||
|
||||
from pyhon.helper import str_to_float
|
||||
from pyhon.parameter.base import HonParameter
|
||||
|
||||
|
||||
def str_to_float(string: str | float) -> float:
|
||||
try:
|
||||
return int(string)
|
||||
except ValueError:
|
||||
return float(str(string).replace(",", "."))
|
||||
|
||||
|
||||
class HonParameterRange(HonParameter):
|
||||
def __init__(self, key: str, attributes: Dict[str, Any], group: str) -> None:
|
||||
super().__init__(key, attributes, group)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue