Newer
Older
python-handel
=============
A python binding for the [handel](http://support.xia.com/default.asp?W381) library.
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
System requirements
-------------------
The handel DLL files need to be available in `PATH` (`/usr/local/bin` in Cygwin for instance).
Python compatibility:
- python 2.7
- python 3.6
Python requirements
-------------------
Run requirements:
- cffi
- numpy
- configparser
Test requirements:
- mock
- pytest
- pytest-cov
Those requirements are automatically handled by `setuptools`.
Installation
------------
Run:
``` console
$ python setup.py install
```
Usage
-----
Example usage:
``` python
>>> from handel.interface import *
>>> init('xmap.ini')
>>> start_system()
>>> get_detectors()
['detector1']
>>> get_modules()
['module1']
>>> get_module_type('module1')
'mercury'
>>> get_channels()
(0,)
>>> start_run(0)
>>> stop_run(0)
>>> get_run_data(0)
array([13260, 52275, 256, ..., 0, 0, 0], dtype=uint32)
```
Tests
-----
Run:
``` console
$ python setup.py test
```
This also publishes an HTML coverage report in the `htmlcov` directory.
Continuous intergration
-----------------------
This project is automatically tested using Gitlab CI.
The tests are run for python 2.7 and 3.6
The coverage report are published [here](http://bliss.gitlab-pages.esrf.fr/python-handel/).
Scripts
-------
A few scripts are provided:
- `parse_error_header.py` which parses `handel_errors.h` and output a dictionnary of handel errors
- `handel-server` which servers the handel interface over the network using zerorpc. It requires:
* python3
* handel
* zerorpc
* msgpack_numpy
TODO
----
- Parsing of the weird XIA INI file format.
- Missing tests:
* get_module_number_of_channels(alias)
* get_module_channel_at(alias, index)
* get_module_channels(alias)
* get_channels()
Contact
-------
Vincent Michel - vincent.michel@esrf.fr