pymmcore-plus 0.10.1__tar.gz → 0.10.2__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 (76) hide show
  1. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/PKG-INFO +1 -1
  2. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/pyproject.toml +1 -1
  3. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_psygnal.py +2 -2
  4. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/events/_psygnal.py +2 -2
  5. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_events.py +41 -97
  6. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/.gitignore +0 -0
  7. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/LICENSE +0 -0
  8. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/README.md +0 -0
  9. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/__init__.py +0 -0
  10. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/_build.py +0 -0
  11. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/_cli.py +0 -0
  12. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/_logger.py +0 -0
  13. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/_util.py +0 -0
  14. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/__init__.py +0 -0
  15. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_adapter.py +0 -0
  16. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_config.py +0 -0
  17. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_config_group.py +0 -0
  18. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_constants.py +0 -0
  19. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_device.py +0 -0
  20. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_metadata.py +0 -0
  21. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_mmcore_plus.py +0 -0
  22. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_property.py +0 -0
  23. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_sequencing.py +0 -0
  24. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/_state.py +0 -0
  25. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/__init__.py +0 -0
  26. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_device_signal_view.py +0 -0
  27. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_norm_slot.py +0 -0
  28. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_prop_event_mixin.py +0 -0
  29. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_protocol.py +0 -0
  30. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/core/events/_qsignals.py +0 -0
  31. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/install.py +0 -0
  32. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/__init__.py +0 -0
  33. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/_engine.py +0 -0
  34. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/_protocol.py +0 -0
  35. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/_runner.py +0 -0
  36. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/_thread_relay.py +0 -0
  37. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/events/__init__.py +0 -0
  38. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/events/_protocol.py +0 -0
  39. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/events/_qsignals.py +0 -0
  40. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_5d_writer_base.py +0 -0
  41. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/__init__.py +0 -0
  42. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_img_sequence_writer.py +0 -0
  43. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_ome_tiff_writer.py +0 -0
  44. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_ome_zarr_writer.py +0 -0
  45. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_tensorstore_handler.py +0 -0
  46. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/mda/handlers/_util.py +0 -0
  47. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/__init__.py +0 -0
  48. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_config_file.py +0 -0
  49. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_config_group.py +0 -0
  50. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_core_device.py +0 -0
  51. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_core_link.py +0 -0
  52. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_device.py +0 -0
  53. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_microscope.py +0 -0
  54. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_pixel_size_config.py +0 -0
  55. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/model/_property.py +0 -0
  56. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/py.typed +0 -0
  57. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/src/pymmcore_plus/seq_tester.py +0 -0
  58. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/__init__.py +0 -0
  59. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/conftest.py +0 -0
  60. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/io/test_image_sequence_writer.py +0 -0
  61. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/io/test_ome_tiff.py +0 -0
  62. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/io/test_zarr_writers.py +0 -0
  63. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/local_config.cfg +0 -0
  64. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_adapter_class.py +0 -0
  65. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_bench.py +0 -0
  66. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_cli.py +0 -0
  67. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_config_group_class.py +0 -0
  68. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_core.py +0 -0
  69. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_device_class.py +0 -0
  70. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_mda.py +0 -0
  71. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_misc.py +0 -0
  72. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_model.py +0 -0
  73. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_pixel_config_class.py +0 -0
  74. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_property_class.py +0 -0
  75. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_sequencing.py +0 -0
  76. {pymmcore_plus-0.10.1 → pymmcore_plus-0.10.2}/tests/test_thread_relay.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymmcore-plus
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: pymmcore superset providing improved APIs, event handling, and a pure python acquisition engine
5
5
  Project-URL: Source, https://github.com/pymmcore-plus/pymmcore-plus
6
6
  Project-URL: Tracker, https://github.com/pymmcore-plus/pymmcore-plus/issues
@@ -139,7 +139,7 @@ docstring-code-format = true
139
139
  [tool.pytest.ini_options]
140
140
  minversion = "6.0"
141
141
  testpaths = ["tests"]
142
- filterwarnings = ["error"]
142
+ filterwarnings = ["error", "ignore:Failed to disconnect::pytestqt"]
143
143
 
144
144
  # https://mypy.readthedocs.io/en/stable/config_file.html
145
145
  [tool.mypy]
