cgse-common 2023.1.4__py3-none-any.whl → 2024.1.4__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.
@@ -1,31 +1,35 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cgse-common
3
- Version: 2023.1.4
4
- Summary: Software framework to support testing hardware
5
- Author: Rik Huygen
6
- Author-email: rik.huygen@kuleuven.be
7
- Requires-Python: >=3.8,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Requires-Dist: GitPython (>=3.1.40,<4.0.0)
14
- Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
15
- Requires-Dist: click (>=8.1.7,<9.0.0)
16
- Requires-Dist: deepdiff (>=6.6.1,<7.0.0)
17
- Requires-Dist: distro (>=1.8.0,<2.0.0)
18
- Requires-Dist: numpy
19
- Requires-Dist: pandas
20
- Requires-Dist: prometheus-client (>=0.17.1,<0.18.0)
21
- Requires-Dist: psutil (>=5.9.6,<6.0.0)
22
- Requires-Dist: pyzmq (>=25.1.1,<26.0.0)
23
- Requires-Dist: rich (>=13.6.0,<14.0.0)
3
+ Version: 2024.1.4
4
+ Summary: Software framework to support hardware testing
5
+ Author: IVS KU Leuven
6
+ Maintainer-email: Rik Huygen <rik.huygen@kuleuven.be>, Sara Regibo <sara.regibo@kuleuven.be>
7
+ License-Expression: MIT
8
+ Keywords: CGSE,Common-EGSE,hardware testing,software framework
9
+ Requires-Python: >=3.9
10
+ Requires-Dist: click>=8.1.8
11
+ Requires-Dist: deepdiff>=8.1.1
12
+ Requires-Dist: distro>=1.9.0
13
+ Requires-Dist: gitpython>=3.1.44
14
+ Requires-Dist: numpy==1.22.4
15
+ Requires-Dist: pandas>=1.5.1
16
+ Requires-Dist: pip>=24.3.1
17
+ Requires-Dist: prometheus-client>=0.21.1
18
+ Requires-Dist: psutil>=6.1.1
19
+ Requires-Dist: pyyaml>=6.0.2
20
+ Requires-Dist: pyzmq==23.2.1
21
+ Requires-Dist: rich>=13.9.4
24
22
  Description-Content-Type: text/markdown
25
23
 
26
- # Generic Functionality used in the PLATO Common-EGSE
27
24
 
