calibration: add CalibrationSetting attribute-setting doctests.
authorW. Trevor King <wking@tremily.us>
Wed, 17 Oct 2012 17:04:35 +0000 (13:04 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 17 Oct 2012 17:05:13 +0000 (13:05 -0400)
pycomedi/calibration.pyx

index ec89ec0d8dfeab90ce073b686accb271d3bb9e8b..7a7eb5f21dda6e590f1a949195a6fea81d6f77c4 100644 (file)
@@ -425,6 +425,28 @@ cdef class CalibrationSetting (object):
         from physical coefficients: [ 0.]
         from physical origin: 0.0
 
+    Test setting various attributes.
+
+    >>> s = c.settings[-1]
+    >>> s.channels = [0, 1, 2]
+    >>> s.channels
+    array([0, 1, 2])
+    >>> s.ranges = [0, 1]
+    >>> s.ranges
+    array([0, 1])
+    >>> s.arefs = [0]
+    >>> s.arefs
+    array([0])
+    >>> caldacs = []
+    >>> for i in range(3):
+    ...     caldac = Caldac()
+    ...     caldac.allocate()
+    ...     caldac.subdevice = i
+    ...     caldac.channel = 2*i
+    ...     caldac.value = 3*i
+    ...     caldacs.append(caldac)
+    >>> s.caldacs = caldacs
+
     >>> d.close()
     """
     def __cinit__(self):