From 9d7552c9e0d89f4124a00912568b6036b0d2045a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 15 Mar 2012 09:54:41 -0400 Subject: [PATCH] Allow keywords for Channel.get_range(). --- pycomedi/channel.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pycomedi/channel.pyx b/pycomedi/channel.pyx index 8da695c..b743731 100644 --- a/pycomedi/channel.pyx +++ b/pycomedi/channel.pyx @@ -16,6 +16,7 @@ "Wrap channel-wide Comedi functions in `Channel` and related classes" +cimport cython cimport numpy as _numpy import numpy as _numpy @@ -41,13 +42,13 @@ cdef class Channel (object): >>> d = Device('/dev/comedi0') >>> d.open() >>> s = d.get_read_subdevice() - >>> c = s.channel(0) + >>> c = s.channel(index=0) >>> c.get_maxdata() 65535L >>> c.get_n_ranges() 16 - >>> c.get_range(0) + >>> c.get_range(index=0) >>> c.find_range(constant.UNIT.volt, 0, 5) @@ -96,6 +97,7 @@ cdef class Channel (object): # doesn't support *rng. return ret + @cython.always_allow_keywords(True) def get_range(self, index): "`Range` instance for the `index`\ed range." return self._get_range(index) -- 2.26.2