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,160 +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
- import os
33
- import shutil
34
- import tempfile
35
- import time
36
-
37
- from orangecanvas.scheme.readwrite import literal_dumps
38
- from processview.core.manager.manager import DatasetState, ProcessManager
39
- from silx.gui import qt
40
- from silx.gui.utils.testutils import TestCaseQt
41
- from tomoscan.esrf.scan.mock import MockEDF
42
-
43
- from orangecontrib.tomwer.widgets.control.EDF2NXTomomillOW import EDF2NXOW
44
- from orangecontrib.tomwer.widgets.control.NXTomomillOW import NXTomomillOW
45
- from tomwer.core.scan.blissscan import BlissScan
46
- from tomwer.core.scan.nxtomoscan import NXtomoScan
47
- from tomwer.core.utils.scanutils import MockBlissAcquisition
48
-
49
-
50
- class TestNXTomomillOw(TestCaseQt):
51
- """
52
- Test the NXTomomillOW widget
53
- """
54
-
55
- def setUp(self):
56
- super().setUp()
57
- self.tempdir = tempfile.mkdtemp()
58
- mock = MockBlissAcquisition(
59
- n_sample=1,
60
- n_sequence=1,
61
- n_scan_per_sequence=3,
62
- n_darks=2,
63
- n_flats=2,
64
- output_dir=self.tempdir,
65
- )
66
- self.scan = BlissScan(
67
- master_file=mock.samples[0].sample_file,
68
- proposal_file=mock.proposal_file,
69
- entry="1.1",
70
- )
71
- self.widget = NXTomomillOW()
72
-
73
- def tearDown(self):
74
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
75
- self.widget.close()
76
- self.widget = None
77
- shutil.rmtree(self.tempdir)
78
- gc.collect()
79
-
80
- def test(self):
81
- self.widget.add(self.scan.master_file)
82
- self.widget._sendAll()
83
-
84
- def test_literal_dumps(self):
85
- self.widget._saveNXTomoCfgFile(cfg_file="")
86
- literal_dumps(self.widget._ewoks_default_inputs)
87
-
88
-
89
- class TestEDF2NXOW(TestCaseQt):
90
- """
91
- Test the EDF2NXOW widget
92
- """
93
-
94
- def setUp(self):
95
- super().setUp()
96
- self.tempdir = tempfile.mkdtemp()
97
- self._edf_folder_1 = os.path.join(self.tempdir, "edf_scan_1")
98
- self._edf_folder_2 = os.path.join(self.tempdir, "edf_scan_2_")
99
- MockEDF(
100
- scan_path=self._edf_folder_1,
101
- n_radio=10,
102
- n_ini_radio=10,
103
- n_extra_radio=0,
104
- dim=128,
105
- dark_n=1,
106
- flat_n=1,
107
- )
108
- MockEDF(
109
- scan_path=self._edf_folder_2,
110
- n_radio=10,
111
- n_ini_radio=10,
112
- n_extra_radio=0,
113
- dim=128,
114
- dark_n=1,
115
- flat_n=1,
116
- )
117
- self.widget = EDF2NXOW()
118
- self._process_manager = ProcessManager()
119
-
120
- def tearDown(self):
121
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
122
- self.widget.close()
123
- self.widget = None
124
- shutil.rmtree(self.tempdir)
125
- gc.collect()
126
-
127
- def test(self):
128
- self.widget.add(self._edf_folder_1)
129
- self.widget.add(self._edf_folder_2)
130
- self.widget._sendAll()
131
- self.qapp.processEvents()
132
- timeout = 10
133
- processing_queue = self.widget.task_executor_queue
134
- while not processing_queue.is_available and not processing_queue.empty():
135
- self.qapp.processEvents()
136
- time.sleep(0.1)
137
- timeout -= 0.1
138
- if timeout <= 0:
139
- raise TimeoutError
140
- # need to call one more time the processEvents tpo call callbacks and status notification
141
- for i in range(3):
142
- self.qapp.processEvents()
143
- time.sleep(0.1)
144
-
145
- # check the two output files exists and status of the processing is done...
146
- for folder in (self._edf_folder_1, self._edf_folder_2):
147
- scan = NXtomoScan(scan=folder + ".nx", entry="entry")
148
- self.assertTrue(os.path.exists(scan.master_file))
149
-
150
- self.assertEqual(
151
- self._process_manager.get_dataset_state(
152
- dataset_id=scan.get_identifier(),
153
- process=self.widget,
154
- ),
155
- DatasetState.SUCCEED,
156
- )
157
-
158
- def test_literal_dumps(self):
159
- self.widget._saveNXTomoCfgFile(cfg_file="")
160
- literal_dumps(self.widget._ewoks_default_inputs)
@@ -1,40 +0,0 @@
1
- import gc
2
- import pickle
3
- import numpy
4
-
5
- from silx.gui import qt
6
- from silx.gui.utils.testutils import TestCaseQt
7
-
8
- from orangecontrib.tomwer.widgets.control.ReduceDarkFlatSelectorOW import (
9
- ReduceDarkFlatSelectorOW,
10
- )
11
- from orangecanvas.scheme.readwrite import literal_dumps
12
-
13
-
14
- class TestEmailOW(TestCaseQt):
15
- def setUp(self):
16
- super().setUp()
17
- self.widget = ReduceDarkFlatSelectorOW()
18
- self.widget._dialog.addReduceFrames(
19
- {
20
- "reduce_frames_name": "new dict",
21
- -1: numpy.random.random(100 * 100).reshape(100, 100),
22
- 2: numpy.random.random(100 * 100).reshape(100, 100),
23
- },
24
- selected=(-1, 2),
25
- )
26
-
27
- def tearDown(self):
28
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
29
- self.widget.close()
30
- self.widget = None
31
- gc.collect()
32
-
33
- def test(self):
34
- self.widget.show()
35
-
36
- def test_serializing(self):
37
- pickle.dumps(self.widget.getConfiguration())
38
-
39
- def test_literal_dumps(self):
40
- literal_dumps(self.widget.getConfiguration())
@@ -1,40 +0,0 @@
1
- import gc
2
- import os
3
- import pickle
4
- import shutil
5
- import tempfile
6
-
7
- import numpy
8
- from orangecanvas.scheme.readwrite import literal_dumps
9
- from silx.gui import qt
10
- from silx.gui.utils.testutils import TestCaseQt
11
-
12
- from orangecontrib.tomwer.widgets.control.SingleTomoObjOW import SingleTomoObjOW
13
- from tomwer.core.volume.hdf5volume import HDF5Volume
14
-
15
-
16
- class TestSingleTomoObjOW(TestCaseQt):
17
- def setUp(self):
18
- super().setUp()
19
- self.window = SingleTomoObjOW()
20
- self.folder = tempfile.mkdtemp()
21
- self.volume_1 = HDF5Volume(
22
- file_path=os.path.join(self.folder, "vol_file.hdf5"),
23
- data_path="entry0000",
24
- data=numpy.linspace(0, 10, 100 * 100 * 3).reshape(3, 100, 100),
25
- )
26
- self.volume_1.save()
27
-
28
- def tearDown(self):
29
- self.window.setAttribute(qt.Qt.WA_DeleteOnClose)
30
- self.window.close()
31
- self.window = None
32
- shutil.rmtree(self.folder)
33
- gc.collect()
34
-
35
- def test(self):
36
- self.window.show()
37
- self.window.widget.setTomoObject(self.volume_1)
38
- # test serialization
39
- pickle.dumps(self.window._tomo_obj_setting)
40
- literal_dumps(self.window._tomo_obj_setting)
@@ -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.TimerOW import TimerOW
37
-
38
-
39
- class TestTimerOW(TestCaseQt):
40
- def setUp(self):
41
- super().setUp()
42
- self.widget = TimerOW()
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,96 +0,0 @@
1
- import gc
2
- import os
3
- import shutil
4
- import tempfile
5
-
6
- import numpy
7
- from silx.gui import qt
8
- from silx.gui.utils.testutils import SignalListener, TestCaseQt
9
-
10
- from orangecontrib.tomwer.widgets.control.TomoObjSerieOW import TomoObjSerieOW
11
- from tomwer.core.utils.scanutils import HDF5MockContext
12
- from tomwer.core.volume.hdf5volume import HDF5Volume
13
-
14
-
15
- class TestTomoObjSerieOW(TestCaseQt):
16
- """
17
- Test the TomoObjSerieOW orange widget
18
- """
19
-
20
- def setUp(self):
21
- super().setUp()
22
- self.window = TomoObjSerieOW()
23
- self.folder = tempfile.mkdtemp()
24
-
25
- # connect to the serie created signal
26
- self._listener = SignalListener()
27
- self.window._widget.sigSerieSelected.connect(self._listener)
28
-
29
- def tearDown(self):
30
- self.window.setAttribute(qt.Qt.WA_DeleteOnClose)
31
- self.window.close()
32
- self.window = None
33
- self._listener = None
34
- shutil.rmtree(self.folder)
35
- gc.collect()
36
-
37
- def test_with_volumes(self):
38
- """test the TomoObjSerieOW with volumes"""
39
- volume_1 = HDF5Volume(
40
- file_path=os.path.join(self.folder, "vol_file.hdf5"),
41
- data_path="entry0000",
42
- data=numpy.linspace(0, 10, 100 * 100 * 3).reshape(3, 100, 100),
43
- )
44
- volume_1.save()
45
- volume_2 = HDF5Volume(
46
- file_path=os.path.join(self.folder, "vol_file2.hdf5"),
47
- data_path="entry0001",
48
- data=numpy.linspace(60, 120, 100 * 100 * 5).reshape(5, 100, 100),
49
- )
50
- volume_2.save()
51
-
52
- assert self._listener.callCount() == 0
53
- assert len(self.window._widget._widget.getSelectedSerie()) == 0
54
- # add the volume to the possible objects to be added
55
- self.window.addTomoObj(volume_1)
56
- self.window.addTomoObj(volume_2)
57
- assert len(self.window._widget._widget.getSelectedSerie()) == 0
58
-
59
- # add volume to the serie defined
60
- newSerieWidget = (
61
- self.window._widget._widget._serieDefinitionWidget._manualDefWidget._newSerieWidget
62
- )
63
- newSerieWidget.addTomoObjToCurrentSerie(volume_1)
64
- assert len(self.window._widget._widget.getSelectedSerie()) == 1
65
- newSerieWidget.addTomoObjToCurrentSerie(
66
- volume_1
67
- ) # try adding twice the same object
68
- assert len(self.window._widget._widget.getSelectedSerie()) == 1
69
- newSerieWidget.addTomoObjToCurrentSerie(volume_2)
70
- assert len(self.window._widget._widget.getSelectedSerie()) == 2
71
- assert self._listener.callCount() == 0
72
- self.window._widget._selectButton.released.emit()
73
- self.qapp.processEvents()
74
- assert self._listener.callCount() == 1
75
-
76
- def test_with_scans(self):
77
- """test the TomoObjSerieOW with scans"""
78
- with HDF5MockContext(
79
- scan_path=os.path.join(self.folder, "test", "scan"), n_proj=100
80
- ) as scan:
81
- assert self._listener.callCount() == 0
82
-
83
- # add the scan to possible objects to be added
84
- self.window.addTomoObj(scan)
85
- assert len(self.window._widget._widget.getSelectedSerie()) == 0
86
-
87
- # add scan to the serie defined
88
- newSerieWidget = (
89
- self.window._widget._widget._serieDefinitionWidget._manualDefWidget._newSerieWidget
90
- )
91
- newSerieWidget.addTomoObjToCurrentSerie(scan)
92
-
93
- assert len(self.window._widget._widget.getSelectedSerie()) == 1
94
- self.window._widget._selectButton.released.emit()
95
- self.qapp.processEvents()
96
- assert self._listener.callCount() == 1
@@ -1,69 +0,0 @@
1
- import gc
2
- import os
3
- import pickle
4
- import shutil
5
- import tempfile
6
-
7
- import numpy
8
- from orangecanvas.scheme.readwrite import literal_dumps
9
- from silx.gui import qt
10
- from silx.gui.utils.testutils import TestCaseQt
11
-
12
- from orangecontrib.tomwer.widgets.control.VolumeSelector import VolumeSelectorOW
13
- from tomwer.core.volume.hdf5volume import HDF5Volume
14
-
15
-
16
- class TestVolumeSelectorOW(TestCaseQt):
17
- def setUp(self):
18
- super().setUp()
19
- self.window = VolumeSelectorOW()
20
- self.folder = tempfile.mkdtemp()
21
- self.volume_1 = HDF5Volume(
22
- file_path=os.path.join(self.folder, "vol_file.hdf5"),
23
- data_path="entry0000",
24
- data=numpy.linspace(0, 10, 100 * 100 * 3).reshape(3, 100, 100),
25
- )
26
- self.volume_1.save()
27
- self.volume_2 = HDF5Volume(
28
- file_path=os.path.join(self.folder, "vol_file2.hdf5"),
29
- data_path="entry0001",
30
- data=numpy.linspace(60, 120, 100 * 100 * 5).reshape(5, 100, 100),
31
- )
32
- self.volume_2.save()
33
-
34
- def tearDown(self):
35
- self.window.setAttribute(qt.Qt.WA_DeleteOnClose)
36
- self.window.close()
37
- self.window = None
38
- shutil.rmtree(self.folder)
39
- gc.collect()
40
-
41
- def test(self):
42
- self.window.show()
43
- # check adding one volume
44
- self.window.addVolume(self.volume_1)
45
- assert self.window.widget.dataList.n_data() == 1
46
- # check behavior adding the same volume
47
- self.window.addVolume(self.volume_1)
48
- assert self.window.widget.dataList.n_data() == 1
49
- # check adding another volume
50
- self.window.addVolume(self.volume_2)
51
- assert self.window.widget.dataList.n_data() == 2
52
- # check removing volume(s)
53
- self.window.removeVolume(self.volume_1)
54
- assert self.window.widget.dataList.n_data() == 1
55
- self.window.removeVolume(self.volume_1)
56
- assert self.window.widget.dataList.n_data() == 1
57
- self.window.removeVolume(self.volume_2)
58
- assert self.window.widget.dataList.n_data() == 0
59
-
60
- # and adding them back
61
- self.window.addVolume(self.volume_1)
62
- self.window.addVolume(self.volume_2)
63
- assert self.window.widget.dataList.n_data() == 2
64
-
65
- # test serialization
66
- self.window._updateSettings()
67
- assert len(self.window._scanIDs) == 2
68
- pickle.dumps(self.window._scanIDs)
69
- literal_dumps(self.window._scanIDs)
@@ -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.VolumeSymLinkOW import VolumeSymLinkOW
37
-
38
-
39
- # class TestVolumeSyncLinkOW(TestCaseQt):
40
- # def setUp(self):
41
- # super().setUp()
42
- # self.widget = VolumeSymLinkOW()
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,57 +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__ = "21/06/2021"
29
-
30
-
31
- import gc
32
- import shutil
33
- import tempfile
34
-
35
- from silx.gui import qt
36
- from silx.gui.utils.testutils import TestCaseQt
37
-
38
- from orangecontrib.tomwer.widgets.debugtools.DatasetGeneratorOW import (
39
- DatasetGeneratorOW,
40
- )
41
-
42
-
43
- class TestDatasetGeneratorOW(TestCaseQt):
44
- def setUp(self):
45
- self.tmp_dir = tempfile.mkdtemp()
46
- self.widget = DatasetGeneratorOW()
47
- self.widget.generatorGUI.mainWidget.setRootDir(self.tmp_dir)
48
-
49
- def tearDown(self):
50
- shutil.rmtree(self.tmp_dir)
51
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
52
- self.widget.close()
53
- self.widget = None
54
- gc.collect()
55
-
56
- def test(self):
57
- self.widget._generate().join()
@@ -1,62 +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__ = "21/06/2021"
29
-
30
-
31
- import gc
32
- import os
33
- import shutil
34
- import tempfile
35
-
36
- from silx.gui import qt
37
- from silx.gui.utils.testutils import TestCaseQt
38
-
39
- from orangecontrib.tomwer.widgets.debugtools.ObjectInspectorOW import ObjectInspectorOW
40
- from tomwer.core.utils.scanutils import MockNXtomo
41
-
42
-
43
- class TestObjectInspectorOW(TestCaseQt):
44
- def setUp(self):
45
- super().setUp()
46
- self.tmp_dir = tempfile.mkdtemp()
47
- self.scan = MockNXtomo(
48
- scan_path=os.path.join(self.tmp_dir, "myscan"),
49
- n_proj=20,
50
- n_ini_proj=20,
51
- dim=10,
52
- ).scan
53
-
54
- def tearDown(self):
55
- shutil.rmtree(self.tmp_dir)
56
- gc.collect()
57
-
58
- def test(self):
59
- widget = ObjectInspectorOW()
60
- widget.setObject(self.scan)
61
- widget.setAttribute(qt.Qt.WA_DeleteOnClose)
62
- widget.close()
@@ -1,31 +0,0 @@
1
- import gc
2
- import logging
3
-
4
- from silx.gui import qt
5
- from silx.gui.utils.testutils import TestCaseQt
6
-
7
- from orangecontrib.tomwer.widgets.other.PythonScriptOW import OWPythonScript
8
- from tomwer.core.scan.nxtomoscan import NXtomoScan
9
- from tomwer.core.volume.hdf5volume import HDF5Volume
10
-
11
- logging.disable(logging.INFO)
12
-
13
-
14
- class TestEDFDarkRefWidget(TestCaseQt):
15
- def setUp(self):
16
- TestCaseQt.setUp(self)
17
- self.widget = OWPythonScript()
18
- self._scan = NXtomoScan("my_file.hdf5", entry="entry0000")
19
- self._volume = HDF5Volume(file_path="my_volume.hdf5", data_path="volume")
20
-
21
- def tearDown(self):
22
- self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
23
- self.widget.close()
24
- self.widget = None
25
- gc.collect()
26
-
27
- def test_handle_data(self):
28
- self.widget.handle_input(self._scan, (1,), "data")
29
-
30
- def test_handle_volume(self):
31
- self.widget.handle_input(self._volume, (1,), "volume")