tomwer 1.3.7__py3-none-any.whl → 1.3.8__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.
Files changed (108) hide show
  1. tomwer/core/process/reconstruction/nabu/utils.py +2 -0
  2. tomwer/gui/control/datawatcher/datawatcher.py +1 -24
  3. tomwer/version.py +1 -1
  4. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/METADATA +1 -1
  5. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/RECORD +11 -108
  6. orangecontrib/tomwer/test/TestAcquisition.py +0 -246
  7. orangecontrib/tomwer/widgets/cluster/test/test_future_supervisorow.py +0 -87
  8. orangecontrib/tomwer/widgets/cluster/test/test_slurm_clusterow.py +0 -67
  9. orangecontrib/tomwer/widgets/control/test/test_advancement.py +0 -51
  10. orangecontrib/tomwer/widgets/control/test/test_data_validator.py +0 -55
  11. orangecontrib/tomwer/widgets/control/test/test_datadiscovery.py +0 -131
  12. orangecontrib/tomwer/widgets/control/test/test_datalist.py +0 -70
  13. orangecontrib/tomwer/widgets/control/test/test_datalistener.py +0 -137
  14. orangecontrib/tomwer/widgets/control/test/test_dataselector.py +0 -95
  15. orangecontrib/tomwer/widgets/control/test/test_datawatcher.py +0 -436
  16. orangecontrib/tomwer/widgets/control/test/test_emailow.py +0 -29
  17. orangecontrib/tomwer/widgets/control/test/test_notifier.py +0 -51
  18. orangecontrib/tomwer/widgets/control/test/test_nxtomo_concatenate_ow.py +0 -64
  19. orangecontrib/tomwer/widgets/control/test/test_nxtomomill.py +0 -160
  20. orangecontrib/tomwer/widgets/control/test/test_reduce_dark_flat_selector.py +0 -40
  21. orangecontrib/tomwer/widgets/control/test/test_singletomoobj.py +0 -40
  22. orangecontrib/tomwer/widgets/control/test/test_timerow.py +0 -51
  23. orangecontrib/tomwer/widgets/control/test/test_tomoobj_serie.py +0 -96
  24. orangecontrib/tomwer/widgets/control/test/test_volume_selector.py +0 -69
  25. orangecontrib/tomwer/widgets/control/test/test_volumesymlink.py +0 -51
  26. orangecontrib/tomwer/widgets/debugtools/test/test_dataset_generator.py +0 -57
  27. orangecontrib/tomwer/widgets/debugtools/test/test_object_inspector.py +0 -62
  28. orangecontrib/tomwer/widgets/other/test/test_pythonscript.py +0 -31
  29. orangecontrib/tomwer/widgets/reconstruction/test/test_axis.py +0 -224
  30. orangecontrib/tomwer/widgets/reconstruction/test/test_cast_volumeow.py +0 -85
  31. orangecontrib/tomwer/widgets/reconstruction/test/test_dark_refs_widget.py +0 -136
  32. orangecontrib/tomwer/widgets/reconstruction/test/test_delta_beta_selector.py +0 -15
  33. orangecontrib/tomwer/widgets/reconstruction/test/test_i_norm.py +0 -226
  34. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_helical_prepare_weights_double.py +0 -20
  35. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_volume.py +0 -100
  36. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_widget.py +0 -107
  37. orangecontrib/tomwer/widgets/reconstruction/test/test_sa_delta_beta.py +0 -194
  38. orangecontrib/tomwer/widgets/reconstruction/test/test_saaxis.py +0 -220
  39. orangecontrib/tomwer/widgets/stitching/test/test_zstitching.py +0 -308
  40. orangecontrib/tomwer/widgets/test/test_conditions.py +0 -111
  41. orangecontrib/tomwer/widgets/test/test_darkref.py +0 -251
  42. orangecontrib/tomwer/widgets/test/test_foldertransfert.py +0 -131
  43. orangecontrib/tomwer/widgets/visualization/test/test_dataviewerow.py +0 -83
  44. orangecontrib/tomwer/widgets/visualization/test/test_diffviewerow.py +0 -65
  45. orangecontrib/tomwer/widgets/visualization/test/test_live_sliceow.py +0 -63
  46. orangecontrib/tomwer/widgets/visualization/test/test_nxtomo_metadata_viewer.py +0 -29
  47. orangecontrib/tomwer/widgets/visualization/test/test_radio_stackow.py +0 -56
  48. orangecontrib/tomwer/widgets/visualization/test/test_sample_movedow.py +0 -72
  49. orangecontrib/tomwer/widgets/visualization/test/test_sinogram_viewerow.py +0 -56
  50. orangecontrib/tomwer/widgets/visualization/test/test_slice_stackow.py +0 -57
  51. orangecontrib/tomwer/widgets/visualization/test/test_volume_viewerow.py +0 -57
  52. tomwer/core/log/test/test_processlog.py +0 -41
  53. tomwer/core/process/edit/test/test_darkflatpatch.py +0 -269
  54. tomwer/core/process/edit/test/test_imagekey_editor.py +0 -125
  55. tomwer/core/process/icat/test/test_create_screenshots.py +0 -98
  56. tomwer/core/process/icat/test/test_gallery.py +0 -170
  57. tomwer/core/process/reconstruction/nabu/test/test_castvolume.py +0 -143
  58. tomwer/core/process/reconstruction/nabu/test/test_nabu_utils.py +0 -203
  59. tomwer/core/process/reconstruction/nabu/test/test_nabunormalization.py +0 -222
  60. tomwer/core/process/script/test/test_script.py +0 -68
  61. tomwer/core/process/stitching/test/test_metadataholder.py +0 -17
  62. tomwer/core/process/visualization/test/test_data_viewer.py +0 -39
  63. tomwer/core/process/visualization/test/test_diff_viewer.py +0 -39
  64. tomwer/core/process/visualization/test/test_image_stack_viewer.py +0 -41
  65. tomwer/core/process/visualization/test/test_radio_stack.py +0 -39
  66. tomwer/core/process/visualization/test/test_sample_moved.py +0 -41
  67. tomwer/core/process/visualization/test/test_sinogram_viewer.py +0 -39
  68. tomwer/core/process/visualization/test/test_slice_stack.py +0 -39
  69. tomwer/core/process/visualization/test/test_volume_viewer.py +0 -39
  70. tomwer/core/utils/test/test_image.py +0 -30
  71. tomwer/core/utils/test/test_nxtomo.py +0 -66
  72. tomwer/core/utils/test/test_scan_utils.py +0 -46
  73. tomwer/core/utils/test/test_time.py +0 -6
  74. tomwer/core/volume/test/test_volumes.py +0 -21
  75. tomwer/gui/control/serie/test/test_creator.py +0 -451
  76. tomwer/gui/control/serie/test/test_nxtomo_concatenate.py +0 -21
  77. tomwer/gui/icat/test/test_create_screenshots_gui.py +0 -23
  78. tomwer/gui/icat/test/test_gallery_gui.py +0 -37
  79. tomwer/gui/reconstruction/nabu/test/test_check.py +0 -92
  80. tomwer/gui/reconstruction/nabu/test/test_ctf.py +0 -46
  81. tomwer/gui/reconstruction/nabu/test/test_helical.py +0 -21
  82. tomwer/gui/reconstruction/nabu/test/test_nabu_preprocessing.py +0 -81
  83. tomwer/gui/reconstruction/normalization/test/test_intensity.py +0 -119
  84. tomwer/gui/stitching/config/tests/test_axisparams.py +0 -25
  85. tomwer/gui/stitching/tests/test_axis_ordered_list.py +0 -21
  86. tomwer/gui/stitching/tests/test_normalization.py +0 -27
  87. tomwer/gui/stitching/tests/test_preview.py +0 -85
  88. tomwer/gui/stitching/tests/test_stitching_raw.py +0 -110
  89. tomwer/gui/stitching/tests/test_z_stitching.py +0 -67
  90. tomwer/gui/stitching/tests/utils.py +0 -79
  91. tomwer/gui/stitching/z_stitching/tests/test_fine_estimation.py +0 -35
  92. tomwer/gui/stitching/z_stitching/tests/test_raw_estimation.py +0 -215
  93. tomwer/gui/stitching/z_stitching/tests/test_stitching_window.py +0 -51
  94. tomwer/gui/utils/test/test_completer.py +0 -67
  95. tomwer/gui/utils/test/test_line_selector.py +0 -21
  96. tomwer/gui/utils/test/test_splashscreen.py +0 -8
  97. tomwer/gui/utils/test/test_vignettes.py +0 -68
  98. tomwer/io/utils/test/test_raw_and_processed_data.py +0 -10
  99. tomwer/io/utils/test/test_utils.py +0 -92
  100. tomwer/tests/test_ewoks/test_conversion.py +0 -104
  101. tomwer/tests/test_ewoks/test_single_node_execution.py +0 -112
  102. tomwer/tests/test_ewoks/test_workflows.py +0 -160
  103. /tomwer-1.3.7-py3.11-nspkg.pth → /tomwer-1.3.8-py3.11-nspkg.pth +0 -0
  104. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/LICENSE +0 -0
  105. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/WHEEL +0 -0
  106. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/entry_points.txt +0 -0
  107. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/namespace_packages.txt +0 -0
  108. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/top_level.txt +0 -0
