mmcb-rs232-avt 1.0.19__py3-none-any.whl → 1.1.37__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: mmcb-rs232-avt
3
+ Version: 1.1.37
4
+ Summary: ATLAS ITK Pixels Multi-Module Cycling Box environmental monitoring/control (RS232)
5
+ Home-page: https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb-rs232
6
+ Author: Alan Taylor
7
+ Author-email: avt@hep.ph.liv.ac.uk
8
+ Maintainer: Alan Taylor
9
+ Maintainer-email: avt@hep.ph.liv.ac.uk
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Topic :: Scientific/Engineering :: Physics
14
+ Classifier: Environment :: Console
15
+ Classifier: Environment :: X11 Applications
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.6
19
+ Classifier: Programming Language :: Python :: 3.7
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Operating System :: POSIX :: Linux
27
+ Classifier: Natural Language :: English
28
+ Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
29
+ Requires-Python: >=3.6
30
+ Description-Content-Type: text/markdown
31
+ Requires-Dist: numpy
32
+ Requires-Dist: pandas
33
+ Requires-Dist: matplotlib
34
+ Requires-Dist: zmq
35
+ Requires-Dist: pyserial==3.4.*
36
+ Requires-Dist: tables
37
+ Requires-Dist: yoctopuce
38
+ Dynamic: author
39
+ Dynamic: author-email
40
+ Dynamic: classifier
41
+ Dynamic: description
42
+ Dynamic: description-content-type
43
+ Dynamic: home-page
44
+ Dynamic: maintainer
45
+ Dynamic: maintainer-email
46
+ Dynamic: requires-dist
47
+ Dynamic: requires-python
48
+ Dynamic: summary
49
+
50
+ # Serial port handling for the ATLAS ITK pixels multi-module cycling box
51
+
52
+ [![PyPI version](https://badge.fury.io/py/mmcb-rs232-avt.svg)](https://badge.fury.io/py/mmcb-rs232-avt)
53
+
54
+ ![image](https://hep.ph.liv.ac.uk/~avt/pypi/logo.png)
55
+
56
+ *Particle Physics, University of Liverpool, UK*
57
+
58
+ ## Features
59
+
60
+ This repository provides command line tools to monitor and control equipment in the *ATLAS ITK pixels multi-module cycling box* test setup. It is used in the test setups for a number of other projects. Interactions with these instruments are performed via FTDI USB to RS232 adaptors.
61
+
62
+ ### Main commands
63
+
64
+ |Command|Function|
65
+ |:---:|:---:|
66
+ |[dmm](packaging/src/mmcbrs232/dmm.py)|Reads voltage/current values from the Keithley DMM6500 6.5 digit multimeter.|
67
+ |[iv](packaging/src/mmcbrs232/iv.py)|Configurable script to measure IV/IT curves using the Keithley 2410/2614b (RS232). It can operate multiple PSUs concurrently, embed environmental data into log files, and can be easily used in shell scripts to automate tasks such as HV-cycling.|
68
+ |[psuset](packaging/src/mmcbrs232/psuset.py)|Sets current/voltage parameters for power supplies (RS232: Keithley 2410/2614b, Hameg HMP4040). Works in both constant voltage and constant current modes.|
69
+ |[ult80](packaging/src/mmcbrs232/ult80.py)|Queries and/or sets parameters for the ULT80 chiller (RS232).|
70
+
71
+ ### Support commands
72
+
73
+ |Command|Function|
74
+ |:---:|:---:|
75
+ |[detect](packaging/src/mmcbrs232/detect.py)|Detects equipment attached by RS232, writes a cache file containing identified equipment to `~/.cache.json`. Run *once* after the RS232 configuration has changed.|
76
+ |[liveplot](packaging/src/mmcbrs232/liveplot.py)|Companion to `iv`. Displays IV plot in real-time in a graphical window.|
77
+ |[psustat](packaging/src/mmcbrs232/psustat.py)|Provides a single-shot view of the status of all power supply channels (RS232: Keithley 2410/2614b, Hameg HMP4040).|
78
+ |[rs232_zmq_server](packaging/src/mmcbrs232/broker_and_workers.py)|Provides shared, parallel access to RS232 instruments. Concurrent requests to the same serial port are serialised by order of arrival since interactions with a given serial port is managed by a single thread specific to that serial port.|
79
+ |[zpsustat](packaging/src/mmcbrs232/zpsustat.py)|Version of `psustat` above that uses the ZeroMQ server rather than querying the device directly. Supports requests for information on specified, individual PSU channels only.|
80
+
81
+ ## History
82
+
83
+ The files in this repository were originally part of the [atlas-mmcb-avt](https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb/) repository, which used to handle monitoring and control of equipment attached via I2C, GPIO and serial port. To support the serial port interaction being run on a conventional Intel DAQ computer, these functions were split into two packages. All RS232 serial port interaction code is now contained in this package.
84
+
85
+ The Raspberry Pi specific aspects (I2C environmenal monitoring and Peltier device polarity switching via GPIO) remain in the [atlas-mmcb-avt](https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb/) repository, which no longer contains any serial port capability.
86
+
87
+ ## Documentation
88
+
89
+ For project documentation, see the [wiki](https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb/-/wikis/home), or each command's in-built help, e.g. `psustat --help`.
90
+
91
+
92
+ ## Installation
93
+
94
+ This software is publically available and may be obtained from [The Python Package Index](https://pypi.org/project/mmcb-avt/).
95
+
96
+ This repository provides also a wheel (`.whl`) file that is installable with [pip](https://packaging.python.org/en/latest/key_projects/#pip). See the [packaging](packaging) directory for installation instructions.
97
+
98
+
99
+ ## Support
100
+
101
+ Support requests to [avt@hep.ph.liv.ac.uk](mailto:avt@hep.ph.liv.ac.uk) or via the [Issue Tracker](https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb/-/issues).
102
+
103
+
104
+ ## Installation notes
105
+
106
+ ### Yoctopuce sensors
107
+
108
+ In addition to the dependencies installed with pip, testing ATLAS sensors on the old probestation (for convenience) will also require the [Yoctopuce Command line API](https://www.yoctopuce.com/EN/libraries.php). Please install the correct version for your architecture - this will provide commands such as `YTemperature` and `YHumidity` to monitor the probestation interior state from the command line.
109
+
110
+ Install the archive (e.g. `Cmdlines.linux_arm.70284.zip`) into `~/dev` and then set the path to include `~/dev/Cmdlines/Binaries/linux/aarch64`, e.g. `PATH=$PATH:~/dev/Cmdlines/Binaries/linux/aarch64`.
111
+
112
+ ## ZeroMQ serial port server
113
+
114
+ This is based on the ZeroMQ Majordomo pattern, and has a separate thread managing each serial port.
115
+
116
+ ```console
117
+ (base) [pixeldaq@atldaq1 ~]$ rs232_zmq_server -h
118
+ usage: rs232_zmq_server [-h] [-v] [-n]
119
+
120
+ ZeroMQ server (broker and workers) for the ATLAS Pixels multi-module cycling box serial port devices. This server manages
121
+ concurrent access to serial port resources for all attached clients. Commands line scripts emulated are psuset, psustat
122
+ and ult80. WARNING: ANY attached client has the authority to change ANY power supply or chiller parameter at ANY time.
123
+ Clients (PID control loops) running concurrently must ensure that they only modify their own resources, and not those of
124
+ other clients.
125
+
126
+ options:
127
+ -h, --help show this help message and exit
128
+ -v, --verbose Enable logging.
129
+ -n, --nolock Disable the use of the global rs232 lock. For safety this script will use the global rs232 lock by
130
+ default. This lock is a coarse measure that should prevent concurrent serial port access, even to
131
+ different ports, by this server and other command line scripts that may access serial port resources.
132
+ When running multiple concurrent asynchronous PID control scripts, using -n allows optimal sharing of
133
+ serial port resources between those scripts.
134
+ ```
135
+
136
+ If you want the best performance from PID scripts, start the server with `-n`. If you need to use command line utilities (`psuset`, `psustat`, etc.) in parallel with PID scripts, then omit the `-n`.
137
+
138
+ ### Start
139
+
140
+ ```console
141
+ (base) [pixeldaq@atldaq1 ~]$ nohup rs232_zmq_server </dev/null >/dev/null 2>&1 &
142
+ (base) [pixeldaq@atldaq1 ~]$ disown
143
+ ```
144
+
145
+ ### Stop
146
+
147
+ ```console
148
+ (base) [pixeldaq@atldaq1 ~]$ ps -ef | grep rs232_zmq_server
149
+ pixeldaq 18079 17527 0 12:00 pts/16 00:00:12 /usr/local/bin/python3 /home/pixeldaq/.local/bin/rs232_zmq_server
150
+ pixeldaq 26239 17527 0 12:51 pts/16 00:00:00 grep --color=auto rs232_zmq_server
151
+ (base) [pixeldaq@atldaq1 ~]$ kill 18079
152
+ ```
153
+
154
+ ### Test
155
+
156
+ ```console
157
+ (base) [pixeldaq@atldaq1 ~]$ pip show mmcb-rs232-avt
158
+ WARNING: Ignoring invalid distribution ~ip (/home/pixeldaq/miniconda3/lib/python3.13/site-packages)
159
+ Name: mmcb-rs232-avt
160
+ Version: 1.1.28
161
+ Summary: ATLAS ITK Pixels Multi-Module Cycling Box environmental monitoring/control (RS232)
162
+ Home-page: https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcb-rs232
163
+ Author: Alan Taylor
164
+ Author-email: avt@hep.ph.liv.ac.uk
165
+ License:
166
+ Location: /home/pixeldaq/miniconda3/lib/python3.13/site-packages
167
+ Requires: matplotlib, numpy, pandas, pyserial, tables, yoctopuce, zmq
168
+ Required-by:
169
+
170
+ (base) [pixeldaq@atldaq1 ~]$ python
171
+ Python 3.13.2 | packaged by Anaconda, Inc. | (main, Feb 6 2025, 18:56:02) [GCC 11.2.0] on linux
172
+ Type "help", "copyright", "credits" or "license" for more information.
173
+ >>> from mmcbrs232 import mdclientlib
174
+ >>> mdclientlib.__version__
175
+ '1.1.28'
176
+ >>> mdc = mdclientlib.Rs232()
177
+ >>> mdc.
178
+ mdc.channels mdc.get_pt_i( mdc.get_ult80_temps() mdc.psu_set( mdc.psus
179
+ mdc.client mdc.get_pt_v( mdc.ports mdc.psu_unset( mdc.settings
180
+ >>> mdc.get_ult80_temps()
181
+ (23.0, 23.0)
182
+ >>> mdc.get_pt_v(103877, 2)
183
+ 0.3
184
+ ```
185
+
186
+ ### Latency for common operations
187
+
188
+ ```python
189
+ (base) [pixeldaq@atldaq1 ~]$ ipython
190
+ Python 3.13.2 | packaged by Anaconda, Inc. | (main, Feb 6 2025, 18:56:02) [GCC 11.2.0]
191
+ Type 'copyright', 'credits' or 'license' for more information
192
+ IPython 9.6.0 -- An enhanced Interactive Python. Type '?' for help.
193
+ Tip: You can use LaTeX or Unicode completion, `\alpha<tab>` will insert the α symbol.
194
+
195
+ In [1]: from mmcbrs232 import mdclientlib
196
+
197
+ In [2]: mdc = mdclientlib.Rs232()
198
+
199
+ In [3]: %timeit mdc.get_ult80_temps()
200
+ 63.9 ms ± 26.4 μs per loop (mean ± std. dev. of 7 runs, 10 loops each)
201
+
202
+ In [4]: %timeit mdc.get_pt_v(103877, 2)
203
+ 204 ms ± 8.58 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
204
+
205
+ In [5]: %timeit mdc.psu_set(103877, 2, 0.3, 4.95)
206
+ 1.12 s ± 4.58 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
207
+
208
+ In [6]: %timeit mdc.psu_unset(103877, 2, 0.3, 4.95)
209
+ 1.12 s ± 7.78 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
210
+ ```
@@ -0,0 +1,26 @@
1
+ mmcbrs232/MDP.py,sha256=rw09OnzA2_W-k0etmjR_MgREEj1cO8V7mRmxvmy9m8E,1110
2
+ mmcbrs232/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ mmcbrs232/broker_and_workers.py,sha256=tpxzJgoBwjEflxatfpMeES19vfe3iqTMo_soEPXTAoA,19597
4
+ mmcbrs232/common.py,sha256=i7mu_eLoCLdq8f0Fqdu66npOfWKKtZDgX4X2FRfwTQQ,100626
5
+ mmcbrs232/detect.py,sha256=OPToFRTKa5ULBqdVGVD1olM-qq5PnG63633gjiMaxto,46161
6
+ mmcbrs232/dmm.py,sha256=vhH7fLFf73UapKbdLovlRp6i2wecnudZjA2z89og4bk,6394
7
+ mmcbrs232/dmm_interface.py,sha256=eUnLg6Mmb9zxxccjV793s1g3Yuwbu9SQ6j8EtJuFhEg,5411
8
+ mmcbrs232/iv.py,sha256=3vRn84bQCdR4UbBZhjllyF9-bCT1aDFEtzXzH9vm_BY,116197
9
+ mmcbrs232/lexicon.py,sha256=Cm_rbe3h4Yshw-f5SfYrPoz6HoSIsFXimY8u_sLokis,25537
10
+ mmcbrs232/liveplot.py,sha256=ZSgHK9cozj6ERWh7OsVxseTqSe9jHs1mxQDTia-nfzs,12231
11
+ mmcbrs232/mdbroker.py,sha256=adYBqYEVN1YgX5Tud-gNlV--8ZIoHqNBrRal8QIaaiw,10403
12
+ mmcbrs232/mdcliapi.py,sha256=SJHTgX_xzv91S1JhVayFP1azBujaz6zxuNCIoMA4nBo,3311
13
+ mmcbrs232/mdclientlib.py,sha256=dXLeLnQiXaVnymmahHWrST6b-U8-A7efqmLplX2drK8,8194
14
+ mmcbrs232/mdwrkapi.py,sha256=0uGWTjwOjEtKaowuMiB-pxV_o5B6gAAoDvanYGNKQbM,5939
15
+ mmcbrs232/psuset.py,sha256=xyMJuv3YjaxfigTE1zKYmgbxGdK1yyon771TQxPzfVo,38610
16
+ mmcbrs232/psustat.py,sha256=Y04XeFLUrE3tyEpeVyxkdSmzfy5b6K1OHbqvTRpb0nc,32612
17
+ mmcbrs232/psuwatch.py,sha256=4qPf12XcJmZ6Pry8Po-DLUB-4BpyVhjEwAdEzvCr-8g,21947
18
+ mmcbrs232/sequence.py,sha256=9VUOgABjQHYVG-d53SvL7Qr-RuTstYN1kTia6c_04Pc,17683
19
+ mmcbrs232/ult80.py,sha256=GVQnPiXjfobRHBt0NqAJhhBW_GP-YuFiUhe7GTy2gLc,18564
20
+ mmcbrs232/zhelpers.py,sha256=aJkcSgI7PGmajA_OHlNpdonrPMG65u0hahykduG9N3M,1566
21
+ mmcbrs232/zpsustat.py,sha256=FXNF8KklXW2pggS4QRu9K5tW2y_M9haJSjzTAjQBJ3o,1991
22
+ mmcb_rs232_avt-1.1.37.dist-info/METADATA,sha256=zm-HkXYO9akIupcsGVqO7gkZqKWsXe5_bdeH6svdPcs,10398
23
+ mmcb_rs232_avt-1.1.37.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
24
+ mmcb_rs232_avt-1.1.37.dist-info/entry_points.txt,sha256=ci8F-1C0MhgCIHGW9vcaf6hjMlRNKVtYynM0ZupyS1Y,381
25
+ mmcb_rs232_avt-1.1.37.dist-info/top_level.txt,sha256=xLFfE3WF9YiVLK6xBmwyjvHlf_W66C16Ct0hhMt_b_k,10
26
+ mmcb_rs232_avt-1.1.37.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,12 @@
1
+ [console_scripts]
2
+ detect = mmcbrs232.detect:main
3
+ dmm = mmcbrs232.dmm:main
4
+ iv = mmcbrs232.iv:main
5
+ liveplot = mmcbrs232.liveplot:main
6
+ log2dat = mmcbrs232.log2dat:main
7
+ psuset = mmcbrs232.psuset:main
8
+ psustat = mmcbrs232.psustat:main
9
+ psuwatch = mmcbrs232.psuwatch:main
10
+ rs232_zmq_server = mmcbrs232.broker_and_workers:main
11
+ ult80 = mmcbrs232.ult80:main
12
+ zpsustat = mmcbrs232.zpsustat:main
@@ -0,0 +1 @@
1
+ mmcbrs232
mmcbrs232/MDP.py ADDED
@@ -0,0 +1,35 @@
1
+ """Majordomo Protocol definitions"""
2
+ # This is the version of MDP/Client we implement
3
+ C_CLIENT = b"MDPC01"
4
+
5
+ # This is the version of MDP/Worker we implement
6
+ W_WORKER = b"MDPW01"
7
+
8
+ # MDP/Server commands, as strings
9
+ W_READY = b"\001"
10
+ W_REQUEST = b"\002"
11
+ W_REPLY = b"\003"
12
+ W_HEARTBEAT = b"\004"
13
+ W_DISCONNECT = b"\005"
14
+
15
+ commands = [None, b"READY", b"REQUEST", b"REPLY", b"HEARTBEAT", b"DISCONNECT"]
16
+
17
+
18
+ # Note, Python3 type "bytes" are essentially what Python2 "str" were,
19
+ # but now we have to explicitly mark them as such. Type "bytes" are
20
+ # what PyZMQ expects by default. Any user code that uses this and
21
+ # related modules may need to be updated. Here are some guidelines:
22
+ #
23
+ # String literals that make their way into messages or used as socket
24
+ # identfiers need to become bytes:
25
+ #
26
+ # 'foo' -> b'foo'
27
+ #
28
+ # Multippart messages, originally formed as lists of strings (smsg)
29
+ # need to be washed into strings of bytes (bmsg) like:
30
+ #
31
+ # bmsg = [one.encode('utf-8') for one in smsg]
32
+ #
33
+ # A multipart message recived can be reversed
34
+ #
35
+ # smsg = [one.decode() for one in bmsg]