1
0
Fork 0
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:
Andre Basche 2023-06-13 00:12:29 +02:00
parent 310d1bafd7
commit f6139db0b5
10 changed files with 61 additions and 19 deletions
pyhon/parameter

View file

@ -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)