Skip to content

Commit

Permalink
Merge pull request #69 from Galvant/lint_agilent
Browse files Browse the repository at this point in the history
pass pylint on agilent classes
  • Loading branch information
scasagrande committed Jan 30, 2016
2 parents 857f034 + 4370ab5 commit 575bf3a
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 223 deletions.
69 changes: 38 additions & 31 deletions instruments/instruments/abstract_instruments/function_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,46 @@ def _set_amplitude_(self, magnitude, units):
pass

## ABSTRACT PROPERTIES ##
"""
def getamplitude(self):
raise NotImplementedError('')
def setamplitude(self, newval):
raise NotImplementedError('')
amplitude = abc.abstractproperty(getamplitude, setamplitude)
"""

def getfrequency(self):
raise NotImplementedError('')
def setfrequency(self, newval):
raise NotImplementedError('')
frequency = abc.abstractproperty(getfrequency, setfrequency)

def getfunction(self):
raise NotImplementedError('')
def setfunction(self, newval):
raise NotImplementedError('')
function = abc.abstractproperty(getfunction, setfunction)

@property
@abc.abstractmethod
def frequency(self):
pass

@frequency.setter
@abc.abstractmethod
def frequency(self, newval):
pass

@property
@abc.abstractmethod
def function(self):
pass

@function.setter
@abc.abstractmethod
def function(self, newval):
pass

def getoffset(self):
raise NotImplementedError('')
def setoffset(self, newval):
raise NotImplementedError('')
offset = abc.abstractproperty(getoffset, setoffset)
@property
@abc.abstractmethod
def offset(self):
pass

@offset.setter
@abc.abstractmethod
def offset(self, newval):
pass

def getphase(self):
raise NotImplementedError('')
def setphase(self, newval):
raise NotImplementedError('')
phase = abc.abstractproperty(getphase, setphase)
@property
@abc.abstractmethod
def phase(self):
pass

@phase.setter
@abc.abstractmethod
def phase(self, newval):
pass

## CONCRETE PROPERTIES ##

Expand Down Expand Up @@ -147,4 +155,3 @@ def amplitude(self, newval):
mag = float(assume_units(mag, pq.V).rescale(pq.V).magnitude)

self._set_amplitude_(mag, units)

105 changes: 59 additions & 46 deletions instruments/instruments/abstract_instruments/multimeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,63 +38,76 @@
class Multimeter(with_metaclass(abc.ABCMeta, Instrument)):

## PROPERTIES ##

def getmode(self):
"""
Read measurement mode the multimeter is currently in.
"""
raise NotImplementedError
def setmode(self, newval):
"""
Change the mode the multimeter is in.
"""
raise NotImplementedError
mode = abc.abstractproperty(getmode, setmode)

def gettrigger_mode(self):
"""
Get the current trigger mode the multimeter is set to.
"""
raise NotImplementedError
def settrigger_mode(self, newval):
"""
Set the multimeter triggering mode.
"""
raise NotImplementedError
trigger_mode = abc.abstractproperty(gettrigger_mode, settrigger_mode)

def getrelative(self):

@property
@abc.abstractmethod
def mode(self):
"""
Get the status of relative measuring mode (usually on or off).
Gets/sets the measurement mode for the multimeter. This is an
abstract method.
:type: `~enum.Enum`
"""
raise NotImplementedError
def setrelative(self, newval):
pass

@mode.setter
@abc.abstractmethod
def mode(self, newval):
pass

@property
@abc.abstractmethod
def trigger_mode(self):
"""
Set (enable/disable) the relative measuring mode of the multimeter.
Gets/sets the trigger mode for the multimeter. This is an
abstract method.
:type: `~enum.Enum`
"""
raise NotImplementedError
relative = abc.abstractproperty(getrelative, setrelative)
pass

@trigger_mode.setter
@abc.abstractmethod
def trigger_mode(self, newval):
pass

def getinput_range(self):
@property
@abc.abstractmethod
def relative(self):
"""
Get the current input range setting of the multimeter.
Gets/sets the status of relative measuring mode for the multimeter.
This is an abstract method.
:type: `bool`
"""
raise NotImplementedError
def setinput_range(self, newval):
pass

@relative.setter
@abc.abstractmethod
def relative(self, newval):
pass

@property
@abc.abstractmethod
def input_range(self):
"""
Set the input range setting of the multimeter.
Gets/sets the current input range setting of the multimeter.
This is an abstract method.
:type: `~quantities.quantity.Quantity` or `~enum.Enum`
"""
raise NotImplementedError
input_range = abc.abstractproperty(getinput_range, setinput_range)



pass

@input_range.setter
@abc.abstractmethod
def input_range(self, newval):
pass

## METHODS ##

@abc.abstractmethod
def measure(self, mode):
'''
"""
Perform a measurement as specified by mode parameter.
'''
raise NotImplementedError

"""
pass
3 changes: 3 additions & 0 deletions instruments/instruments/agilent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module containing Agilent instruments
"""

from __future__ import absolute_import

Expand Down

0 comments on commit 575bf3a

Please sign in to comment.