28
- This package 'cgse-common' contains functionality that is used by all `cgse` sub-packages, but it is designed to be a stand-alone generic package that can be used in any other project.
25
+ ![PyPI - Version](https://img.shields.io/pypi/v/cgse-common)
26
+ ![Supported OS](https://img.shields.io/badge/Supported%20OS-Linux%20%7C%20macOS-blue)
27
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FIvS-KULeuven%2Fcgse%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
28
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/cgse-common)
29
+
30
+ # Generic Functionality used in the Common-EGSE
31
+
32
+ This package 'cgse-common' contains functionality that is used by all `cgse` sub-packages, but it is designed to be a stand-alone generic package that can be used also in any other project.
29
33
 
30
34
 
31
35
  ## Installation
@@ -56,4 +60,3 @@ A non-comprehensive list of available functionality:
56
60
  * **egse.resource**: provides convenience functions to use resources in your code without the need to specify an absolute path
57
61
  * **egse.system**: defines convenience functions that provide information on system specific functionality like, file system interactions, timing, operating system interactions, etc.
58
62
  * **egse.version**: functionality to retrieve the package version information
59
-
@@ -0,0 +1,36 @@
1
+ egse/bits.py,sha256=1DPcC5R-8w-KLfbr2WLx-4Ezfwm6jpRMz-E5QfQ_YKw,11138
2
+ egse/calibration.py,sha256=DZ-LgEwamTWDukMqTr2JLCPt3M1lw6W0SfpHQfG7cXg,8989
3
+ egse/command.py,sha256=hGY-M618clxW5x5cLx79hHFiFgENkJ7S3Nj5Wacow4M,22879
4
+ egse/config.py,sha256=Ib1Ddt0wFwRrioBvMs7Md-wgEEPdK3eaXCt0H7HJEow,14888
5
+ egse/control.py,sha256=gM9II-BgtgJjG7NqxyY8nBtMiRD0b9azGYFeD9_WU6s,12816
6
+ egse/decorators.py,sha256=M0PavrPcTwhWS6yLlEo-mOS20lcy90Mym7HUVzPNmhs,13404
7
+ egse/device.py,sha256=SIMROwB9YdNdFowTcZp1HW_el8LWVWDJ5tDUxs58YuY,8500
8
+ egse/env.py,sha256=xVWhR4CKdGNho5sjIkfkXBj---VawHgD3ne029CWg-A,20960
9
+ egse/exceptions.py,sha256=Tc1xqUrWxV6SXxc9xB9viK_O-GVa_SpzqZUVEhZkwzA,1801
10
+ egse/hk.py,sha256=MOX9KgkBkEpAtWniHXc8IWHyravp3OqTV4ZIuzmr93s,31141
11
+ egse/metrics.py,sha256=cZKMEe3OTT2uomj7vXjEl54JD0CStfEC4nCgS6U5YSM,3794
12
+ egse/mixin.py,sha256=J3yu5lPnm0grJqIm5LiacBUCZujJsdcKBNRaOQcMnNo,17345
13
+ egse/monitoring.py,sha256=-pwXqPoiNKzQYKQSpKddFlaPkCTJZYdxvG1d2MBN3l0,3033
14
+ egse/observer.py,sha256=6faaLHqgpOQs_oEvdBygQ5HF7mGneKJEfyQEFUFA5VY,1069
15
+ egse/obsid.py,sha256=-HPuHApZrr3Nj1J2-qqnIiE814C-gm4FSHdM2afKdRY,5883
16
+ egse/persistence.py,sha256=Lx6LMJ1-dh8N43XF7tTM6RwD0sSETiGQ9DNqug-G-zQ,2160
17
+ egse/plugin.py,sha256=Fd_QnABm33_dLjaj1zDgEZr3RKy-N88U5Hz5OZm9Jj0,2684
18
+ egse/process.py,sha256=mQ2ojeL_9oE_QkMJlQDPd1290z0j2mOrGXrlrWtOtzI,16615
19
+ egse/protocol.py,sha256=Psy0iOLPTgARn1VqeKtPCSKepHr_S2KW58UYwjOA6J0,23827
20
+ egse/proxy.py,sha256=pMKdnF62SXm0quLoKfgvK9GFkH2mLMB5fWNrZenfqQQ,18100
21
+ egse/reload.py,sha256=rDT0bC6RFeRhW38wSgFcxr30h8FvaKkoGp_OE-AwBB4,4388
22
+ egse/resource.py,sha256=VoB7BVrQULT_SJ1XioDzB59-uH47nUcN-KNVLvFxiFE,15163
23
+ egse/response.py,sha256=WdUUgYe1ABhPAy1HL8lVCM3Gu0Vgy3niaRi_twZuLgo,2700
24
+ egse/services.py,sha256=ZgkF0Rx_PykOVHAOV1cKduJdUhuY6A4DgwjPJWRGj3U,7642
25
+ egse/services.yaml,sha256=p8QBF56zLI21iJ9skt65VlNz4rIqRoFfBTZxOIUZCZ4,1853
26
+ egse/settings.py,sha256=iu17w0xvLhZPXImOt_C3duy2XamClQpKuP-OkCEIZVo,13481
27
+ egse/settings.yaml,sha256=M6WMtTbNqNuXsdEf-OzKz0dAxkFTRabpugmIJ2HKyZk,290
28
+ egse/setup.py,sha256=NLS0RhMTvKpdHnnojSPCcfRJwPGkpijt5VLFcDfnbt8,42916
29
+ egse/state.py,sha256=ekcCZu_DZKkKYn-5iWG7ij7Aif2WYMNVs5h3cia-cVc,5352
30
+ egse/system.py,sha256=t2NrtTAPXbMgBxsqicGjti-b8oEmiHtQu2Ydm77q4lI,48941
31
+ egse/version.py,sha256=EigdH05E8pNtSQznUfqM_RxlOjuAVp3Oe6S6MM5xGIM,6132
32
+ egse/zmq_ser.py,sha256=2-nwVUBWZ3vvosKNmlWobHJrIJA2HlM3V5a63Gz2JY0,1819
33
+ cgse_common-2024.1.4.dist-info/METADATA,sha256=LHmBLvWnmMYftLr6hTg9Z3nbH3_kNoIr1RHNi_6XdEM,2574
34
+ cgse_common-2024.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ cgse_common-2024.1.4.dist-info/entry_points.txt,sha256=E-KaQ9NGWAP1XvLHncNxq5oa22EAf9sOpBZWphXcxiE,34
36
+ cgse_common-2024.1.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.7.0
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [cgse.version]
2
+ cgse-common = egse
egse/bits.py CHANGED
@@ -1,6 +1,7 @@
1
1
  """
2
2
  This module contains a number of convenience functions to work with bits, bytes and integers.
3
3
  """
4
+
4
5
  import ctypes
5
6
  from typing import Union
6
7
 
@@ -111,7 +112,7 @@ def bits_set(value: int, *args) -> bool:
111
112
  return all([bit_set(value, bit) for bit in args])
112
113
 
113
114
 
114
- def beautify_binary(value: int, sep: str = ' ', group: int = 8, prefix: str = '', size: int = 0):
115
+ def beautify_binary(value: int, sep: str = " ", group: int = 8, prefix: str = "", size: int = 0):
115
116
  """
116
117
  Returns a binary representation of the given value. The bits are presented
117
118
  in groups of 8 bits for clarity by default (can be changed with the `group` keyword).
@@ -136,9 +137,9 @@ def beautify_binary(value: int, sep: str = ' ', group: int = 8, prefix: str = ''
136
137
  while value > 2**size - 1:
137
138
  size += 8
138
139
 
139
- b_str = f'{value:0{size}b}'
140
+ b_str = f"{value:0{size}b}"
140
141
 
141
- return prefix + sep.join([b_str[i:i + group] for i in range(0, len(b_str), group)])
142
+ return prefix + sep.join([b_str[i : i + group] for i in range(0, len(b_str), group)])
142
143
 
143
144
 
144
145
  def humanize_bytes(n: int, base: Union[int, str] = 2, precision: int = 3) -> str:
@@ -174,11 +175,11 @@ def humanize_bytes(n: int, base: Union[int, str] = 2, precision: int = 3) -> str
174
175
  # By default we assume base == 2 or base == "binary"
175
176
 
176
177
  one_kilo = 1024
177
- units = ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
178
+ units = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
178
179
 
179
- if base == 10 or base == 'decimal':
180
+ if base == 10 or base == "decimal":
180
181
  one_kilo = 1000
181
- units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
182
+ units = ["kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
182
183
 
183
184
  _n = n
184
185
  if _n < one_kilo:
@@ -193,38 +194,262 @@ def humanize_bytes(n: int, base: Union[int, str] = 2, precision: int = 3) -> str
193
194
 
194
195
 
195
196
  CRC_TABLE = [
196
- 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
197
- 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b,
198
- 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69,
199
- 0x12, 0x83, 0xf1, 0x60, 0x15, 0x84, 0xf6, 0x67,
200
- 0x38, 0xa9, 0xdb, 0x4a, 0x3f, 0xae, 0xdc, 0x4d,
201
- 0x36, 0xa7, 0xd5, 0x44, 0x31, 0xa0, 0xd2, 0x43,
202
- 0x24, 0xb5, 0xc7, 0x56, 0x23, 0xb2, 0xc0, 0x51,
203
- 0x2a, 0xbb, 0xc9, 0x58, 0x2d, 0xbc, 0xce, 0x5f,
204
- 0x70, 0xe1, 0x93, 0x02, 0x77, 0xe6, 0x94, 0x05,
205
- 0x7e, 0xef, 0x9d, 0x0c, 0x79, 0xe8, 0x9a, 0x0b,
206
- 0x6c, 0xfd, 0x8f, 0x1e, 0x6b, 0xfa, 0x88, 0x19,
207
- 0x62, 0xf3, 0x81, 0x10, 0x65, 0xf4, 0x86, 0x17,
208
- 0x48, 0xd9, 0xab, 0x3a, 0x4f, 0xde, 0xac, 0x3d,
209
- 0x46, 0xd7, 0xa5, 0x34, 0x41, 0xd0, 0xa2, 0x33,
210
- 0x54, 0xc5, 0xb7, 0x26, 0x53, 0xc2, 0xb0, 0x21,
211
- 0x5a, 0xcb, 0xb9, 0x28, 0x5d, 0xcc, 0xbe, 0x2f,
212
- 0xe0, 0x71, 0x03, 0x92, 0xe7, 0x76, 0x04, 0x95,
213
- 0xee, 0x7f, 0x0d, 0x9c, 0xe9, 0x78, 0x0a, 0x9b,
214
- 0xfc, 0x6d, 0x1f, 0x8e, 0xfb, 0x6a, 0x18, 0x89,
215
- 0xf2, 0x63, 0x11, 0x80, 0xf5, 0x64, 0x16, 0x87,
216
- 0xd8, 0x49, 0x3b, 0xaa, 0xdf, 0x4e, 0x3c, 0xad,
217
- 0xd6, 0x47, 0x35, 0xa4, 0xd1, 0x40, 0x32, 0xa3,
218
- 0xc4, 0x55, 0x27, 0xb6, 0xc3, 0x52, 0x20, 0xb1,
219
- 0xca, 0x5b, 0x29, 0xb8, 0xcd, 0x5c, 0x2e, 0xbf,
220
- 0x90, 0x01, 0x73, 0xe2, 0x97, 0x06, 0x74, 0xe5,
221
- 0x9e, 0x0f, 0x7d, 0xec, 0x99, 0x08, 0x7a, 0xeb,
222
- 0x8c, 0x1d, 0x6f, 0xfe, 0x8b, 0x1a, 0x68, 0xf9,
223
- 0x82, 0x13, 0x61, 0xf0, 0x85, 0x14, 0x66, 0xf7,
224
- 0xa8, 0x39, 0x4b, 0xda, 0xaf, 0x3e, 0x4c, 0xdd,
225
- 0xa6, 0x37, 0x45, 0xd4, 0xa1, 0x30, 0x42, 0xd3,
226
- 0xb4, 0x25, 0x57, 0xc6, 0xb3, 0x22, 0x50, 0xc1,
227
- 0xba, 0x2b, 0x59, 0xc8, 0xbd, 0x2c, 0x5e, 0xcf,
197
+ 0x00,
198
+ 0x91,
199
+ 0xE3,
200
+ 0x72,
201
+ 0x07,
202
+ 0x96,
203
+ 0xE4,
204
+ 0x75,
205
+ 0x0E,
206
+ 0x9F,
207
+ 0xED,
208
+ 0x7C,
209
+ 0x09,
210
+ 0x98,
211
+ 0xEA,
212
+ 0x7B,
213
+ 0x1C,
214
+ 0x8D,
215
+ 0xFF,
216
+ 0x6E,
217
+ 0x1B,
218
+ 0x8A,
219
+ 0xF8,
220
+ 0x69,
221
+ 0x12,
222
+ 0x83,
223
+ 0xF1,
224
+ 0x60,
225
+ 0x15,
226
+ 0x84,
227
+ 0xF6,
228
+ 0x67,
229
+ 0x38,
230
+ 0xA9,
231
+ 0xDB,
232
+ 0x4A,
233
+ 0x3F,
234
+ 0xAE,
235
+ 0xDC,
236
+ 0x4D,
237
+ 0x36,
238
+ 0xA7,
239
+ 0xD5,
240
+ 0x44,
241
+ 0x31,
242
+ 0xA0,
243
+ 0xD2,
244
+ 0x43,
245
+ 0x24,
246
+ 0xB5,
247
+ 0xC7,
248
+ 0x56,
249
+ 0x23,
250
+ 0xB2,
251
+ 0xC0,
252
+ 0x51,
253
+ 0x2A,
254
+ 0xBB,
255
+ 0xC9,
256
+ 0x58,
257
+ 0x2D,
258
+ 0xBC,
259
+ 0xCE,
260
+ 0x5F,
261
+ 0x70,
262
+ 0xE1,
263
+ 0x93,
264
+ 0x02,
265
+ 0x77,
266
+ 0xE6,
267
+ 0x94,
268
+ 0x05,
269
+ 0x7E,
270
+ 0xEF,
271
+ 0x9D,
272
+ 0x0C,
273
+ 0x79,
274
+ 0xE8,
275
+ 0x9A,
276
+ 0x0B,
277
+ 0x6C,
278
+ 0xFD,
279
+ 0x8F,
280
+ 0x1E,
281
+ 0x6B,
282
+ 0xFA,
283
+ 0x88,
284
+ 0x19,
285
+ 0x62,
286
+ 0xF3,
287
+ 0x81,
288
+ 0x10,
289
+ 0x65,
290
+ 0xF4,
291
+ 0x86,
292
+ 0x17,
293
+ 0x48,
294
+ 0xD9,
295
+ 0xAB,
296
+ 0x3A,
297
+ 0x4F,
298
+ 0xDE,
299
+ 0xAC,
300
+ 0x3D,
301
+ 0x46,
302
+ 0xD7,
303
+ 0xA5,
304
+ 0x34,
305
+ 0x41,
306
+ 0xD0,
307
+ 0xA2,
308
+ 0x33,
309
+ 0x54,
310
+ 0xC5,
311
+ 0xB7,
312
+ 0x26,
313
+ 0x53,
314
+ 0xC2,
315
+ 0xB0,
316
+ 0x21,
317
+ 0x5A,
318
+ 0xCB,
319
+ 0xB9,
320
+ 0x28,
321
+ 0x5D,
322
+ 0xCC,
323
+ 0xBE,
324
+ 0x2F,
325
+ 0xE0,
326
+ 0x71,
327
+ 0x03,
328
+ 0x92,
329
+ 0xE7,
330
+ 0x76,
331
+ 0x04,
332
+ 0x95,
333
+ 0xEE,
334
+ 0x7F,
335
+ 0x0D,
336
+ 0x9C,
337
+ 0xE9,
338
+ 0x78,
339
+ 0x0A,
340
+ 0x9B,
341
+ 0xFC,
342
+ 0x6D,
343
+ 0x1F,
344
+ 0x8E,
345
+ 0xFB,
346
+ 0x6A,
347
+ 0x18,
348
+ 0x89,
349
+ 0xF2,
350
+ 0x63,
351
+ 0x11,
352
+ 0x80,
353
+ 0xF5,
354
+ 0x64,
355
+ 0x16,
356
+ 0x87,
357
+ 0xD8,
358
+ 0x49,
359
+ 0x3B,
360
+ 0xAA,
361
+ 0xDF,
362
+ 0x4E,
363
+ 0x3C,
364
+ 0xAD,
365
+ 0xD6,
366
+ 0x47,
367
+ 0x35,
368
+ 0xA4,
369
+ 0xD1,
370
+ 0x40,
371
+ 0x32,
372
+ 0xA3,
373
+ 0xC4,
374
+ 0x55,
375
+ 0x27,
376
+ 0xB6,
377
+ 0xC3,
378
+ 0x52,
379
+ 0x20,
380
+ 0xB1,
381
+ 0xCA,
382
+ 0x5B,
383
+ 0x29,
384
+ 0xB8,
385
+ 0xCD,
386
+ 0x5C,
387
+ 0x2E,
388
+ 0xBF,
389
+ 0x90,
390
+ 0x01,
391
+ 0x73,
392
+ 0xE2,
393
+ 0x97,
394
+ 0x06,
395
+ 0x74,
396
+ 0xE5,
397
+ 0x9E,
398
+ 0x0F,
399
+ 0x7D,
400
+ 0xEC,
401
+ 0x99,
402
+ 0x08,
403
+ 0x7A,
404
+ 0xEB,
405
+ 0x8C,
406
+ 0x1D,
407
+ 0x6F,
408
+ 0xFE,
409
+ 0x8B,
410
+ 0x1A,
411
+ 0x68,
412
+ 0xF9,
413
+ 0x82,
414
+ 0x13,
415
+ 0x61,
416
+ 0xF0,
417
+ 0x85,
418
+ 0x14,
419
+ 0x66,
420
+ 0xF7,
421
+ 0xA8,
422
+ 0x39,
423
+ 0x4B,
424
+ 0xDA,
425
+ 0xAF,
426
+ 0x3E,
427
+ 0x4C,
428
+ 0xDD,
429
+ 0xA6,
430
+ 0x37,
431
+ 0x45,
432
+ 0xD4,
433
+ 0xA1,
434
+ 0x30,
435
+ 0x42,
436
+ 0xD3,
437
+ 0xB4,
438
+ 0x25,
439
+ 0x57,
440
+ 0xC6,
441
+ 0xB3,
442
+ 0x22,
443
+ 0x50,
444
+ 0xC1,
445
+ 0xBA,
446
+ 0x2B,
447
+ 0x59,
448
+ 0xC8,
449
+ 0xBD,
450
+ 0x2C,
451
+ 0x5E,
452
+ 0xCF,
228
453
  ]
229
454
 
230
455
 
@@ -251,10 +476,10 @@ def crc_calc(data, start: int, len: int) -> int:
251
476
  # and the individual elements have then type 'bytes'.
252
477
 
253
478
  if isinstance(data[0], bytes):
254
- for idx in range(start, start+len):
255
- crc = CRC_TABLE[crc ^ (int.from_bytes(data[idx], byteorder='big') & 0xFF)]
479
+ for idx in range(start, start + len):
480
+ crc = CRC_TABLE[crc ^ (int.from_bytes(data[idx], byteorder="big") & 0xFF)]
256
481
  elif isinstance(data[0], int):
257
- for idx in range(start, start+len):
482
+ for idx in range(start, start + len):
258
483
  crc = CRC_TABLE[crc ^ (data[idx] & 0xFF)]
259
484
 
260
485
  return crc