@@ -1,436 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "17/01/2017"
28
-
29
- import gc
30
- import logging
31
- import os
32
- import shutil
33
- import tempfile
34
- import time
35
- from time import sleep
36
-
37
- from silx.gui import qt
38
- from silx.gui.utils.testutils import SignalListener, TestCaseQt
39
-
40
- from orangecontrib.tomwer.test.TestAcquisition import Simulation
41
- from orangecontrib.tomwer.widgets.control.DataWatcherOW import DataWatcherOW
42
- from tomwer.core.process.control.datawatcher import status as datawatcherstatus
43
- from tomwer.core.utils.scanutils import MockBlissAcquisition, MockNXtomo
44
-
45
- logging.disable(logging.INFO)
46
-
47
-
48
- class DataWatcherWaiter(TestCaseQt):
49
- """Define a simple objecy able to wait for some state of the DataWatcher
50
- arrive"""
51
-
52
- def __init__(self, *args, **kwargs):
53
- super().__init__(*args, **kwargs)
54
- self.reset()
55
- self.lastStatus = []
56
-
57
- def tearDown(self):
58
- pass
59
-
60
- def reset(self):
61
- self.lastStatus = []
62
-
63
- def stateHasChanged(self, val):
64
- """Register all status"""
65
- if val not in self.lastStatus:
66
- self.lastStatus.append(val)
67
-
68
- def waitForState(self, state, maxWaiting):
69
- """simple function wich wait until the DataWatcherWidget reach the given
70
- state.
71
- If the widget doesn't reach this state after maxWaiting second. Then fail.
72
-
73
- :param str state: the state we are waiting for
74
- :param int maxWaiting: the maximal number of second to wait until failling.
75
- """
76
- while state not in self.lastStatus:
77
- time.sleep(1.0)
78
- self.qapp.processEvents()
79
- maxWaiting -= 1
80
- if maxWaiting <= 0:
81
- return False
82
- return state in self.lastStatus
83
-
84
-
85
- class TestDataWatcherAcquisition(DataWatcherWaiter):
86
- """Functions testing the classical behavior of data watcher
87
- - signal acquisition is over only when all files are copied
88
- """
89
-
90
- def tearDown(self):
91
- while self.qapp.hasPendingEvents():
92
- self.qapp.processEvents()
93
- self.dataWatcherWidget.setObservation(False)
94
- self.dataWatcherWidget.close()
95
- del self.dataWatcherWidget
96
- self.dataWatcherWidget = None
97
- self.s.wait()
98
- del self.s
99
- if os.path.isdir(self.inputdir):
100
- shutil.rmtree(self.inputdir)
101
- gc.collect()
102
- super().tearDown()
103
-
104
- def setUp(self):
105
- self.manipulationId = "test10"
106
-
107
- super().setUp()
108
- self.inputdir = tempfile.mkdtemp()
109
- DataWatcherWaiter.reset(self)
110
- self.dataWatcherWidget = DataWatcherOW(displayAdvancement=False)
111
- self.dataWatcherWidget.srcPattern = ""
112
- self.dataWatcherWidget.sigTMStatusChanged.connect(self.stateHasChanged)
113
- self.dataWatcherWidget.setAttribute(qt.Qt.WA_DeleteOnClose)
114
-
115
- self.s = Simulation(
116
- self.inputdir,
117
- self.manipulationId,
118
- finalState=Simulation.advancement["acquisitionRunning"],
119
- )
120
-
121
- def testStartAcquisition(self):
122
- """Make sure the data watch detect the acquisition of started"""
123
- observeDir = os.path.join(self.inputdir, self.manipulationId)
124
- for folder in (self.inputdir, observeDir):
125
- if not os.path.exists(folder):
126
- os.makedirs(folder)
127
-
128
- self.assertTrue(os.path.isdir(observeDir))
129
-
130
- self.s.createFinalXML(True)
131
- self.dataWatcherWidget.setFolderObserved(observeDir)
132
-
133
- self.assertTrue(self.dataWatcherWidget.currentStatus == "not processing")
134
- self.s.start()
135
- self.s.advanceTo("acquisitionDone")
136
- self.s.start()
137
- self.s.wait()
138
- self.dataWatcherWidget.startObservation()
139
- self.dataWatcherWidget._widget.observationThread.wait()
140
- self.dataWatcherWidget._widget.observationThread.observations.dict[
141
- observeDir
142
- ].wait()
143
- self.qapp.processEvents()
144
- finishedAcqui = (
145
- self.dataWatcherWidget._widget.observationThread.observations.ignoredFolders
146
- )
147
- self.qapp.processEvents()
148
- self.assertTrue(observeDir in finishedAcqui)
149
-
150
-
151
- class TestDataWatcherInteraction(TestCaseQt):
152
- """Simple unit test to test the start/stop observation button action"""
153
-
154
- def setUp(self):
155
- super().setUp()
156
- self.inputdir = tempfile.mkdtemp()
157
- self.dataWatcherWidget = DataWatcherOW(displayAdvancement=False)
158
- self.dataWatcherWidget.setAttribute(qt.Qt.WA_DeleteOnClose)
159
- self.dataWatcherWidget.srcPattern = ""
160
-
161
- def tearDown(self):
162
- while self.qapp.hasPendingEvents():
163
- self.qapp.processEvents()
164
- self.dataWatcherWidget.close()
165
- del self.dataWatcherWidget
166
- if os.path.isdir(self.inputdir):
167
- shutil.rmtree(self.inputdir)
168
- gc.collect()
169
-
170
- def testStartAndStopAcquisition(self):
171
- """test multiple start and stop action on the start observation to
172
- make sure no crash are appearing
173
- """
174
- try:
175
- self.dataWatcherWidget.setFolderObserved(self.inputdir)
176
- self.dataWatcherWidget.show()
177
- self.dataWatcherWidget.setObservation(True)
178
- for _ in range(5):
179
- self.dataWatcherWidget._widget._qpbstartstop.pressed.emit()
180
- self.assertTrue(True)
181
- except Exception:
182
- self.assertTrue(False)
183
-
184
-
185
- class WaitForXMLOption(DataWatcherWaiter):
186
- """test the behavior of datawatcher when the option 'wait for xml copy'
187
- Basically in this case DataWatcherDirObserver will wait until an .xml
188
- arrived
189
- """
190
-
191
- @classmethod
192
- def setUpClass(cls):
193
- cls.dataWatcherWidget = DataWatcherOW(displayAdvancement=False)
194
- cls.dataWatcherWidget.setAttribute(qt.Qt.WA_DeleteOnClose)
195
- cls.dataWatcherWidget.obsMethod = datawatcherstatus.DET_END_XML
196
- cls.dataWatcherWidget.srcPattern = ""
197
- cls.manipulationId = "test10"
198
- super().setUpClass()
199
-
200
- def setUp(self):
201
- self.inputdir = tempfile.mkdtemp()
202
- self.reset()
203
- self.dataWatcherWidget.setObservation(False)
204
- self.dataWatcherWidget.resetStatus()
205
- super().setUp()
206
-
207
- def tearDown(self):
208
- while self.qapp.hasPendingEvents():
209
- self.qapp.processEvents()
210
- if os.path.isdir(self.inputdir):
211
- shutil.rmtree(self.inputdir)
212
- gc.collect()
213
- super().tearDown()
214
-
215
- @classmethod
216
- def tearDownClass(cls):
217
- cls.dataWatcherWidget.close()
218
- del cls.dataWatcherWidget
219
- if hasattr(cls, "s"):
220
- cls.s.quit()
221
- del cls.s
222
- super().tearDownClass()
223
-
224
- def testAcquistionNotEnding(self):
225
- """Check behavior if an acquisition never end"""
226
- observeDir = os.path.join(self.inputdir, self.manipulationId)
227
- for folder in (self.inputdir, observeDir):
228
- if not os.path.exists(folder):
229
- os.makedirs(folder)
230
-
231
- self.assertTrue(os.path.isdir(observeDir))
232
-
233
- self.s = Simulation(
234
- self.inputdir,
235
- self.manipulationId,
236
- finalState=Simulation.advancement["acquisitionRunning"],
237
- )
238
- self.dataWatcherWidget.setFolderObserved(observeDir)
239
- self.dataWatcherWidget.show()
240
- self.dataWatcherWidget.sigTMStatusChanged.connect(self.stateHasChanged)
241
-
242
- self.assertTrue(self.dataWatcherWidget.currentStatus == "not processing")
243
- self.s.start()
244
- self.s.wait()
245
- self.dataWatcherWidget.setObservation(True)
246
- self.dataWatcherWidget._widget.observationThread.wait()
247
- self.dataWatcherWidget._widget.observationThread.observations.dict[
248
- observeDir
249
- ].wait()
250
- finishedAcqui = (
251
- self.dataWatcherWidget._widget.observationThread.observations.ignoredFolders
252
- )
253
- self.qapp.processEvents()
254
- self.assertFalse(observeDir in finishedAcqui)
255
-
256
- def testAcquistionEnded(self):
257
- """Check behavior if an acquisition is ending"""
258
- manipulationId = "test10"
259
- observeDir = os.path.join(self.inputdir, self.manipulationId)
260
- for folder in (self.inputdir, observeDir):
261
- if not os.path.exists(folder):
262
- os.makedirs(folder)
263
-
264
- self.assertTrue(os.path.isdir(observeDir))
265
-
266
- self.s = Simulation(
267
- self.inputdir,
268
- manipulationId,
269
- finalState=Simulation.advancement["acquisitionDone"],
270
- )
271
- self.s.createFinalXML(True)
272
- self.dataWatcherWidget.setFolderObserved(observeDir)
273
- self.dataWatcherWidget.show()
274
- self.dataWatcherWidget.sigTMStatusChanged.connect(self.stateHasChanged)
275
-
276
- self.assertTrue(self.dataWatcherWidget.currentStatus == "not processing")
277
- self.s.start()
278
- self.s.wait()
279
- self.dataWatcherWidget.setObservation(True)
280
- self.dataWatcherWidget._widget.observationThread.wait()
281
- self.dataWatcherWidget._widget.observationThread.observations.dict[
282
- observeDir
283
- ].wait()
284
- finishedAcqui = (
285
- self.dataWatcherWidget._widget.observationThread.observations.ignoredFolders
286
- )
287
- self.qapp.processEvents()
288
- self.assertTrue(observeDir in finishedAcqui)
289
-
290
-
291
- class TestRSync(DataWatcherWaiter):
292
- """test that the synchronization using RSyncManager is working"""
293
-
294
- def setUp(self):
295
- super().setUp()
296
- self.inputdir = tempfile.mkdtemp()
297
- self.outputdir = tempfile.mkdtemp()
298
- DataWatcherWaiter.reset(self)
299
- self.dataWatcherWidget = DataWatcherOW(displayAdvancement=False)
300
- self.dataWatcherWidget.setAttribute(qt.Qt.WA_DeleteOnClose)
301
- self.dataWatcherWidget._widget.setSrcAndDestPattern(
302
- self.inputdir, self.outputdir
303
- )
304
-
305
- def tearDown(self):
306
- while self.qapp.hasPendingEvents():
307
- self.qapp.processEvents()
308
- self.dataWatcherWidget.close()
309
- del self.dataWatcherWidget
310
- if hasattr(self, "s"):
311
- self.s.quit()
312
- del self.s
313
- super(TestRSync, self).tearDown()
314
- for d in (self.inputdir, self.outputdir):
315
- if os.path.isdir(d):
316
- shutil.rmtree(d, ignore_errors=True)
317
- gc.collect()
318
-
319
- def testStartAcquisition(self):
320
- """Test that rsync is launched when an acquisition is discovered"""
321
- manipulationId = "test10"
322
- observeDir = os.path.join(self.inputdir, manipulationId)
323
- for folder in (self.inputdir, observeDir):
324
- if not os.path.exists(folder):
325
- os.makedirs(folder)
326
-
327
- self.assertTrue(os.path.isdir(observeDir))
328
-
329
- self.s = Simulation(
330
- self.inputdir,
331
- manipulationId,
332
- finalState=Simulation.advancement["acquisitionRunning"],
333
- )
334
-
335
- self.s.setSrcDestPatterns(self.inputdir, self.outputdir)
336
- self.s.createFinalXML(True)
337
- self.dataWatcherWidget.setFolderObserved(self.inputdir)
338
- self.dataWatcherWidget.show()
339
- self.dataWatcherWidget.sigTMStatusChanged.connect(self.stateHasChanged)
340
- self.assertTrue(self.dataWatcherWidget.currentStatus == "not processing")
341
- self.dataWatcherWidget.setObservation(True)
342
- self.s.start()
343
- # check state scanning
344
- time.sleep(0.5)
345
-
346
- self.dataWatcherWidget.stopObservation()
347
-
348
- # in this case the .info should be in the output dir also
349
- test10_output = os.path.join(self.outputdir, "test10")
350
- test10_input = os.path.join(self.inputdir, "test10")
351
- self.assertTrue(os.path.isfile(os.path.join(test10_output, "test10.info")))
352
-
353
- # make sure file transfert have been started (using rsync)
354
- # all file in outputdir should be in input dir
355
- time.sleep(2)
356
- # check that some .edf file have already been copied
357
- self.assertTrue(len(test10_output) > 5)
358
-
359
- # xml shouldn't be there because we are righting it at the end
360
- self.assertFalse(os.path.isfile(os.path.join(test10_output, "test10.xml")))
361
- self.assertFalse(os.path.isfile(os.path.join(test10_input, "test10.xml")))
362
-
363
-
364
- class TestDataWatcherBlissScan(TestCaseQt):
365
- def setUp(self):
366
- self._widget = DataWatcherOW(self)
367
- self.tempdir = tempfile.mkdtemp()
368
- MockBlissAcquisition(
369
- n_sample=1,
370
- n_sequence=1,
371
- n_scan_per_sequence=3,
372
- n_darks=2,
373
- n_flats=2,
374
- output_dir=os.path.join(self.tempdir, "folder_1"),
375
- )
376
-
377
- MockBlissAcquisition(
378
- n_sample=2,
379
- n_sequence=1,
380
- n_scan_per_sequence=3,
381
- n_darks=2,
382
- n_flats=2,
383
- output_dir=os.path.join(self.tempdir, "test", "with", "some", "depth"),
384
- )
385
- self._listener = SignalListener()
386
- self._widget._widget.sigScanReady.connect(self._listener)
387
-
388
- def tearDown(self):
389
- self._widget._widget.sigScanReady.disconnect(self._listener)
390
- self._widget.stopObservation()
391
- self._listener = None
392
- shutil.rmtree(self.tempdir)
393
- self._widget.setAttribute(qt.Qt.WA_DeleteOnClose)
394
- self._widget.close()
395
- self._widget = None
396
- gc.collect()
397
-
398
-
399
- class TestDataWatcherNXtomo(TestCaseQt):
400
- def setUp(self):
401
- self._widget = DataWatcherOW(self)
402
- self.tempdir = tempfile.mkdtemp()
403
- MockNXtomo(
404
- scan_path=os.path.join(self.tempdir, "folder_1"),
405
- n_proj=10,
406
- )
407
-
408
- MockNXtomo(
409
- scan_path=os.path.join(self.tempdir, "test", "with", "some", "depth"),
410
- n_proj=10,
411
- )
412
- self._listener = SignalListener()
413
- self._widget._widget.sigScanReady.connect(self._listener)
414
-
415
- def tearDown(self):
416
- self._widget._widget.sigScanReady.disconnect(self._listener)
417
- self._widget.stopObservation()
418
- self._listener = None
419
- shutil.rmtree(self.tempdir)
420
- self._widget.setAttribute(qt.Qt.WA_DeleteOnClose)
421
- self._widget.close()
422
- self._widget = None
423
- gc.collect()
424
-
425
- def test(self):
426
- self._widget.setFolderObserved(self.tempdir)
427
- self._widget._widget.getConfigWindow().setMode((datawatcherstatus.NXtomo_END,))
428
- self._widget.show()
429
- self._widget.startObservation()
430
- processing_time = 2
431
- sleep_time = 0.005
432
- while processing_time > 0:
433
- self.qapp.processEvents()
434
- sleep(sleep_time)
435
- processing_time -= sleep_time
436
- assert self._listener.callCount() == 2
@@ -1,29 +0,0 @@
1
- import gc
2
- import pickle
3
-
4
- from silx.gui import qt
5
- from silx.gui.utils.testutils import TestCaseQt
6
-
7
- from orangecontrib.tomwer.widgets.control.EmailOW import EmailOW
8
- from orangecanvas.scheme.readwrite import literal_dumps
9
-
10
-
11
- class TestEmailOW(TestCaseQt):
12
- def setUp(self):
13
- super().setUp()
14
- self.widget = EmailOW()
15
-
16
- def tearDown(self):
17
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
18
- self.widget.close()
19
- self.widget = None
20
- gc.collect()
21
-
22
- def test(self):
23
- self.widget.show()
24
-
25
- def test_serializing(self):
26
- pickle.dumps(self.widget.getConfiguration())
27
-
28
- def test_literal_dumps(self):
29
- literal_dumps(self.widget.getConfiguration())
@@ -1,51 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2021 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "17/06/2021"
29
-
30
-
31
- import gc
32
-
33
- from silx.gui import qt
34
- from silx.gui.utils.testutils import TestCaseQt
35
-
36
- from orangecontrib.tomwer.widgets.control.NotifierOW import NotifierWidgetOW
37
-
38
-
39
- class TestTimerOW(TestCaseQt):
40
- def setUp(self):
41
- super().setUp()
42
- self.widget = NotifierWidgetOW()
43
-
44
- def tearDown(self):
45
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
46
- self.widget.close()
47
- self.widget = None
48
- gc.collect()
49
-
50
- def test(self):
51
- self.widget.show()
@@ -1,64 +0,0 @@
1
- import os
2
- from tomoscan.serie import Serie
3
- import pickle
4
-
5
- from ewoksorange.bindings.qtapp import QtEvent
6
-
7
- from orangecanvas.scheme.readwrite import literal_dumps
8
-
9
- from tomwer.tests.conftest import qtapp # noqa F401
10
- from tomwer.core.utils.scanutils import MockNXtomo
11
-
12
- from orangecontrib.tomwer.widgets.control.NXtomoConcatenate import NXtomoConcatenateOW
13
-
14
-
15
- def test_NabuHelicalPrepareWeightsDoubleOW(
16
- qtapp, # noqa F811
17
- tmp_path,
18
- ):
19
- """simple test of the _DeltaBetaSelectorDialog"""
20
- widget = NXtomoConcatenateOW()
21
- widget._loadSettings()
22
- # test settings serialization
23
- pickle.dumps(widget._ewoks_default_inputs)
24
- literal_dumps(widget._ewoks_default_inputs)
25
-
26
- scan_1 = MockNXtomo(
27
- scan_path=os.path.join(tmp_path, "scan1"),
28
- n_proj=10,
29
- n_ini_proj=10,
30
- scan_range=180,
31
- dim=20,
32
- energy=12.3,
33
- ).scan
34
- scan_2 = MockNXtomo(
35
- scan_path=os.path.join(tmp_path, "scan2"),
36
- n_proj=10,
37
- n_ini_proj=10,
38
- scan_range=180,
39
- dim=20,
40
- energy=12.3,
41
- ).scan
42
-
43
- output_scan_file = os.path.join(tmp_path, "concatenation.nx")
44
- assert not os.path.exists(output_scan_file)
45
-
46
- widget.widget.setConfiguration(
47
- {
48
- "output_file": output_scan_file,
49
- }
50
- )
51
-
52
- # process task
53
- finished = QtEvent()
54
-
55
- def finished_callback():
56
- finished.set()
57
-
58
- executor = widget.task_executor_queue
59
- executor.sigComputationEnded.connect(finished_callback)
60
- widget._process_serie(serie=Serie(iterable=[scan_1, scan_2]))
61
-
62
- # wait until processing is finished
63
- assert finished.wait(timeout=10)
64
- assert os.path.exists(output_scan_file)