@@ -1,11 +1,11 @@
1
- from psygnal import Signal, SignalInstance
1
+ from psygnal import Signal, SignalGroup, SignalInstance
2
2
 
3
3
  from pymmcore_plus.mda import MDAEngine
4
4
 
5
5
  from ._prop_event_mixin import _DevicePropertyEventMixin
6
6
 
7
7
 
8
- class CMMCoreSignaler(_DevicePropertyEventMixin):
8
+ class CMMCoreSignaler(SignalGroup, _DevicePropertyEventMixin):
9
9
  """Signals that will be emitted from CMMCorePlus objects."""
10
10
 
11
11
  # native MMCore callback events
@@ -1,9 +1,9 @@
1
1
  import numpy as np
2
- from psygnal import Signal
2
+ from psygnal import Signal, SignalGroup
3
3
  from useq import MDAEvent, MDASequence
4
4
 
5
5
 
6
- class MDASignaler:
6
+ class MDASignaler(SignalGroup):
7
7
  sequenceStarted = Signal(MDASequence, dict) # at the start of an MDA sequence
8
8
  sequencePauseToggled = Signal(bool) # when MDA is paused/unpaused
9
9
  sequenceCanceled = Signal(MDASequence) # when mda is canceled
@@ -68,7 +68,7 @@ def test_events_protocols(cls):
68
68
  )
69
69
 
70
70
 
71
- def test_set_property_events(core: CMMCorePlus):
71
+ def test_set_property_events(core: CMMCorePlus) -> None:
72
72
  """Test that using setProperty always emits a propertyChanged event."""
73
73
  mock = Mock()
74
74
  core.events.propertyChanged.connect(mock)
@@ -89,7 +89,7 @@ def test_set_property_events(core: CMMCorePlus):
89
89
  mock.assert_called_once_with("Camera", "AllowMultiROI", "1")
90
90
 
91
91
 
92
- def test_set_state_events(core: CMMCorePlus):
92
+ def test_set_state_events(core: CMMCorePlus) -> None:
93
93
  mock = Mock()
94
94
  core.events.propertyChanged.connect(mock)
95
95
  assert core.getState("Objective") == 1
@@ -111,7 +111,7 @@ def test_set_state_events(core: CMMCorePlus):
111
111
  assert core.getState("Dichroic") == 1
112
112
 
113
113
 
114
- def test_set_statedevice_property_emits_events(core: CMMCorePlus):
114
+ def test_set_statedevice_property_emits_events(core: CMMCorePlus) -> None:
115
115
  mock = Mock()
116
116
  core.events.propertyChanged.connect(mock)
117
117
  assert core.getState("Objective") == 1
@@ -137,7 +137,7 @@ def test_set_statedevice_property_emits_events(core: CMMCorePlus):
137
137
  assert core.getProperty("Dichroic", STATE) == "1"
138
138
 
139
139
 
140
- def test_device_property_events(core: CMMCorePlus):
140
+ def test_device_property_events(core: CMMCorePlus) -> None:
141
141
  mock1 = Mock()
142
142
  mock2 = Mock()
143
143
  core.events.devicePropertyChanged("Camera", "Gain").connect(mock1)
@@ -162,7 +162,7 @@ def test_device_property_events(core: CMMCorePlus):
162
162
  mock2.assert_not_called()
163
163
 
164
164
 
165
- def test_sequence_acquisition_events(core: CMMCorePlus):
165
+ def test_sequence_acquisition_events(core: CMMCorePlus) -> None:
166
166
  mock1 = Mock()
167
167
  mock2 = Mock()
168
168
  mock3 = Mock()
@@ -172,124 +172,72 @@ def test_sequence_acquisition_events(core: CMMCorePlus):
172
172
  core.events.sequenceAcquisitionStarted.connect(mock3)
173
173
 
174
174
  core.startContinuousSequenceAcquisition()
175
- mock1.assert_has_calls(
176
- [
177
- call(),
178
- ]
179
- )
175
+ mock1.assert_called_once()
180
176
 
181
177
  core.stopSequenceAcquisition()
182
- mock2.assert_has_calls(
183
- [
184
- call(core.getCameraDevice()),
185
- ]
186
- )
178
+ mock2.assert_any_call(core.getCameraDevice())
187
179
 
188
180
  # without camera label
189
181
  core.startSequenceAcquisition(5, 100.0, True)
