From: W. Trevor King Date: Tue, 14 Dec 2010 19:27:44 +0000 (-0500) Subject: Also rename sngAioError -> SngAioError and dioError -> SngDioError. X-Git-Tag: 0.3~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=201975c2e86a5584974d678d335accd22da8a677;p=pycomedi.git Also rename sngAioError -> SngAioError and dioError -> SngDioError. --- diff --git a/pycomedi/single_aio.py b/pycomedi/single_aio.py index 4807378..434eff2 100644 --- a/pycomedi/single_aio.py +++ b/pycomedi/single_aio.py @@ -27,7 +27,7 @@ import common VERBOSE_DEBUG = False -class sngAioError (common.PycomediError) : +class SngAioError (common.PycomediError) : "Single point Analog IO error" pass @@ -82,7 +82,7 @@ class AO (common.PyComediSingleIO) : common.PyComediIO.__init__(self, devtype=c.COMEDI_SUBD_AO, output=True, **kwargs) def write(self, data) : if len(data) != self.nchan : - raise sngAioError, "data length %d != the number of channels (%d)" % (len(data), self.nchan) + raise SngAioError, "data length %d != the number of channels (%d)" % (len(data), self.nchan) for i in range(self.nchan) : self.write_chan_index(i, data[i]) @@ -104,7 +104,7 @@ def _fit_with_residual(out_data, in_data, channel) : print "p = ", p_value # probablility of measuring this ?slope? for non-correlated, normally-distruibuted data print "err = ", std_err # root mean sqared error of best fit if gradient < .7 or p_value > 0.05 : - raise sngAioError, "Out channel %d != in channel %d" % (channel, channel) + raise SngAioError, "Out channel %d != in channel %d" % (channel, channel) residual = zeros((len(out_data),)) for i in range(len(out_data)) : pred_y = intercept + gradient * out_data[i] diff --git a/pycomedi/single_dio.py b/pycomedi/single_dio.py index 3126d81..57cafaa 100644 --- a/pycomedi/single_dio.py +++ b/pycomedi/single_dio.py @@ -25,7 +25,7 @@ import comedi as c import common -class dioError (common.PycomediError): +class SngDioError (common.PycomediError): "Digital IO error" pass @@ -50,7 +50,7 @@ class DIO_port (common.PyComediSingleIO) : rc = c.comedi_dio_config(self.dev, self.subdev, chan, c.COMEDI_OUTPUT) if rc != 1 : # yes, comedi_dio_config returns 1 on success, -1 on failure, as of comedilib-0.8.1 self._comedi.comedi_perror("comedi_dio_config") - raise dioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_OUTPUT, rc) + raise SngDioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_OUTPUT, rc) self.output = True def set_to_input(self) : "switch all the channels associated with this object to be inputs" @@ -58,7 +58,7 @@ class DIO_port (common.PyComediSingleIO) : rc = c.comedi_dio_config(self.dev, self.subdev, chan, c.COMEDI_INPUT) if rc != 1 : self._comedi.comedi_perror("comedi_dio_config") - raise dioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_INPUT, rc) + raise SngDioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_INPUT, rc) self.output = False def write_port(self, data) : """inputs: