etho-python 1.2.2__tar.gz → 1.2.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 (129) hide show
  1. {etho_python-1.2.2 → etho_python-1.2.4}/PKG-INFO +5 -3
  2. etho_python-1.2.4/docs/api/etho.services.camera.spinnaker_old.rst +5 -0
  3. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api_etho.rst +1 -1
  4. {etho_python-1.2.2 → etho_python-1.2.4}/pyproject.toml +3 -3
  5. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/DAQZeroService.py +5 -11
  6. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/callbacks/_image.py +55 -62
  7. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/callbacks/_trace.py +13 -6
  8. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/spinnaker.py +20 -28
  9. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/spinnaker_old.py +1 -2
  10. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/daq/IOTask.py +16 -16
  11. etho_python-1.2.4/tests/test_daq_playlist.py +42 -0
  12. etho_python-1.2.4/tests/test_zarr_callbacks.py +18 -0
  13. etho_python-1.2.2/docs/api/etho.utils.shuffled_cycle.rst +0 -5
  14. etho_python-1.2.2/src/etho/services/daq/ai.py +0 -174
  15. etho_python-1.2.2/src/etho/utils/shuffled_cycle.py +0 -45
  16. etho_python-1.2.2/tests/test_shuffled_cycle.py +0 -12
  17. {etho_python-1.2.2 → etho_python-1.2.4}/.github/workflows/draft-pdf.yml +0 -0
  18. {etho_python-1.2.2 → etho_python-1.2.4}/.github/workflows/python-package.yml +0 -0
  19. {etho_python-1.2.2 → etho_python-1.2.4}/.github/workflows/static.yml +0 -0
  20. {etho_python-1.2.2 → etho_python-1.2.4}/.gitignore +0 -0
  21. {etho_python-1.2.2 → etho_python-1.2.4}/CITATION.cff +0 -0
  22. {etho_python-1.2.2 → etho_python-1.2.4}/CONTRIBUTING.md +0 -0
  23. {etho_python-1.2.2 → etho_python-1.2.4}/LICENSE +0 -0
  24. {etho_python-1.2.2 → etho_python-1.2.4}/README.md +0 -0
  25. {etho_python-1.2.2 → etho_python-1.2.4}/docs/Makefile +0 -0
  26. {etho_python-1.2.2 → etho_python-1.2.4}/docs/README.md +0 -0
  27. {etho_python-1.2.2 → etho_python-1.2.4}/docs/_static/etho_dark.svg +0 -0
  28. {etho_python-1.2.2 → etho_python-1.2.4}/docs/_static/etho_light.svg +0 -0
  29. {etho_python-1.2.2 → etho_python-1.2.4}/docs/_templates/api_head.rst +0 -0
  30. {etho_python-1.2.2 → etho_python-1.2.4}/docs/_templates/autosummary/module.rst +0 -0
  31. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.app.rst +0 -0
  32. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.cli.rst +0 -0
  33. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.client.rst +0 -0
  34. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.BLTZeroService.rst +0 -0
  35. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.DAQZeroService.rst +0 -0
  36. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.GCMZeroService.rst +0 -0
  37. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.GOVZeroService.rst +0 -0
  38. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.NICounterZeroService.rst +0 -0
  39. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.TemplateZeroService.rst +0 -0
  40. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.ZeroService.rst +0 -0
  41. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.base.rst +0 -0
  42. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.basler.rst +0 -0
  43. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.dummy.rst +0 -0
  44. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.hamamatsu.rst +0 -0
  45. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.spinnaker.rst +0 -0
  46. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.camera.ximea.rst +0 -0
  47. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.dlp.dlp_make_warpfiles.rst +0 -0
  48. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.utils.concurrent_task.rst +0 -0
  49. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.services.utils.log_exceptions.rst +0 -0
  50. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.calibration.rst +0 -0
  51. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.config.rst +0 -0
  52. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.runner.rst +0 -0
  53. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.sound.rst +0 -0
  54. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.tui.rst +0 -0
  55. {etho_python-1.2.2 → etho_python-1.2.4}/docs/api/etho.utils.zeroclient.rst +0 -0
  56. {etho_python-1.2.2 → etho_python-1.2.4}/docs/callbacks.md +0 -0
  57. {etho_python-1.2.2 → etho_python-1.2.4}/docs/cli.md +0 -0
  58. {etho_python-1.2.2 → etho_python-1.2.4}/docs/conf.py +0 -0
  59. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/calibration_led.md +0 -0
  60. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/calibration_speaker.md +0 -0
  61. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/configuration.rst +0 -0
  62. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/global.md +0 -0
  63. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/playlist.md +0 -0
  64. {etho_python-1.2.2 → etho_python-1.2.4}/docs/configuration/protocol.md +0 -0
  65. {etho_python-1.2.2 → etho_python-1.2.4}/docs/extensions.md +0 -0
  66. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/camera.md +0 -0
  67. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/govee.md +0 -0
  68. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/hardware.rst +0 -0
  69. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/nidaq.md +0 -0
  70. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/projector.md +0 -0
  71. {etho_python-1.2.2 → etho_python-1.2.4}/docs/hardware/scanimage.md +0 -0
  72. {etho_python-1.2.2 → etho_python-1.2.4}/docs/index.rst +0 -0
  73. {etho_python-1.2.2 → etho_python-1.2.4}/docs/install.rst +0 -0
  74. {etho_python-1.2.2 → etho_python-1.2.4}/docs/logging.md +0 -0
  75. {etho_python-1.2.2 → etho_python-1.2.4}/docs/make.bat +0 -0
  76. {etho_python-1.2.2 → etho_python-1.2.4}/docs/make_api_doctree.py +0 -0
  77. {etho_python-1.2.2 → etho_python-1.2.4}/docs/tutorial.md +0 -0
  78. {etho_python-1.2.2 → etho_python-1.2.4}/paper/bib.bib +0 -0
  79. {etho_python-1.2.2 → etho_python-1.2.4}/paper/fig_flow.pdf +0 -0
  80. {etho_python-1.2.2 → etho_python-1.2.4}/paper/paper.md +0 -0
  81. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/__init__.py +0 -0
  82. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/app.py +0 -0
  83. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/assets/etho_icon1_pipeline_dark.svg +0 -0
  84. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/assets/etho_icon1_pipeline_light.svg +0 -0
  85. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/cli.py +0 -0
  86. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/client.py +0 -0
  87. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/res_app.py +0 -0
  88. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/resumable.py +0 -0
  89. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/BLTZeroService.py +0 -0
  90. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/DLPZeroService.py +0 -0
  91. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/GCMZeroService.py +0 -0
  92. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/GOVZeroService.py +0 -0
  93. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/NICounterZeroService.py +0 -0
  94. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/ScanImageTriggerZeroService.py +0 -0
  95. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/TemplateZeroService.py +0 -0
  96. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/ZeroService.py +0 -0
  97. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/__init__.py +0 -0
  98. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/callbacks/__init__.py +0 -0
  99. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/callbacks/_base.py +0 -0
  100. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/__init__.py +0 -0
  101. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/base.py +0 -0
  102. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/basler.py +0 -0
  103. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/dummy.py +0 -0
  104. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/hamamatsu.py +0 -0
  105. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/camera/ximea.py +0 -0
  106. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/dlp/dlp_make_warpfiles.py +0 -0
  107. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/dlp/dlp_runners.py +0 -0
  108. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/resumable.py +0 -0
  109. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/utils/__init__.py +0 -0
  110. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/utils/concurrent_task.py +0 -0
  111. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/services/utils/log_exceptions.py +0 -0
  112. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/__init__.py +0 -0
  113. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/calibration.py +0 -0
  114. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/config.py +0 -0
  115. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/runner.py +0 -0
  116. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/sound.py +0 -0
  117. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/tui.py +0 -0
  118. {etho_python-1.2.2 → etho_python-1.2.4}/src/etho/utils/zeroclient.py +0 -0
  119. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_cli_gui_smoke.py +0 -0
  120. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_config.py +0 -0
  121. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_config.yaml +0 -0
  122. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_gov_service.py +0 -0
  123. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_import.py +0 -0
  124. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_resumable.py +0 -0
  125. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_service_client_wiring.py +0 -0
  126. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_services.py +0 -0
  127. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_sound.py +0 -0
  128. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_sound_playlist_mono.txt +0 -0
  129. {etho_python-1.2.2 → etho_python-1.2.4}/tests/test_sound_playlist_stereo.txt +0 -0
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: etho-python
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: etho
5
5
  Author-email: Jan Clemens <clemensjan@googlemail.com>
6
6
  Requires-Python: >=3.10
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  License-File: LICENSE
10
- Requires-Dist: numpy
10
+ Requires-Dist: numpy<2; python_version < "3.11"
11
+ Requires-Dist: numpy; python_version >= "3.11"
11
12
  Requires-Dist: scipy
12
13
  Requires-Dist: h5py
13
14
  Requires-Dist: opencv-python-headless
@@ -29,7 +30,8 @@ Requires-Dist: pydaqmx
29
30
  Requires-Dist: pyqtgraph
30
31
  Requires-Dist: qtpy
31
32
  Requires-Dist: PySide6-Essentials
32
- Requires-Dist: zarr
33
+ Requires-Dist: zarr>=2,<3; python_version < "3.11"
34
+ Requires-Dist: zarr>=3,<4; python_version >= "3.11"
33
35
  Requires-Dist: zerorpc-numpy
34
36
  Requires-Dist: pytest ; extra == "dev"
35
37
  Requires-Dist: flit>=3.2,<4 ; extra == "dev"
@@ -0,0 +1,5 @@
1
+ etho.services.camera.spinnaker_old
2
+ ==================================
3
+
4
+ .. automodule:: etho.services.camera.spinnaker_old
5
+ :members:
@@ -20,7 +20,6 @@ Developer API
20
20
  etho.utils.calibration
21
21
  etho.utils.config
22
22
  etho.utils.runner
23
- etho.utils.shuffled_cycle
24
23
  etho.utils.sound
25
24
  etho.utils.tui
26
25
  etho.utils.zeroclient
@@ -36,6 +35,7 @@ Developer API
36
35
  etho.services.camera.dummy
37
36
  etho.services.camera.hamamatsu
38
37
  etho.services.camera.spinnaker
38
+ etho.services.camera.spinnaker_old
39
39
  etho.services.camera.ximea
40
40
  etho.services.utils.concurrent_task
41
41
  etho.services.utils.log_exceptions
@@ -11,13 +11,13 @@ classifiers = ["License :: OSI Approved :: MIT License"]
11
11
  dynamic = ["description"]
12
12
  requires-python = ">=3.10"
13
13
  dependencies = [
14
- 'numpy', 'scipy', 'h5py', 'opencv-python-headless', 'bleak',
14
+ 'numpy<2; python_version < "3.11"', 'numpy; python_version >= "3.11"', 'scipy', 'h5py', 'opencv-python-headless', 'bleak',
15
15
  'pandas', 'pyzmq', 'gevent', 'future', 'pillow', 'msgpack-python',
16
16
  'pyyaml', 'ipython', 'defopt', 'msgpack-numpy', 'rich', 'psutil', 'tables',
17
- 'pydaqmx', 'pyqtgraph', 'qtpy', 'PySide6-Essentials', 'zarr', 'zerorpc-numpy'
17
+ 'pydaqmx', 'pyqtgraph', 'qtpy', 'PySide6-Essentials', 'zarr>=2,<3; python_version < "3.11"', 'zarr>=3,<4; python_version >= "3.11"', 'zerorpc-numpy'
18
18
  ]
19
19
  readme= "README.md"
20
- version="1.2.2"
20
+ version="1.2.4"
21
21
 
22
22
  [project.scripts]
23
23
  etho = "etho.cli:main"
@@ -2,9 +2,7 @@ from .ZeroService import BaseZeroService
2
2
  import time
3
3
  import threading
4
4
  import sys
5
- import copy
6
- from itertools import cycle
7
- from typing import Iterable, Sequence, Optional, Dict, Any
5
+ from typing import Sequence, Optional, Dict, Any
8
6
  from . import register_service
9
7
  from .. import config as global_config
10
8
  from ..utils.config import undefaultify
@@ -67,8 +65,6 @@ class DAQ(BaseZeroService):
67
65
  if prot["maxduration"] == -1:
68
66
  logging.info(f"Setting maxduration from playlist to {totallen}.")
69
67
  prot["maxduration"] = totallen
70
- playlist_items = cycle(playlist_items)
71
-
72
68
  if prot[service_key]["digital_chans_out"] is not None:
73
69
  nb_digital_chans_out = len(prot[service_key]["digital_chans_out"])
74
70
  digital_data = [snd[:, -nb_digital_chans_out:].astype(np.uint8) for snd in sounds]
@@ -112,7 +108,7 @@ class DAQ(BaseZeroService):
112
108
  def setup(
113
109
  self,
114
110
  savefilename: str = None,
115
- play_order: Iterable = None,
111
+ play_order: Sequence = None,
116
112
  playlist_info=None,
117
113
  duration: float = -1,
118
114
  fs: int = 10000,
@@ -134,7 +130,7 @@ class DAQ(BaseZeroService):
134
130
 
135
131
  Args:
136
132
  savefilename (str, optional): [description]. Defaults to None.
137
- play_order (Iterable, optional): [description]. Defaults to None.
133
+ play_order (Sequence, optional): [description]. Defaults to None.
138
134
  playlist_info ([type], optional): [description]. Defaults to None.
139
135
  duration (float, optional): [description]. Defaults to -1.
140
136
  fs (int, optional): [description]. Defaults to 10000.
@@ -185,8 +181,7 @@ class DAQ(BaseZeroService):
185
181
  )
186
182
  if analog_data_out[0].shape[-1] is not len(self.analog_chans_out):
187
183
  raise ValueError(f"Number of analog output channels ({len(self.analog_chans_out)}) does not match the number of channels in the sound files ({analog_data_out[0].shape[-1]}).")
188
- play_order_new = copy.deepcopy(play_order)
189
- self.taskAO.data_gen = data_playlist(analog_data_out, play_order_new, playlist_info, self.log, name="AO")
184
+ self.taskAO.data_gen = data_playlist(analog_data_out, play_order, playlist_info, self.log, name="AO")
190
185
  if clock_source is None:
191
186
  self.taskAO.CfgDigEdgeStartTrig("ai/StartTrigger", DAQmx_Val_Rising)
192
187
  else:
@@ -200,8 +195,7 @@ class DAQ(BaseZeroService):
200
195
  clock_source=clock_source,
201
196
  logger=self.log,
202
197
  )
203
- play_order_new = copy.deepcopy(play_order)
204
- self.taskDO.data_gen = data_playlist(digital_data_out, play_order_new, name="DO")
198
+ self.taskDO.data_gen = data_playlist(digital_data_out, play_order, name="DO")
205
199
  if clock_source is None:
206
200
  self.taskDO.CfgDigEdgeStartTrig("ai/StartTrigger", DAQmx_Val_Rising)
207
201
  else:
@@ -1,4 +1,5 @@
1
1
  """Callbacks for processing images."""
2
+
2
3
  import logging
3
4
  from xml.dom import NotFoundErr
4
5
  import numpy as np
@@ -12,18 +13,21 @@ import tables
12
13
 
13
14
  try:
14
15
  import cv2
16
+
15
17
  cv2_import_error = None
16
18
  except ImportError as cv2_import_error:
17
19
  pass
18
20
 
19
21
  try:
20
22
  import ffmpegcv
23
+
21
24
  ffmpegcv_import_error = None
22
25
  except ImportError as ffmpegcv_import_error:
23
26
  pass
24
27
 
25
28
  try:
26
29
  from vidgear.gears import WriteGear
30
+
27
31
  vidgear_import_error = None
28
32
  except ImportError as vidgear_import_error:
29
33
  pass
@@ -32,6 +36,7 @@ try:
32
36
  from qtpy import QtWidgets
33
37
  import pyqtgraph as pg
34
38
  from pyqtgraph.widgets.RawImageWidget import RawImageWidget
39
+
35
40
  pyqtgraph_import_error = None
36
41
  except Exception as pyqtgraph_import_error: # catch generic Exception to cover missing Qt error from pyqtgraph
37
42
  pass
@@ -45,7 +50,6 @@ except Exception as zarr_import_error: # catch generic Exception to cover missi
45
50
  pass
46
51
 
47
52
 
48
-
49
53
  logger = logging.getLogger(__name__)
50
54
 
51
55
 
@@ -73,7 +77,6 @@ class ImageCallback(BaseCallback):
73
77
  @for_all_methods(log_exceptions(logger))
74
78
  @register_callback
75
79
  class ImageDisplayCV2(ImageCallback):
76
-
77
80
  FRIENDLY_NAME = "disp"
78
81
  TIMESTAMPS_ONLY = False
79
82
 
@@ -81,7 +84,7 @@ class ImageDisplayCV2(ImageCallback):
81
84
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
82
85
 
83
86
  if cv2_import_error is not None:
84
- logger.exception('Could not import cv2. Aborting!', exc_info=cv2_import_error)
87
+ logger.exception("Could not import cv2. Aborting!", exc_info=cv2_import_error)
85
88
  raise cv2_import_error
86
89
 
87
90
  logger.info("setting up disp")
@@ -110,7 +113,6 @@ class ImageDisplayCV2(ImageCallback):
110
113
  @for_all_methods(log_exceptions(logger))
111
114
  @register_callback
112
115
  class ImageDisplayPQG(ImageCallback):
113
-
114
116
  FRIENDLY_NAME = "disp_fast"
115
117
  TIMESTAMPS_ONLY = False
116
118
 
@@ -118,7 +120,7 @@ class ImageDisplayPQG(ImageCallback):
118
120
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
119
121
 
120
122
  if pyqtgraph_import_error is not None:
121
- logger.exception('Could not import pyqtgraph. Aborting!', exc_info=pyqtgraph_import_error)
123
+ logger.exception("Could not import pyqtgraph. Aborting!", exc_info=pyqtgraph_import_error)
122
124
  raise pyqtgraph_import_error
123
125
 
124
126
  logger.info("setting up ImageDisplayPQG")
@@ -180,7 +182,7 @@ class ImageWriterCV2(ImageCallback):
180
182
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
181
183
 
182
184
  if cv2_import_error is not None:
183
- logger.exception('Could not import cv2. Aborting!', exc_info=cv2_import_error)
185
+ logger.exception("Could not import cv2. Aborting!", exc_info=cv2_import_error)
184
186
  raise cv2_import_error
185
187
 
186
188
  self.vw = cv2.VideoWriter()
@@ -206,7 +208,6 @@ class ImageWriterCV2(ImageCallback):
206
208
  super()._cleanup()
207
209
 
208
210
 
209
-
210
211
  @for_all_methods(log_exceptions(logger))
211
212
  @register_callback
212
213
  class ImageWriterFCV(ImageCallback):
@@ -232,7 +233,7 @@ class ImageWriterFCV(ImageCallback):
232
233
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
233
234
 
234
235
  if ffmpegcv_import_error is not None:
235
- logger.exception('Could not import ffmpegcv. Aborting!', exc_info=ffmpegcv_import_error)
236
+ logger.exception("Could not import ffmpegcv. Aborting!", exc_info=ffmpegcv_import_error)
236
237
  raise ffmpegcv_import_error
237
238
 
238
239
  # self.vw = ffmpegcv.VideoWriter()
@@ -292,7 +293,7 @@ class ImageWriterCVR(ImageCallback):
292
293
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
293
294
 
294
295
  if vidgear_import_error is not None:
295
- logger.exception('No!', exc_info=vidgear_import_error)
296
+ logger.exception("No!", exc_info=vidgear_import_error)
296
297
  self._cleanup()
297
298
  raise vidgear_import_error
298
299
 
@@ -308,7 +309,6 @@ class ImageWriterCVR(ImageCallback):
308
309
  except:
309
310
  self.vw = WriteGear(output=self.file_name + f"_{self.video_count:06d}" + self.SUFFIX, **self.output_params)
310
311
 
311
-
312
312
  def _loop(self, data):
313
313
  if hasattr(self.data_source, "WHOAMI") and self.data_source.WHOAMI == "array":
314
314
  image = data
@@ -369,7 +369,7 @@ class ImageWriterVidGear(ImageCallback):
369
369
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
370
370
 
371
371
  if vidgear_import_error is not None:
372
- logger.exception('Failed to import VidGear. Closing!', exc_info=vidgear_import_error)
372
+ logger.exception("Failed to import VidGear. Closing!", exc_info=vidgear_import_error)
373
373
  self._cleanup()
374
374
  # raise vidgear_import_error
375
375
 
@@ -398,7 +398,6 @@ class ImageWriterVidGear(ImageCallback):
398
398
  super()._cleanup()
399
399
 
400
400
 
401
-
402
401
  @for_all_methods(log_exceptions(logger))
403
402
  @register_callback
404
403
  class ImageWriterVPF(ImageCallback):
@@ -418,10 +417,11 @@ class ImageWriterVPF(ImageCallback):
418
417
 
419
418
  try:
420
419
  import sys
420
+
421
421
  sys.path.append(VPF_bin_path)
422
422
  import PyNvCodec as nvc
423
423
  except Exception as e:
424
- logging.exception('Could not import PyNvCodec. Quitting.', exc_info=e)
424
+ logging.exception("Could not import PyNvCodec. Quitting.", exc_info=e)
425
425
  self._cleanup()
426
426
 
427
427
  gpuID = 0
@@ -444,9 +444,7 @@ class ImageWriterVPF(ImageCallback):
444
444
  gpuID,
445
445
  )
446
446
  self.nvUpl = nvc.PyFrameUploader(self.nvEnc.Width(), self.nvEnc.Height(), nvc.PixelFormat.YUV420, gpuID)
447
- self.nvCvt = nvc.PySurfaceConverter(
448
- self.nvEnc.Width(), self.nvEnc.Height(), nvc.PixelFormat.YUV420, nvc.PixelFormat.NV12, gpuID
449
- )
447
+ self.nvCvt = nvc.PySurfaceConverter(self.nvEnc.Width(), self.nvEnc.Height(), nvc.PixelFormat.YUV420, nvc.PixelFormat.NV12, gpuID)
450
448
 
451
449
  def _loop(self, data):
452
450
  image, timestamp = data
@@ -478,7 +476,6 @@ class ImageWriterVPF(ImageCallback):
478
476
  @for_all_methods(log_exceptions(logging.getLogger(__name__)))
479
477
  @register_callback
480
478
  class ImageWriterH5(BaseCallback):
481
-
482
479
  FRIENDLY_NAME = "saveimg_h5"
483
480
  SUFFIX = "_images.h5"
484
481
 
@@ -524,7 +521,7 @@ class ImageWriterH5(BaseCallback):
524
521
 
525
522
  def _loop(self, data):
526
523
  data_to_save, timestamp = data # unpack
527
- data_to_save = data_to_save[np.newaxis,...]
524
+ data_to_save = data_to_save[np.newaxis, ...]
528
525
  timestamp = np.array([timestamp])[:, np.newaxis]
529
526
  if self.vanilla:
530
527
  self._init_data(data_to_save, timestamp)
@@ -542,7 +539,6 @@ class ImageWriterH5(BaseCallback):
542
539
  @for_all_methods(log_exceptions(logging.getLogger(__name__)))
543
540
  @register_callback
544
541
  class ImageWriterZarr(BaseCallback):
545
-
546
542
  FRIENDLY_NAME = "saveimg_zarr"
547
543
  SUFFIX = "_images.zarr"
548
544
 
@@ -550,13 +546,20 @@ class ImageWriterZarr(BaseCallback):
550
546
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
551
547
 
552
548
  if zarr_import_error is not None:
553
- logger.exception("Could not import zarr. Aborting!", exc_info=tables_import_error)
549
+ logger.exception("Could not import zarr. Aborting!", exc_info=zarr_import_error)
554
550
  raise zarr_import_error
555
551
 
556
552
  self.file_name = file_name
557
- self.f = zarr.DirectoryStore(self.file_name + self.SUFFIX) # ONLY FOR ZARR2 - otherwise zarr.storage.LocalStore
553
+ # Backward compatibility for Zarr 2; remove when Python 3.10 support ends.
554
+ if hasattr(zarr, "DirectoryStore"):
555
+ self.f = zarr.DirectoryStore(self.file_name + self.SUFFIX)
556
+ self.arrays = zarr.group(self.f, overwrite=True)
557
+ self._create_array = self.arrays.create_dataset
558
+ else:
559
+ self.f = zarr.storage.LocalStore(self.file_name + self.SUFFIX)
560
+ self.arrays = zarr.group(self.f, overwrite=True, zarr_format=2)
561
+ self._create_array = self.arrays.create_array
558
562
  self.vanilla: bool = True
559
- self.arrays = zarr.group(self.f, overwrite=True)
560
563
  self.attrs = attrs
561
564
 
562
565
  @classmethod
@@ -566,22 +569,21 @@ class ImageWriterZarr(BaseCallback):
566
569
  def _init_data(self, data, timestamp):
567
570
  compressor = Blosc(cname="zstd", clevel=3, shuffle=Blosc.BITSHUFFLE)
568
571
 
569
- self.arrays.create_dataset("images", shape=(0, *data.shape[1:]), chunks=(30, *data.shape[1:]), dtype=data.dtype, compressor=compressor)
572
+ self._create_array("images", shape=(0, *data.shape[1:]), chunks=(30, *data.shape[1:]), dtype=data.dtype, compressor=compressor)
570
573
 
571
574
  if self.attrs is not None:
572
575
  for key, val in self.attrs.items():
573
576
  self.arrays["images"].attrs[key] = val
574
577
 
575
- self.arrays.create_dataset("timestamp", shape=(0, *timestamp.shape[1:]), chunks=(100, *timestamp.shape[1:]), dtype=timestamp.dtype, compressor=None)
578
+ self._create_array("timestamp", shape=(0, *timestamp.shape[1:]), chunks=(100, *timestamp.shape[1:]), dtype=timestamp.dtype, compressor=None)
576
579
 
577
580
  def _append_data(self, data, timestamp):
578
581
  self.arrays["images"].append(data, axis=0)
579
582
  self.arrays["timestamp"].append(timestamp, axis=0)
580
583
 
581
-
582
584
  def _loop(self, data):
583
585
  data_to_save, timestamp = data # unpack
584
- data_to_save = data_to_save[np.newaxis,...]
586
+ data_to_save = data_to_save[np.newaxis, ...]
585
587
  timestamp = np.array([timestamp])[:, np.newaxis]
586
588
  if self.vanilla:
587
589
  self._init_data(data_to_save, timestamp)
