-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
126 lines (89 loc) · 3.89 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
This package provides an object-oriented interface to the Comedi_
drivers. The standard Python interface bundled with Comedilib is a
simple SWIG clone of the C interface. In pycomedi, we convert the
functions into class methods (see ``pycomedi.classes``), so you don't
have to worry about dragging around opaque types like ``comedi_t *``
device pointers. We also bundle related constants together in
``_Enums`` and ``_Flags`` (see ``pycomedi.constants``), to make
handling common operations like flag manipulations simpler. Finally,
there are a number of utility classes (see ``pycomedi.utility``) to
make common tasks like creating instructions or reading hardware-timed
analog input easier.
Installation
============
Packages
--------
Gentoo
~~~~~~
I've packaged pycomedi for Gentoo. You need layman_ and my `wtk
overlay`_. Install with::
# emerge -av app-portage/layman
# layman --add wtk
# emerge -av dev-python/pycomedi
Dependencies
------------
If you're installing by hand or packaging pycomedi for another
distribution, you'll need the following dependencies:
============ =================== ================ ==============================
Package Purpose Debian_ Gentoo_
============ =================== ================ ==============================
NumPy_ ? python-numpy dev-python/numpy
SciPy_ testing python-scipy sci-libs/scipy
Comedi_ Comedilib interface python-comedilib sci-libs/comedilib [#wtk]_
nose_ testing python-nose dev-python/nose
Cython_ Comedilib interface cython dev-python/cython
python-kmod_ Optional ext. info. dev-python/python-kmod [#wtk]_
============ =================== ================ ==============================
.. [#wtk] In the `wtk overlay`_.
If python-kmod is installed, you will get additional module
information from the ``info.py`` demo program. If it is not
installed, everything will still work, but ``info.py`` will only be
able to get the module version, not the kernel version, staging-ness,
parameters, etc.
Installing by hand
------------------
Pycomedi is available as a Git_ repository::
$ git clone git://tremily.us/pycomedi.git
See the homepage_ for details. To install the checkout, run the
standard::
$ python setup.py install
Usage
=====
See the examples in the ``doc`` directory.
Testing
=======
Run integration tests with::
$ nosetests --with-doctest --doctest-extension=txt doc
The analog integration tests read from analog input channels 0 through
3, and write to analog output channels 0 and 1, so you'll need a board
with that many channels. You should also make sure that the analog
output channels aren't plugged into anything sensetive, since the
tests sweep their output around over a reasonable chunk of the channel
range. Some of the internal unit tests also write, so it's safest to
just disconnect all digital lines and analog outputs before running
the tests.
Run both integration tests and internal unit tests with::
$ ./test.sh
Licence
=======
This project is distributed under the `GNU General Public License
Version 2`_ or greater.
Author
======
W. Trevor King
.. _Comedi: http://www.comedi.org/
.. _layman: http://layman.sourceforge.net/
.. _wtk overlay: http://blog.tremily.us/posts/Gentoo_overlay/
.. _science overlay: http://overlays.gentoo.org/proj/science/wiki/en
.. _Debian: http://www.debian.org/
.. _Gentoo: http://www.gentoo.org/
.. _NumPy: http://numpy.scipy.org/
.. _SciPy: http://www.scipy.org/
.. _nose: http://somethingaboutorange.com/mrl/projects/nose/
.. _Cython: http://www.cython.org/
.. _python-kmod: https://github.com/agrover/python-kmod/
.. _Git: http://git-scm.com/
.. _homepage: http://blog.tremily.us/posts/pycomedi/
.. _GNU General Public License Version 2:
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt