diff --git a/pykat/__init__.py b/pykat/__init__.py index 49cfe37985aa88014c057efaeb9f5a3dced51259..8bcc2492eb6a44bc94bc1c9510c3ffcd76eefd57 100644 --- a/pykat/__init__.py +++ b/pykat/__init__.py @@ -3,7 +3,7 @@ from __future__ import division from __future__ import print_function from __future__ import unicode_literals -__version__ = "0.8.4" +__version__ = "0.8.5" # This flag is used to switch on the gui features in pkat at import time USE_GUI = False diff --git a/pykat/components.py b/pykat/components.py index 90254f90341f6dbfef517ba3aab4856b1ec48433..f62916290e2f9560f410776cb65f3ecf76a5cc0f 100644 --- a/pykat/components.py +++ b/pykat/components.py @@ -1088,13 +1088,21 @@ class modulator(Component): def phase(self, value): self.__phase.value = SIfloat(value) @property - def order(self): return int(self.__order) + def order(self): return self.__order @order.setter def order(self, value): - if value != 's' or (isinstance(value, int) and value <= 1 and value > 6): - raise pkex.BasePyKatException("modulator order must be between 1 and 6 or 's' for single sideband") + + try: + value = int(value) + print(value) + if value <= 1 and value > 6: + raise pkex.BasePyKatException("modulator order must be between 1 and 6 or 's' for single sideband") + + except ValueError: + if value != 's' or (isinstance(value, int) and value <= 1 and value > 6): + raise pkex.BasePyKatException("modulator order must be between 1 and 6 or 's' for single sideband") - self.__midx.value = value + self.__order = value @property