@@ -619,9 +621,7 @@ class TimestampWriterHDF(ImageCallback):
619
621
 
620
622
  self.increment = increment
621
623
  self.f = h5py.File(self.file_name + self.SUFFIX, "w")
622
- self.ts = self.f.create_dataset(
623
- name="timeStamps", shape=[self.increment, data_dim], maxshape=[None, data_dim], dtype=np.float64, compression="gzip"
624
- )
624
+ self.ts = self.f.create_dataset(name="timeStamps", shape=[self.increment, data_dim], maxshape=[None, data_dim], dtype=np.float64, compression="gzip")
625
625
  self.frame_count = 0
626
626
 
627
627
  def _loop(self, data):
@@ -644,7 +644,6 @@ class TimestampWriterHDF(ImageCallback):
644
644
  @for_all_methods(log_exceptions(logger))
645
645
  @register_callback
646
646
  class ImageDisplayCenterBackCV2(ImageCallback):
647
-
648
647
  FRIENDLY_NAME = "disp_back"
649
648
  TIMESTAMPS_ONLY = False
650
649
 
@@ -683,12 +682,8 @@ class ImageDisplayCenterBackCV2(ImageCallback):
683
682
  color=self.color,
684
683
  thickness=self.thickness,
685
684
  ) # ball region
686
- image = cv2.line(
687
- image, (60, self.center_y), (self.frame_height - 60, self.center_y), self.color, self.thickness
688
- ) # y-axis cross
689
- image = cv2.line(
690
- image, (self.center_x, 60), (self.center_x, self.frame_width - 60), self.color, self.thickness
691
- ) # x-axis cross
685
+ image = cv2.line(image, (60, self.center_y), (self.frame_height - 60, self.center_y), self.color, self.thickness) # y-axis cross
686
+ image = cv2.line(image, (self.center_x, 60), (self.center_x, self.frame_width - 60), self.color, self.thickness) # x-axis cross
692
687
  # image = cv2.rectangle(image, (self.center_x-40,self.center_y-35), (self.center_x+20,self.center_y+35), color=self.color, thickness=self.thickness) # fly
693
688
  cv2.imshow("display", image)
694
689
  cv2.waitKey(1)
@@ -702,7 +697,6 @@ class ImageDisplayCenterBackCV2(ImageCallback):
702
697
  @for_all_methods(log_exceptions(logger))
703
698
  @register_callback
704
699
  class ImageDisplayCenterTopCV2(ImageCallback):
705
-
706
700
  FRIENDLY_NAME = "disp_top"
707
701
  TIMESTAMPS_ONLY = False
708
702
 
@@ -730,17 +724,26 @@ class ImageDisplayCenterTopCV2(ImageCallback):
730
724
  self.needle_color = [250, 0, 0]
731
725
  self.circ_thickness = 2
732
726
 