190
- mock3.assert_has_calls(
191
- [
192
- call(core.getCameraDevice(), 5, 100.0, True),
193
- ]
194
- )
182
+ mock3.assert_any_call(core.getCameraDevice(), 5, 100.0, True)
195
183
  core.stopSequenceAcquisition()
196
- mock2.assert_has_calls(
197
- [
198
- call(core.getCameraDevice()),
199
- ]
200
- )
184
+ mock2.assert_any_call(core.getCameraDevice())
201
185
 
202
186
  # with camera label
203
187
  cam = core.getCameraDevice()
204
188
  core.startSequenceAcquisition(cam, 5, 100.0, True)
205
- mock3.assert_has_calls(
206
- [
207
- call(cam, 5, 100.0, True),
208
- ]
209
- )
189
+ mock3.assert_any_call(cam, 5, 100.0, True)
210
190
  core.stopSequenceAcquisition(cam)
211
- mock2.assert_has_calls(
212
- [
213
- call(cam),
214
- ]
215
- )
191
+ mock2.assert_any_call(cam)
216
192
 
217
193
 
218
- def test_shutter_device_events(core: CMMCorePlus):
194
+ def test_shutter_device_events(core: CMMCorePlus) -> None:
219
195
  mock = Mock()
220
196
  core.events.propertyChanged.connect(mock)
221
197
  core.setShutterOpen("White Light Shutter", True)
222
- mock.assert_has_calls(
223
- [
224
- call("White Light Shutter", STATE, "1"),
225
- ]
226
- )
198
+ mock.assert_called_once_with("White Light Shutter", STATE, "1")
227
199
  assert core.getShutterOpen("White Light Shutter")
228
200
  assert core.getProperty("White Light Shutter", STATE) == "1"
229
201
 
230
202
 
231
- def test_autoshutter_device_events(core: CMMCorePlus):
203
+ def test_autoshutter_device_events(core: CMMCorePlus) -> None:
232
204
  mock = Mock()
233
205
  core.events.autoShutterSet.connect(mock)
234
206
  core.setAutoShutter(True)
235
- mock.assert_has_calls(
236
- [
237
- call(True),
238
- ]
239
- )
207
+ mock.assert_called_once_with(True)
240
208
  assert core.getAutoShutter()
241
209
 
242
210
 
243
- def test_groups_and_presets_events(core: CMMCorePlus):
244
- mock = Mock()
245
- core.events.configDeleted.connect(mock)
211
+ def test_groups_and_presets_events(core: CMMCorePlus) -> None:
212
+ cfg_deleted = Mock()
213
+ core.events.configDeleted.connect(cfg_deleted)
246
214
  core.deleteConfig("Camera", "HighRes")
247
- mock.assert_has_calls(
248
- [
249
- call("Camera", "HighRes"),
250
- ]
251
- )
215
+ cfg_deleted.assert_called_once_with("Camera", "HighRes")
252
216
  assert "HighRes" not in core.getAvailableConfigs("Camera")
253
217
 
254
- mock = Mock()
255
- core.events.configGroupDeleted.connect(mock)
218
+ grp_deleted = Mock()
219
+ core.events.configGroupDeleted.connect(grp_deleted)
256
220
  core.deleteConfigGroup("Objective")
257
- mock.assert_has_calls(
258
- [
259
- call("Objective"),
260
- ]
261
- )
221
+ grp_deleted.assert_called_once_with("Objective")
262
222
  assert "Objective" not in core.getAvailableConfigGroups()
263
223
 
264
- mock = Mock()
265
- core.events.configDefined.connect(mock)
224
+ cfg_defined = Mock()
225
+ core.events.configDefined.connect(cfg_defined)
266
226
  core.defineConfig("NewGroup", "")
267
- mock.assert_has_calls(
268
- [
269
- call("NewGroup", "NewPreset", "", "", ""),
270
- ]
271
- )
227
+ cfg_defined.assert_called_once_with("NewGroup", "NewPreset", "", "", "")
272
228
  assert "NewGroup" in core.getAvailableConfigGroups()
273
229
  assert "NewPreset" in core.getAvailableConfigs("NewGroup")
274
230
 
275
- mock = Mock()
276
- core.events.configDefined.connect(mock)
231
+ cfg_defined.reset_mock()
277
232
  core.defineConfig("NewGroup_1", "New")
