diff options
Diffstat (limited to 'src/ee/__init__.py')
-rw-r--r-- | src/ee/__init__.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ee/__init__.py b/src/ee/__init__.py index 93c73f7..2ba113e 100644 --- a/src/ee/__init__.py +++ b/src/ee/__init__.py @@ -8,6 +8,11 @@ from ee.formatting import eng_str __all__ = [ "EeException", "EeVal", + "EeValType", + "resistance_type", + "capacitance_type", + "inductance_type", + "power_type", ] @@ -15,6 +20,18 @@ class EeException(Exception): pass +class EeValType(object): + def __init__(self, symbol, alternate_symbols): + self.symbol = symbol + self.alternate_symbols = alternate_symbols + + +resistance_type = EeValType("\u2126", ["ohm"]) +capacitance_type = EeValType("F", []) +inductance_type = EeValType("H", []) +power_type = EeValType("W", []) + + @total_ordering class EeVal(object): units = ['F', @@ -102,4 +119,3 @@ class EeVal(object): def __float__(self): return self._value * math.pow(10, self._exp) - |