733
- self.flyhead_topleft, self.flyhead_bottomright = (self.circ_center_x - 45, self.circ_center_y - 50), (
734
- self.circ_center_x + 5,
735
- self.circ_center_y + 50,
727
+ self.flyhead_topleft, self.flyhead_bottomright = (
728
+ (self.circ_center_x - 45, self.circ_center_y - 50),
729
+ (
730
+ self.circ_center_x + 5,
731
+ self.circ_center_y + 50,
732
+ ),
736
733
  )
737
- self.flybody_topleft, self.flybody_bottomright = (self.circ_center_x, self.circ_center_y - 45), (
738
- self.circ_center_x + 200,
739
- self.circ_center_y + 45,
734
+ self.flybody_topleft, self.flybody_bottomright = (
735
+ (self.circ_center_x, self.circ_center_y - 45),
736
+ (
737
+ self.circ_center_x + 200,
738
+ self.circ_center_y + 45,
739
+ ),
740
740
  )
741
- self.needle_topleft, self.needle_bottomright = (self.circ_center_x + 195, self.circ_center_y - 40), (
742
- self.frame_width,
743
- self.circ_center_y + 40,
741
+ self.needle_topleft, self.needle_bottomright = (
742
+ (self.circ_center_x + 195, self.circ_center_y - 40),
743
+ (
744
+ self.frame_width,
745
+ self.circ_center_y + 40,
746
+ ),
744
747
  )
745
748
 
746
749
  @classmethod
@@ -754,21 +757,11 @@ class ImageDisplayCenterTopCV2(ImageCallback):
754
757
  image, timestamp = data
755
758
 
756
759
  image = cv2.circle(image, (self.circ_center_x, self.circ_center_y), self.circ_r, self.circ_color, self.circ_thickness)
757
- image = cv2.line(
758
- image, (self.circ_center_x, 0), (self.circ_center_x, self.frame_width), self.circ_color, self.circ_thickness
759
- )
760
- image = cv2.line(
761
- image, (0, self.circ_center_y), (self.frame_height, self.circ_center_y), self.circ_color, self.circ_thickness
762
- )
763
- image = cv2.rectangle(
764
- image, self.flyhead_topleft, self.flyhead_bottomright, color=self.circ_color, thickness=self.circ_thickness
765
- )
766
- image = cv2.rectangle(
767
- image, self.flybody_topleft, self.flybody_bottomright, color=self.circ_color, thickness=self.circ_thickness
768
- )
769
- image = cv2.rectangle(
770
- image, self.needle_topleft, self.needle_bottomright, color=self.needle_color, thickness=self.circ_thickness
771
- )
760
+ image = cv2.line(image, (self.circ_center_x, 0), (self.circ_center_x, self.frame_width), self.circ_color, self.circ_thickness)
761
+ image = cv2.line(image, (0, self.circ_center_y), (self.frame_height, self.circ_center_y), self.circ_color, self.circ_thickness)
762
+ image = cv2.rectangle(image, self.flyhead_topleft, self.flyhead_bottomright, color=self.circ_color, thickness=self.circ_thickness)
763
+ image = cv2.rectangle(image, self.flybody_topleft, self.flybody_bottomright, color=self.circ_color, thickness=self.circ_thickness)
764
+ image = cv2.rectangle(image, self.needle_topleft, self.needle_bottomright, color=self.needle_color, thickness=self.circ_thickness)
772
765
  cv2.imshow("display", image)
773
766
  cv2.waitKey(1)
774
767
 
@@ -783,7 +776,7 @@ if __name__ == "__main__":
783
776
  import ctypes
784
777
 
785
778
  ct = ImageDisplayPQG.make_concurrent(
786
- task_kwargs={"frame_width": 1000, "frame_height": 1000, "rate": .1},
779
+ task_kwargs={"frame_width": 1000, "frame_height": 1000, "rate": 0.1},
787
780
  comms="array",
788
781
  comms_kwargs={"shape": (1000, 1000, 3), "ctype": ctypes.c_uint8},
789
782
  )
@@ -216,12 +216,19 @@ class SaveZarr(BaseCallback):
216
216
  super().__init__(data_source=data_source, poll_timeout=poll_timeout, **kwargs)
217
217
 
218
218
  if zarr_import_error is not None:
219
- logger.exception("Could not import zarr. Aborting!", exc_info=tables_import_error)
219
+ logger.exception("Could not import zarr. Aborting!", exc_info=zarr_import_error)
220
220
  raise zarr_import_error
221
221
  self.file_name = file_name
222
- self.f = zarr.DirectoryStore(self.file_name + self.SUFFIX)
222
+ # Backward compatibility for Zarr 2; remove when Python 3.10 support ends.
223
+ if hasattr(zarr, "DirectoryStore"):
224
+ self.f = zarr.DirectoryStore(self.file_name + self.SUFFIX)
225
+ self.arrays = zarr.group(self.f, overwrite=True)
226
+ self._create_array = self.arrays.create_dataset
227
+ else:
228
+ self.f = zarr.storage.LocalStore(self.file_name + self.SUFFIX)
229
+ self.arrays = zarr.group(self.f, overwrite=True, zarr_format=2)
230
+ self._create_array = self.arrays.create_array
223
231
  self.vanilla: bool = True
224
- self.arrays = zarr.group(self.f, overwrite=True)
225
232
 
226
233
  self.attrs = attrs
227
234
 
@@ -232,16 +239,16 @@ class SaveZarr(BaseCallback):
232
239
  def _init_data(self, data, systemtime):
233
240
  compressor = Blosc(cname="zstd", clevel=3, shuffle=Blosc.BITSHUFFLE)
234
241
 
235
- self.arrays.create_dataset("samples", shape=(0, *data.shape[1:]), chunks=data.shape, dtype=data.dtype, compressor=compressor)
242
+ self._create_array("samples", shape=(0, *data.shape[1:]), chunks=data.shape, dtype=data.dtype, compressor=compressor)
236
243
 
237
244
  if self.attrs is not None:
238
245
  for key, val in self.attrs.items():
239
246
  self.arrays["samples"].attrs[key] = val
240
247
 
241
- self.arrays.create_dataset("systemtime", shape=(0, 1), chunks=True, dtype=systemtime.dtype, compressor=compressor)
248
+ self._create_array("systemtime", shape=(0, 1), chunks=True, dtype=systemtime.dtype, compressor=compressor)
242
249
 
243
250
  sn = np.array(data.shape[:1])[:, np.newaxis]
244
- self.arrays.create_dataset("samplenumber", shape=(0, 1), chunks=True, dtype=sn.dtype, compressor=compressor)
251
+ self._create_array("samplenumber", shape=(0, 1), chunks=True, dtype=sn.dtype, compressor=compressor)
245
252
  # print([(k, v.shape) for k, v in self.arrays.items()])
246
253
 
247
254
  def _append_data(self, data, systemtime):
@@ -2,19 +2,18 @@ import time
2
2
  import numpy as np
3
3
  from typing import Tuple, Union
4
4
  from .base import BaseCam
5
- import cv2
6
5
 
7
6
 
8
7
  try:
9
8
  import PySpin
9
+
10
10
  pyspin_error = None
11
11
  except ImportError as pyspin_error:
12
12
  pass
13
13
 
14
- class Spinnaker(BaseCam):
15
-
16
- NAME = 'SPN'
17
14
 
15
+ class Spinnaker(BaseCam):
16
+ NAME = "SPN"
18
17
 
19
18
  def __init__(self, serialnumber):
20
19
  if pyspin_error is not None:
@@ -22,7 +21,7 @@ class Spinnaker(BaseCam):
22
21
  self.serialnumber = serialnumber
23
22
 
24
23
  def init(self):
25
- self.cam_system = PySpin.System_GetInstance()
24
+ self.cam_system = PySpin.System.GetInstance()
26
25
  self.cam_list = self.cam_system.GetCameras()
27
26
  self.c = self.cam_list.GetBySerial(self.serialnumber)
28
27
  self.c.Init()
@@ -75,7 +74,7 @@ class Spinnaker(BaseCam):
75
74
  try:
76
75
  x0, y0, x, y = x0_y0_x_y
77
76
  except ValueError:
78
- raise ValueError('Need 4-tuple with x0_y0_x_y')
77
+ raise ValueError("Need 4-tuple with x0_y0_x_y")
79
78
  else:
80
79
  self._min_max_inc(self.c.Width, int(x))
81
80
  self._min_max_inc(self.c.Height, int(y))
@@ -114,7 +113,7 @@ class Spinnaker(BaseCam):
114
113
 
115
114
  @exposure.setter
116
115
  def exposure(self, value: Union[float, str]):
117
- if value == 'AUTO':
116
+ if value == "AUTO":
118
117
  self.c.ExposureAuto.SetValue(PySpin.ExposureAuto_Continuous)
119
118
  else:
120
119
  self.c.ExposureAuto.SetValue(PySpin.ExposureAuto_Off)
@@ -127,18 +126,18 @@ class Spinnaker(BaseCam):
127
126
 
128
127
  @gain.setter
129
128
  def gain(self, value: Union[float, str]):
130
- if value == 'AUTO':
129
+ if value == "AUTO":
131
130
  self.c.GainAuto.SetValue(PySpin.GainAuto_Continuous)
132
131
  else:
133
132
  self.c.GainAuto.SetValue(PySpin.GainAuto_Off)
134
133
  self.c.Gain.SetValue(float(value))
135
134
 
136
135
  def optimize_auto_exposure(self):
137
- self.setattr('AutoExposureControlLoopDamping', 0.1)
138
- self.setattr('AutoExposureLightingMode_Val', 2) # Frontlight
139
- self.setattr('AutoExposureExposureTimeLowerLimit', 6)
140
- self.setattr('AutoExposureExposureTimeUpperLimit', 30000)
141
- self.setattr('AutoExposureEVCompensation', 3)
136
+ self.setattr("AutoExposureControlLoopDamping", 0.1)
137
+ self.setattr("AutoExposureLightingMode_Val", 2) # Frontlight
138
+ self.setattr("AutoExposureExposureTimeLowerLimit", 6)
139
+ self.setattr("AutoExposureExposureTimeUpperLimit", 30000)
140
+ self.setattr("AutoExposureEVCompensation", 3)
142
141
 
143
142
  @property
144
143
  def external_trigger(self):
@@ -155,12 +154,7 @@ class Spinnaker(BaseCam):
155
154
 
156
155
  def _generate_attrs(self):
157
156
 
158
- self._rw_modes = {
159
- PySpin.RO: "read only",
160
- PySpin.RW: "read/write",
161
- PySpin.WO: "write only",
162
- PySpin.NA: "not available"
163
- }
157
+ self._rw_modes = {PySpin.RO: "read only", PySpin.RW: "read/write", PySpin.WO: "write only", PySpin.NA: "not available"}
164
158
 
165
159
  self._attr_types = {
166
160
  PySpin.intfIFloat: PySpin.CFloatPtr,
@@ -171,12 +165,12 @@ class Spinnaker(BaseCam):
171
165
  }
172
166
 
173
167
  self._attr_type_names = {
174
- PySpin.intfIFloat: 'float',
175
- PySpin.intfIBoolean: 'bool',
176
- PySpin.intfIInteger: 'int',
177
- PySpin.intfIEnumeration: 'enum',
178
- PySpin.intfIString: 'string',
179
- PySpin.intfICommand: 'command',
168
+ PySpin.intfIFloat: "float",
169
+ PySpin.intfIBoolean: "bool",
170
+ PySpin.intfIInteger: "int",
171
+ PySpin.intfIEnumeration: "enum",
172
+ PySpin.intfIString: "string",
173
+ PySpin.intfICommand: "command",
180
174
  }
181
175
 
182
176
  self.camera_attributes = {}
@@ -195,7 +189,6 @@ class Spinnaker(BaseCam):
195
189
 
196
190
  def getattr(self, attr):
197
191
  if attr in self.camera_attributes:
198
-
199
192
  prop = self.camera_attributes[attr]
200
193
  if not PySpin.IsReadable(prop):
201
194
  raise AttributeError("Camera property '%s' is not readable" % attr)
@@ -213,12 +206,11 @@ class Spinnaker(BaseCam):
213
206
 
214
207
  def setattr(self, attr, val):
215
208
  if attr in self.camera_attributes:
216
-
217
209
  prop = self.camera_attributes[attr]
218
210
  if not PySpin.IsWritable(prop):
219
211
  raise AttributeError("Property '%s' is not currently writable!" % attr)
220
212
 
221
- if hasattr(prop, 'SetValue'):
213
+ if hasattr(prop, "SetValue"):
222
214
  prop.SetValue(val)
223
215
  else:
224
216
  prop.FromString(val)
@@ -2,7 +2,6 @@ import time
2
2
  import numpy as np
3
3
  from typing import Tuple, Union
4
4
  from .base import BaseCam
5
- import cv2
6
5
 
7
6
 
8
7
  try:
@@ -24,7 +23,7 @@ class Spinnaker_OLD(BaseCam):
24
23
  self.serialnumber = serialnumber
25
24
 
26
25
  def init(self):
27
- self.cam_system = PySpin.System_GetInstance()
26
+ self.cam_system = PySpin.System.GetInstance()
28
27
  self.cam_list = self.cam_system.GetCameras()
29
28
  self.c = self.cam_list.GetBySerial(self.serialnumber)
30
29
  self.c.Init()