Commit c69eb188 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Improve code consistency

Showing with 5 additions and 4 deletions
+5 -4
...@@ -6,6 +6,8 @@ from ohmpi.utils import enforce_specs ...@@ -6,6 +6,8 @@ from ohmpi.utils import enforce_specs
# hardware characteristics and limitations # hardware characteristics and limitations
SPECS = {'model': {'default': os.path.basename(__file__).rstrip('.py')}, SPECS = {'model': {'default': os.path.basename(__file__).rstrip('.py')},
'voltage': {'default': 12., 'max': 12., 'min': 12.}, 'voltage': {'default': 12., 'max': 12., 'min': 12.},
'current_adjustable': {'default': False},
'voltage_adjustable': {'default': False}
} }
...@@ -17,11 +19,8 @@ class Pwr(PwrAbstract): ...@@ -17,11 +19,8 @@ class Pwr(PwrAbstract):
subclass_init = False subclass_init = False
else: else:
subclass_init = True subclass_init = True
voltage = kwargs.pop('voltage', 12.)
super().__init__(**kwargs) super().__init__(**kwargs)
self.voltage_adjustable = False self._voltage = kwargs['voltage']
self._voltage = voltage
self.current_adjustable = False
self._current = np.nan self._current = np.nan
self._state = 'on' self._state = 'on'
......
...@@ -9,6 +9,8 @@ from ohmpi.utils import enforce_specs ...@@ -9,6 +9,8 @@ from ohmpi.utils import enforce_specs
SPECS = {'model': {'default': os.path.basename(__file__).rstrip('.py')}, SPECS = {'model': {'default': os.path.basename(__file__).rstrip('.py')},
'voltage': {'default': 12., 'max': 50., 'min': 0.}, 'voltage': {'default': 12., 'max': 50., 'min': 0.},
'current_max': {'default': 100.}, 'current_max': {'default': 100.},
'current_adjustable': {'default': False},
'voltage_adjustable': {'default': True}
} }
# TODO: Complete this code... handle modbus connection # TODO: Complete this code... handle modbus connection
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment