cgse-common 2023.1.5__tar.gz → 2024.1.4__tar.gz

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.
Files changed (39) hide show
  1. cgse_common-2024.1.4/.gitignore +35 -0
  2. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/PKG-INFO +28 -25
  3. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/README.md +8 -2
  4. cgse_common-2024.1.4/pyproject.toml +80 -0
  5. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/bits.py +266 -41
  6. cgse_common-2024.1.4/src/egse/calibration.py +250 -0
  7. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/command.py +10 -29
  8. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/config.py +17 -12
  9. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/control.py +0 -81
  10. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/decorators.py +8 -8
  11. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/device.py +3 -1
  12. cgse_common-2024.1.4/src/egse/env.py +592 -0
  13. cgse_common-2024.1.4/src/egse/hk.py +794 -0
  14. cgse_common-2024.1.4/src/egse/metrics.py +106 -0
  15. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/resource.py +70 -2
  16. cgse_common-2024.1.4/src/egse/response.py +101 -0
  17. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/settings.py +33 -31
  18. cgse_common-2024.1.4/src/egse/settings.yaml +7 -0
  19. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/setup.py +116 -81
  20. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/system.py +32 -13
  21. cgse_common-2023.1.5/pyproject.toml +0 -51
  22. cgse_common-2023.1.5/src/egse/env.py +0 -287
  23. cgse_common-2023.1.5/src/egse/settings.yaml +0 -981
  24. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/exceptions.py +0 -0
  25. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/mixin.py +0 -0
  26. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/monitoring.py +0 -0
  27. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/observer.py +0 -0
  28. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/obsid.py +0 -0
  29. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/persistence.py +0 -0
  30. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/plugin.py +0 -0
  31. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/process.py +0 -0
  32. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/protocol.py +0 -0
  33. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/proxy.py +0 -0
  34. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/reload.py +0 -0
  35. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/services.py +0 -0
  36. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/services.yaml +0 -0
  37. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/state.py +0 -0
  38. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/version.py +0 -0
  39. {cgse_common-2023.1.5 → cgse_common-2024.1.4}/src/egse/zmq_ser.py +0 -0
@@ -0,0 +1,35 @@
1
+ # Python versions and environment
2
+
3
+ __pycache__
4
+ .python-version
5
+ .envrc
6
+
7
+ # Build systems
8
+
9
+ build
10
+ dist
11
+ **/*.egg-info
12
+
13
+ # Apple specific
14
+
15
+ .DS_Store
16
+
17
+ # Unit testing
18
+
19
+ .pytest_cache
20
+ .coverage
21
+ htmlcov
22
+
23
+ # Virtual environments
24
+
25
+ .env
26
+ .venv
27
+ venv
28
+
29
+ # PyCharm IDE
30
+
31
+ .idea
32
+
33
+ # Packaging
34
+
35
+ uv.lock
@@ -1,31 +1,35 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cgse-common
3
- Version: 2023.1.5
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
-
@@ -1,6 +1,12 @@
1
- # Generic Functionality used in the PLATO Common-EGSE
2
1
 
3
- 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.
2
+ ![PyPI - Version](https://img.shields.io/pypi/v/cgse-common)
3
+ ![Supported OS](https://img.shields.io/badge/Supported%20OS-Linux%20%7C%20macOS-blue)
4
+ ![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)
5
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/cgse-common)
6
+
7
+ # Generic Functionality used in the Common-EGSE
8
+
9
+ 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.
4
10
 
5
11
 
6
12
  ## Installation
@@ -0,0 +1,80 @@
1
+ [project]
2
+ name = "cgse-common"
3
+ version = "2024.1.4"
4
+ description = "Software framework to support hardware testing"
5
+ authors = [
6
+ {name = "IVS KU Leuven"}
7
+ ]
8
+ maintainers = [
9
+ {name = "Rik Huygen", email = "rik.huygen@kuleuven.be"},
10
+ {name = "Sara Regibo", email = "sara.regibo@kuleuven.be"}
11
+ ]
12
+ readme = {"file" = "README.md", "content-type" = "text/markdown"}
13
+ requires-python = ">=3.9"
14
+ license = "MIT"
15
+ keywords = [
16
+ "CGSE",
17
+ "Common-EGSE",
18
+ "hardware testing",
19
+ "software framework"
20
+ ]
21
+ dependencies = [
22
+ "click>=8.1.8",
23
+ "deepdiff>=8.1.1",
24
+ "distro>=1.9.0",
25
+ "gitpython>=3.1.44",
26
+ "numpy==1.22.4",
27
+ "pandas>=1.5.1",
28
+ "pip>=24.3.1", # only used in setup
29
+ "prometheus-client>=0.21.1",
30
+ "psutil>=6.1.1",
31
+ "pyyaml>=6.0.2",
32
+ "pyzmq == 23.2.1",
33
+ "rich>=13.9.4",
34
+ ]
35
+
36
+ [project.entry-points."cgse.version"]
37
+ cgse-common = 'egse'
38
+
39
+ [tool.pytest.ini_options]
40
+ pythonpath = "src"
41
+ testpaths = ["tests"]
42
+ addopts = "-ra --cov --cov-report html"
43
+ filterwarnings = [
44
+ "ignore::DeprecationWarning"
45
+ ]
46
+
47
+ [tool.coverage.run]
48
+ omit = [
49
+ "tests/*",
50
+ ]
51
+
52
+ [tool.hatch.build.targets.sdist]
53
+ exclude = [
54
+ "/tests",
55
+ "/pytest.ini",
56
+ "/.gitignore",
57
+ "/*poetry*",
58
+ "/*setuptools*",
59
+ ]
60
+
61
+ [tool.hatch.build.targets.wheel]
62
+ packages = ["src/egse"]
63
+
64
+ [tool.ruff]
65
+ line-length = 120
66
+
67
+ [tool.ruff.lint]
68
+ extend-select = ["E", "W"]
69
+
70
+ [build-system]
71
+ requires = ["hatchling"]
72
+ build-backend = "hatchling.build"
73
+
74
+ [dependency-groups]
75
+ dev = [
76
+ "pytest>=8.3.4",
77
+ "pytest-cov>=6.0.0",
78
+ "pytest-mock>=3.14.0",
79
+ "ruff>=0.9.0",
80
+ ]
@@ -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