278
- mock.assert_has_calls(
279
- [
280
- call("NewGroup_1", "New", "", "", ""),
281
- ]
282
- )
233
+ cfg_defined.assert_called_once_with("NewGroup_1", "New", "", "", "")
283
234
  assert "NewGroup_1" in core.getAvailableConfigGroups()
284
235
  assert "New" in core.getAvailableConfigs("NewGroup_1")
285
236
 
286
- mock = Mock()
287
- core.events.configDefined.connect(mock)
237
+ cfg_defined.reset_mock()
288
238
  core.defineConfig("NewGroup_2", "New", "Dichroic", "Label", "Q505LP")
289
- mock.assert_has_calls(
290
- [
291
- call("NewGroup_2", "New", "Dichroic", "Label", "Q505LP"),
292
- ]
239
+ cfg_defined.assert_called_once_with(
240
+ "NewGroup_2", "New", "Dichroic", "Label", "Q505LP"
293
241
  )
294
242
  assert "NewGroup_2" in core.getAvailableConfigGroups()
295
243
  assert "New" in core.getAvailableConfigs("NewGroup_2")
@@ -297,52 +245,48 @@ def test_groups_and_presets_events(core: CMMCorePlus):
297
245
  assert ("Dichroic", "Label", "Q505LP") in dpv
298
246
 
299
247
 
300
- def test_set_camera_roi_event(core: CMMCorePlus):
248
+ def test_set_camera_roi_event(core: CMMCorePlus) -> None:
301
249
  mock = Mock()
302
250
  core.events.roiSet.connect(mock)
303
251
  core.setROI(10, 20, 100, 200)
304
- mock.assert_has_calls(
305
- [
306
- call(core.getCameraDevice(), 10, 20, 100, 200),
307
- ]
308
- )
252
+ mock.assert_called_once_with(core.getCameraDevice(), 10, 20, 100, 200)
309
253
  assert list(core.getROI()) == [10, 20, 100, 200]
310
254
 
311
255
 
312
- def test_pixel_changed_event(core: CMMCorePlus):
256
+ def test_pixel_changed_event(core: CMMCorePlus) -> None:
313
257
  mock = Mock()
314
258
  core.events.pixelSizeChanged.connect(mock)
315
259
 
316
260
  core.deletePixelSizeConfig("Res10x")
317
- mock.assert_has_calls([call(0.0)])
261
+ mock.assert_called_once_with(0.0)
318
262
  assert "Res10x" not in core.getAvailablePixelSizeConfigs()
319
263
 
320
264
  core.definePixelSizeConfig("test", "Objective", "Label", "Nikon 10X S Fluor")
321
- mock.assert_has_calls([call(0.0)])
265
+ mock.assert_any_call(0.0)
322
266
  assert "test" in core.getAvailablePixelSizeConfigs()
323
267
 
324
268
  core.setPixelSizeUm("test", 6.5)
325
- mock.assert_has_calls([call(6.5)])
269
+ mock.assert_any_call(6.5)
326
270
  assert core.getPixelSizeUmByID("test") == 6.5
327
271
 
328
272
 
329
- def test_set_channelgroup(core: CMMCorePlus):
273
+ def test_set_channelgroup(core: CMMCorePlus) -> None:
330
274
  mock = Mock()
331
275
  core.events.channelGroupChanged.connect(mock)
332
276
 
333
277
  core.setChannelGroup("Camera")
334
278
  assert core.getChannelGroup() == "Camera"
335
- mock.assert_has_calls([call("Camera")])
279
+ mock.assert_any_call("Camera")
336
280
 
337
281
 
338
- def test_set_focus_device(core: CMMCorePlus):
282
+ def test_set_focus_device(core: CMMCorePlus) -> None:
339
283
  mock = Mock()
340
284
  core.events.propertyChanged.connect(mock)
341
285
 
342
286
  core.setFocusDevice("")
343
287
  assert not core.getFocusDevice()
344
- mock.assert_has_calls([call("Core", "Focus", "")])
288
+ mock.assert_called_once_with("Core", "Focus", "")
345
289
 
346
290
  core.setFocusDevice("Z")
347
291
  assert core.getFocusDevice() == "Z"
348
- mock.assert_has_calls([call("Core", "Focus", "Z")])
292
+ mock.assert_any_call("Core", "Focus", "Z")
File without changes
File without changes