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.
- tomwer/core/process/reconstruction/nabu/utils.py +2 -0
- tomwer/gui/control/datawatcher/datawatcher.py +1 -24
- tomwer/version.py +1 -1
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/METADATA +1 -1
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/RECORD +11 -108
- orangecontrib/tomwer/test/TestAcquisition.py +0 -246
- orangecontrib/tomwer/widgets/cluster/test/test_future_supervisorow.py +0 -87
- orangecontrib/tomwer/widgets/cluster/test/test_slurm_clusterow.py +0 -67
- orangecontrib/tomwer/widgets/control/test/test_advancement.py +0 -51
- orangecontrib/tomwer/widgets/control/test/test_data_validator.py +0 -55
- orangecontrib/tomwer/widgets/control/test/test_datadiscovery.py +0 -131
- orangecontrib/tomwer/widgets/control/test/test_datalist.py +0 -70
- orangecontrib/tomwer/widgets/control/test/test_datalistener.py +0 -137
- orangecontrib/tomwer/widgets/control/test/test_dataselector.py +0 -95
- orangecontrib/tomwer/widgets/control/test/test_datawatcher.py +0 -436
- orangecontrib/tomwer/widgets/control/test/test_emailow.py +0 -29
- orangecontrib/tomwer/widgets/control/test/test_notifier.py +0 -51
- orangecontrib/tomwer/widgets/control/test/test_nxtomo_concatenate_ow.py +0 -64
- orangecontrib/tomwer/widgets/control/test/test_nxtomomill.py +0 -160
- orangecontrib/tomwer/widgets/control/test/test_reduce_dark_flat_selector.py +0 -40
- orangecontrib/tomwer/widgets/control/test/test_singletomoobj.py +0 -40
- orangecontrib/tomwer/widgets/control/test/test_timerow.py +0 -51
- orangecontrib/tomwer/widgets/control/test/test_tomoobj_serie.py +0 -96
- orangecontrib/tomwer/widgets/control/test/test_volume_selector.py +0 -69
- orangecontrib/tomwer/widgets/control/test/test_volumesymlink.py +0 -51
- orangecontrib/tomwer/widgets/debugtools/test/test_dataset_generator.py +0 -57
- orangecontrib/tomwer/widgets/debugtools/test/test_object_inspector.py +0 -62
- orangecontrib/tomwer/widgets/other/test/test_pythonscript.py +0 -31
- orangecontrib/tomwer/widgets/reconstruction/test/test_axis.py +0 -224
- orangecontrib/tomwer/widgets/reconstruction/test/test_cast_volumeow.py +0 -85
- orangecontrib/tomwer/widgets/reconstruction/test/test_dark_refs_widget.py +0 -136
- orangecontrib/tomwer/widgets/reconstruction/test/test_delta_beta_selector.py +0 -15
- orangecontrib/tomwer/widgets/reconstruction/test/test_i_norm.py +0 -226
- orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_helical_prepare_weights_double.py +0 -20
- orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_volume.py +0 -100
- orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_widget.py +0 -107
- orangecontrib/tomwer/widgets/reconstruction/test/test_sa_delta_beta.py +0 -194
- orangecontrib/tomwer/widgets/reconstruction/test/test_saaxis.py +0 -220
- orangecontrib/tomwer/widgets/stitching/test/test_zstitching.py +0 -308
- orangecontrib/tomwer/widgets/test/test_conditions.py +0 -111
- orangecontrib/tomwer/widgets/test/test_darkref.py +0 -251
- orangecontrib/tomwer/widgets/test/test_foldertransfert.py +0 -131
- orangecontrib/tomwer/widgets/visualization/test/test_dataviewerow.py +0 -83
- orangecontrib/tomwer/widgets/visualization/test/test_diffviewerow.py +0 -65
- orangecontrib/tomwer/widgets/visualization/test/test_live_sliceow.py +0 -63
- orangecontrib/tomwer/widgets/visualization/test/test_nxtomo_metadata_viewer.py +0 -29
- orangecontrib/tomwer/widgets/visualization/test/test_radio_stackow.py +0 -56
- orangecontrib/tomwer/widgets/visualization/test/test_sample_movedow.py +0 -72
- orangecontrib/tomwer/widgets/visualization/test/test_sinogram_viewerow.py +0 -56
- orangecontrib/tomwer/widgets/visualization/test/test_slice_stackow.py +0 -57
- orangecontrib/tomwer/widgets/visualization/test/test_volume_viewerow.py +0 -57
- tomwer/core/log/test/test_processlog.py +0 -41
- tomwer/core/process/edit/test/test_darkflatpatch.py +0 -269
- tomwer/core/process/edit/test/test_imagekey_editor.py +0 -125
- tomwer/core/process/icat/test/test_create_screenshots.py +0 -98
- tomwer/core/process/icat/test/test_gallery.py +0 -170
- tomwer/core/process/reconstruction/nabu/test/test_castvolume.py +0 -143
- tomwer/core/process/reconstruction/nabu/test/test_nabu_utils.py +0 -203
- tomwer/core/process/reconstruction/nabu/test/test_nabunormalization.py +0 -222
- tomwer/core/process/script/test/test_script.py +0 -68
- tomwer/core/process/stitching/test/test_metadataholder.py +0 -17
- tomwer/core/process/visualization/test/test_data_viewer.py +0 -39
- tomwer/core/process/visualization/test/test_diff_viewer.py +0 -39
- tomwer/core/process/visualization/test/test_image_stack_viewer.py +0 -41
- tomwer/core/process/visualization/test/test_radio_stack.py +0 -39
- tomwer/core/process/visualization/test/test_sample_moved.py +0 -41
- tomwer/core/process/visualization/test/test_sinogram_viewer.py +0 -39
- tomwer/core/process/visualization/test/test_slice_stack.py +0 -39
- tomwer/core/process/visualization/test/test_volume_viewer.py +0 -39
- tomwer/core/utils/test/test_image.py +0 -30
- tomwer/core/utils/test/test_nxtomo.py +0 -66
- tomwer/core/utils/test/test_scan_utils.py +0 -46
- tomwer/core/utils/test/test_time.py +0 -6
- tomwer/core/volume/test/test_volumes.py +0 -21
- tomwer/gui/control/serie/test/test_creator.py +0 -451
- tomwer/gui/control/serie/test/test_nxtomo_concatenate.py +0 -21
- tomwer/gui/icat/test/test_create_screenshots_gui.py +0 -23
- tomwer/gui/icat/test/test_gallery_gui.py +0 -37
- tomwer/gui/reconstruction/nabu/test/test_check.py +0 -92
- tomwer/gui/reconstruction/nabu/test/test_ctf.py +0 -46
- tomwer/gui/reconstruction/nabu/test/test_helical.py +0 -21
- tomwer/gui/reconstruction/nabu/test/test_nabu_preprocessing.py +0 -81
- tomwer/gui/reconstruction/normalization/test/test_intensity.py +0 -119
- tomwer/gui/stitching/config/tests/test_axisparams.py +0 -25
- tomwer/gui/stitching/tests/test_axis_ordered_list.py +0 -21
- tomwer/gui/stitching/tests/test_normalization.py +0 -27
- tomwer/gui/stitching/tests/test_preview.py +0 -85
- tomwer/gui/stitching/tests/test_stitching_raw.py +0 -110
- tomwer/gui/stitching/tests/test_z_stitching.py +0 -67
- tomwer/gui/stitching/tests/utils.py +0 -79
- tomwer/gui/stitching/z_stitching/tests/test_fine_estimation.py +0 -35
- tomwer/gui/stitching/z_stitching/tests/test_raw_estimation.py +0 -215
- tomwer/gui/stitching/z_stitching/tests/test_stitching_window.py +0 -51
- tomwer/gui/utils/test/test_completer.py +0 -67
- tomwer/gui/utils/test/test_line_selector.py +0 -21
- tomwer/gui/utils/test/test_splashscreen.py +0 -8
- tomwer/gui/utils/test/test_vignettes.py +0 -68
- tomwer/io/utils/test/test_raw_and_processed_data.py +0 -10
- tomwer/io/utils/test/test_utils.py +0 -92
- tomwer/tests/test_ewoks/test_conversion.py +0 -104
- tomwer/tests/test_ewoks/test_single_node_execution.py +0 -112
- tomwer/tests/test_ewoks/test_workflows.py +0 -160
- /tomwer-1.3.7-py3.11-nspkg.pth → /tomwer-1.3.8-py3.11-nspkg.pth +0 -0
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/LICENSE +0 -0
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/WHEEL +0 -0
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/entry_points.txt +0 -0
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/top_level.txt +0 -0
@@ -1,87 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# /*##########################################################################
|
3
|
-
#
|
4
|
-
# Copyright (c) 2017-2019 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__ = "10/12/2021"
|
28
|
-
|
29
|
-
|
30
|
-
import asyncio
|
31
|
-
import os
|
32
|
-
import shutil
|
33
|
-
import tempfile
|
34
|
-
|
35
|
-
import pytest
|
36
|
-
from silx.gui import qt
|
37
|
-
from silx.gui.utils.testutils import TestCaseQt
|
38
|
-
|
39
|
-
from orangecontrib.tomwer.widgets.cluster.FutureSupervisorOW import FutureSupervisorOW
|
40
|
-
from tomwer.core.futureobject import FutureTomwerObject
|
41
|
-
from tomwer.core.utils.scanutils import MockNXtomo
|
42
|
-
from tomwer.tests.utils import skip_gui_test
|
43
|
-
|
44
|
-
|
45
|
-
@pytest.mark.skipif(skip_gui_test(), reason="skip gui test")
|
46
|
-
class TestFutureSupervisorOW(TestCaseQt):
|
47
|
-
"""Test that the axis widget work correctly"""
|
48
|
-
|
49
|
-
def setUp(self):
|
50
|
-
super().setUp()
|
51
|
-
self._window = FutureSupervisorOW()
|
52
|
-
self.tempdir = tempfile.mkdtemp()
|
53
|
-
|
54
|
-
# set up scans
|
55
|
-
self._scans = []
|
56
|
-
self._future_tomo_objs = []
|
57
|
-
for i in range(5):
|
58
|
-
# create scan
|
59
|
-
scan = MockNXtomo(
|
60
|
-
scan_path=os.path.join(self.tempdir, f"scan_test{i}"),
|
61
|
-
n_proj=10,
|
62
|
-
n_ini_proj=10,
|
63
|
-
create_ini_dark=False,
|
64
|
-
create_ini_flat=False,
|
65
|
-
dim=10,
|
66
|
-
).scan
|
67
|
-
self._scans.append(scan)
|
68
|
-
|
69
|
-
# create future
|
70
|
-
future = asyncio.Future()
|
71
|
-
if i == 1:
|
72
|
-
future.set_result(None)
|
73
|
-
self._future_tomo_objs.append(
|
74
|
-
FutureTomwerObject(
|
75
|
-
tomo_obj=scan,
|
76
|
-
futures=(future,),
|
77
|
-
)
|
78
|
-
)
|
79
|
-
|
80
|
-
def tearDown(self):
|
81
|
-
self._window.setAttribute(qt.Qt.WA_DeleteOnClose)
|
82
|
-
self._window.close()
|
83
|
-
self._window = None
|
84
|
-
shutil.rmtree(self.tempdir)
|
85
|
-
self._scans.clear()
|
86
|
-
self._future_tomo_objs.clear()
|
87
|
-
super().tearDown()
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# /*##########################################################################
|
3
|
-
#
|
4
|
-
# Copyright (c) 2017-2019 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__ = "10/12/2021"
|
28
|
-
|
29
|
-
|
30
|
-
import gc
|
31
|
-
import pickle
|
32
|
-
|
33
|
-
import pytest
|
34
|
-
from orangecanvas.scheme.readwrite import literal_dumps
|
35
|
-
from silx.gui import qt
|
36
|
-
from silx.gui.utils.testutils import TestCaseQt
|
37
|
-
|
38
|
-
from orangecontrib.tomwer.widgets.cluster.SlurmClusterOW import SlurmClusterOW
|
39
|
-
from tomwer.core.cluster.cluster import SlurmClusterConfiguration
|
40
|
-
from tomwer.tests.utils import skip_gui_test
|
41
|
-
|
42
|
-
|
43
|
-
@pytest.mark.skipif(skip_gui_test(), reason="skip gui test")
|
44
|
-
class TestSlurmClusterOW(TestCaseQt):
|
45
|
-
"""Test that the axis widget work correctly"""
|
46
|
-
|
47
|
-
def setUp(self):
|
48
|
-
super().setUp()
|
49
|
-
self._window = SlurmClusterOW()
|
50
|
-
|
51
|
-
def tearDown(self):
|
52
|
-
self._window.setAttribute(qt.Qt.WA_DeleteOnClose)
|
53
|
-
self._window.close()
|
54
|
-
self._window = None
|
55
|
-
gc.collect()
|
56
|
-
|
57
|
-
def test(self):
|
58
|
-
self._window.show()
|
59
|
-
self.qWaitForWindowExposed(self._window)
|
60
|
-
configuration = self._window.getConfiguration()
|
61
|
-
assert isinstance(configuration, SlurmClusterConfiguration)
|
62
|
-
|
63
|
-
def test_serializing(self):
|
64
|
-
pickle.dumps(self._window.getConfiguration().to_dict())
|
65
|
-
|
66
|
-
def test_literal_dumps(self):
|
67
|
-
literal_dumps(self._window.getConfiguration().to_dict())
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# /*##########################################################################
|
3
|
-
#
|
4
|
-
# Copyright (c) 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
|
-
|
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.AdvancementOW import AdvancementOW
|
37
|
-
|
38
|
-
|
39
|
-
class TestAdvancementOw(TestCaseQt):
|
40
|
-
def setUp(self):
|
41
|
-
super().setUp()
|
42
|
-
self.widget = AdvancementOW()
|
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,55 +0,0 @@
|
|
1
|
-
import gc
|
2
|
-
import os
|
3
|
-
import shutil
|
4
|
-
import tempfile
|
5
|
-
|
6
|
-
from silx.gui import qt
|
7
|
-
from silx.gui.utils.testutils import TestCaseQt
|
8
|
-
|
9
|
-
from orangecontrib.tomwer.widgets.control.DataValidatorOW import DataValidatorOW
|
10
|
-
from tomwer.core.utils.scanutils import MockNXtomo
|
11
|
-
|
12
|
-
|
13
|
-
class TestDataValidatorOW(TestCaseQt):
|
14
|
-
"""
|
15
|
-
simple test on the DataValidatorOW widget
|
16
|
-
"""
|
17
|
-
|
18
|
-
def setUp(self):
|
19
|
-
super().setUp()
|
20
|
-
self.window = DataValidatorOW()
|
21
|
-
self.folder = tempfile.mkdtemp()
|
22
|
-
self.scan_1 = MockNXtomo(
|
23
|
-
scan_path=os.path.join(self.folder, "scan_1"),
|
24
|
-
n_proj=20,
|
25
|
-
n_ini_proj=20,
|
26
|
-
dim=10,
|
27
|
-
).scan
|
28
|
-
self.scan_2 = MockNXtomo(
|
29
|
-
scan_path=os.path.join(self.folder, "scan_2"),
|
30
|
-
n_proj=20,
|
31
|
-
n_ini_proj=20,
|
32
|
-
dim=10,
|
33
|
-
).scan
|
34
|
-
|
35
|
-
def tearDown(self):
|
36
|
-
self.window.setAttribute(qt.Qt.WA_DeleteOnClose)
|
37
|
-
self.window.close()
|
38
|
-
self.window = None
|
39
|
-
shutil.rmtree(self.folder)
|
40
|
-
gc.collect()
|
41
|
-
|
42
|
-
def test(self):
|
43
|
-
def wait_processing():
|
44
|
-
while self.qapp.hasPendingEvents():
|
45
|
-
self.qapp.processEvents()
|
46
|
-
|
47
|
-
assert self.window.getNScanToValidate() == 0
|
48
|
-
self.window.addScan(self.scan_1)
|
49
|
-
wait_processing()
|
50
|
-
self.window.addScan(self.scan_2)
|
51
|
-
wait_processing()
|
52
|
-
assert self.window.getNScanToValidate() == 2
|
53
|
-
self.window._widget.validateCurrentScan()
|
54
|
-
wait_processing()
|
55
|
-
assert self.window.getNScanToValidate() == 1
|
@@ -1,131 +0,0 @@
|
|
1
|
-
__authors__ = ["H. Payno"]
|
2
|
-
__license__ = "MIT"
|
3
|
-
__date__ = "27/03/2023"
|
4
|
-
|
5
|
-
|
6
|
-
import gc
|
7
|
-
import os
|
8
|
-
import pickle
|
9
|
-
import tempfile
|
10
|
-
|
11
|
-
from orangecanvas.scheme.readwrite import literal_dumps
|
12
|
-
from silx.gui import qt
|
13
|
-
from silx.gui.utils.testutils import SignalListener, TestCaseQt
|
14
|
-
|
15
|
-
from orangecontrib.tomwer.widgets.control.DataDiscoveryOW import DataDiscoveryOW
|
16
|
-
from tomwer.core.scan.scantype import ScanType
|
17
|
-
from tomwer.core.utils.scanutils import MockBlissAcquisition
|
18
|
-
from tomoscan.esrf.scan.mock import MockNXtomo, MockEDF
|
19
|
-
|
20
|
-
|
21
|
-
class TestDataDiscovery(TestCaseQt):
|
22
|
-
WAIT_TIME = 5000 # thread processing wait time in ms
|
23
|
-
|
24
|
-
def setUp(self):
|
25
|
-
super().setUp()
|
26
|
-
self.widget = DataDiscoveryOW()
|
27
|
-
self.widget.setConfiguration(self.default_settings)
|
28
|
-
self.signal_listener = SignalListener()
|
29
|
-
self.widget.getProcessingThread().sigDataFound.connect(self.signal_listener)
|
30
|
-
|
31
|
-
def tearDown(self):
|
32
|
-
self.widget.getProcessingThread().sigDataFound.disconnect(self.signal_listener)
|
33
|
-
self.signal_listener = None
|
34
|
-
self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
|
35
|
-
self.widget.close()
|
36
|
-
self.widget = None
|
37
|
-
gc.collect()
|
38
|
-
|
39
|
-
@property
|
40
|
-
def default_settings(self):
|
41
|
-
return {
|
42
|
-
"start_folder": "/my/folder",
|
43
|
-
"file_filter": "*.h5",
|
44
|
-
"scan_type_searched": ScanType.NX_TOMO,
|
45
|
-
}
|
46
|
-
|
47
|
-
def testSerialization(self):
|
48
|
-
"""make sure pickling works for the settings"""
|
49
|
-
pickle.dumps(self.widget.getConfiguration())
|
50
|
-
|
51
|
-
def testLiteralDumps(self):
|
52
|
-
"""make sure literal dumps (from orangecanvas) works for the settings"""
|
53
|
-
literal_dumps(self.widget.getConfiguration())
|
54
|
-
|
55
|
-
def testProcessingNXtomo(self):
|
56
|
-
"""Test the widget can find NXtomos"""
|
57
|
-
n_scan = 3
|
58
|
-
with tempfile.TemporaryDirectory() as root_dir:
|
59
|
-
for i_scan in range(n_scan):
|
60
|
-
MockNXtomo(
|
61
|
-
scan_path=os.path.join(root_dir, f"sub_folder_{i_scan}", "scan"),
|
62
|
-
n_proj=10,
|
63
|
-
n_ini_proj=10,
|
64
|
-
dim=10,
|
65
|
-
)
|
66
|
-
self.widget.setFolderObserved(root_dir)
|
67
|
-
self.widget.start_discovery(wait=self.WAIT_TIME)
|
68
|
-
while self.qapp.hasPendingEvents():
|
69
|
-
self.qapp.processEvents()
|
70
|
-
|
71
|
-
assert self.signal_listener.callCount() == n_scan
|
72
|
-
|
73
|
-
def testProcessingBlissRawScan(self):
|
74
|
-
"""Test the widget can find bliss raw scans"""
|
75
|
-
with tempfile.TemporaryDirectory() as root_dir:
|
76
|
-
n_scan = 2
|
77
|
-
for i_scan in range(n_scan):
|
78
|
-
MockBlissAcquisition(
|
79
|
-
n_sample=1,
|
80
|
-
n_sequence=1,
|
81
|
-
n_scan_per_sequence=1,
|
82
|
-
n_darks=1,
|
83
|
-
n_flats=1,
|
84
|
-
with_nx=True,
|
85
|
-
output_dir=os.path.join(root_dir, f"sub_folder_{i_scan}", "scan"),
|
86
|
-
)
|
87
|
-
|
88
|
-
self.widget.setFilePattern("*.edf")
|
89
|
-
self.widget.setSearchScanType(ScanType.BLISS)
|
90
|
-
self.widget.setFolderObserved(root_dir)
|
91
|
-
self.widget.start_discovery(wait=self.WAIT_TIME)
|
92
|
-
while self.qapp.hasPendingEvents():
|
93
|
-
self.qapp.processEvents()
|
94
|
-
|
95
|
-
assert (
|
96
|
-
self.signal_listener.callCount() == 0
|
97
|
-
) # because of the filtering on files
|
98
|
-
self.widget.setFilePattern(None)
|
99
|
-
self.widget.start_discovery(wait=self.WAIT_TIME)
|
100
|
-
while self.qapp.hasPendingEvents():
|
101
|
-
self.qapp.processEvents()
|
102
|
-
|
103
|
-
assert self.signal_listener.callCount() == n_scan
|
104
|
-
|
105
|
-
def testProcessingSpecScan(self):
|
106
|
-
"""Test the widget can find bliss raw scans"""
|
107
|
-
with tempfile.TemporaryDirectory() as root_dir:
|
108
|
-
n_scan = 4
|
109
|
-
for i_scan in range(n_scan):
|
110
|
-
MockEDF(
|
111
|
-
n_radio=4,
|
112
|
-
n_ini_radio=4,
|
113
|
-
scan_path=os.path.join(root_dir, f"sub_folder_{i_scan}", "scan"),
|
114
|
-
)
|
115
|
-
|
116
|
-
self.widget.setSearchScanType(ScanType.BLISS)
|
117
|
-
self.widget.setFilePattern(None)
|
118
|
-
self.widget.setFolderObserved(root_dir)
|
119
|
-
self.widget.start_discovery(wait=self.WAIT_TIME)
|
120
|
-
while self.qapp.hasPendingEvents():
|
121
|
-
self.qapp.processEvents()
|
122
|
-
|
123
|
-
assert (
|
124
|
-
self.signal_listener.callCount() == 0
|
125
|
-
) # because of the scan type searched
|
126
|
-
self.widget.setSearchScanType(ScanType.SPEC)
|
127
|
-
self.widget.setFilePattern(None)
|
128
|
-
self.widget.start_discovery(wait=self.WAIT_TIME)
|
129
|
-
while self.qapp.hasPendingEvents():
|
130
|
-
self.qapp.processEvents()
|
131
|
-
assert self.signal_listener.callCount() == n_scan
|
@@ -1,70 +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 pickle
|
33
|
-
import shutil
|
34
|
-
import tempfile
|
35
|
-
|
36
|
-
from orangecanvas.scheme.readwrite import literal_dumps
|
37
|
-
from silx.gui import qt
|
38
|
-
from silx.gui.utils.testutils import TestCaseQt
|
39
|
-
|
40
|
-
from orangecontrib.tomwer.widgets.control.DataListOW import DataListOW
|
41
|
-
from tomwer.core.utils.scanutils import MockNXtomo
|
42
|
-
|
43
|
-
|
44
|
-
class TestDataListOw(TestCaseQt):
|
45
|
-
def setUp(self):
|
46
|
-
super().setUp()
|
47
|
-
self.tempdir = tempfile.mkdtemp()
|
48
|
-
dim = 10
|
49
|
-
mock = MockNXtomo(
|
50
|
-
scan_path=self.tempdir, n_proj=10, n_ini_proj=10, scan_range=180, dim=dim
|
51
|
-
)
|
52
|
-
self.scan = mock.scan
|
53
|
-
self.widget = DataListOW()
|
54
|
-
|
55
|
-
def tearDown(self):
|
56
|
-
self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
|
57
|
-
self.widget.close()
|
58
|
-
self.widget = None
|
59
|
-
shutil.rmtree(self.tempdir)
|
60
|
-
gc.collect()
|
61
|
-
|
62
|
-
def test(self):
|
63
|
-
self.widget.add(self.scan)
|
64
|
-
self.qapp.processEvents()
|
65
|
-
|
66
|
-
# test serialization
|
67
|
-
assert len(self.widget._scanIDs) == 1
|
68
|
-
pickle.dumps(self.widget._scanIDs)
|
69
|
-
|
70
|
-
literal_dumps(self.widget._scanIDs)
|
@@ -1,137 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# /*##########################################################################
|
3
|
-
#
|
4
|
-
# Copyright (c) 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
|
-
|
26
|
-
__authors__ = ["H. Payno"]
|
27
|
-
__license__ = "MIT"
|
28
|
-
__date__ = "28/04/2020"
|
29
|
-
|
30
|
-
|
31
|
-
import gc
|
32
|
-
import os
|
33
|
-
import pickle
|
34
|
-
import shutil
|
35
|
-
import tempfile
|
36
|
-
import time
|
37
|
-
from glob import glob
|
38
|
-
|
39
|
-
import pytest
|
40
|
-
from orangecanvas.scheme.readwrite import literal_dumps
|
41
|
-
from silx.gui import qt
|
42
|
-
from silx.gui.utils.testutils import TestCaseQt
|
43
|
-
|
44
|
-
from orangecontrib.tomwer.widgets.control.DataListenerOW import DataListenerOW
|
45
|
-
from tomwer.core import settings
|
46
|
-
from tomwer.core.process.control.datalistener.rpcserver import BlissAcquisition
|
47
|
-
from tomwer.core.utils.scanutils import MockBlissAcquisition
|
48
|
-
from tomwer.tests.utils import skip_gui_test
|
49
|
-
|
50
|
-
try:
|
51
|
-
from tomwer.synctools.rsyncmanager import RSyncManager # noqa F401
|
52
|
-
except ImportError:
|
53
|
-
has_rsync = False
|
54
|
-
else:
|
55
|
-
has_rsync = RSyncManager().has_rsync()
|
56
|
-
|
57
|
-
|
58
|
-
@pytest.mark.skipif(skip_gui_test(), reason="skip gui test")
|
59
|
-
class TestDataListenerSynchronization(TestCaseQt):
|
60
|
-
"""Insure synchronization is working with the orangecontrib widget"""
|
61
|
-
|
62
|
-
def setUp(self):
|
63
|
-
super().setUp()
|
64
|
-
self._src_dir = tempfile.mkdtemp()
|
65
|
-
self._dst_dir = tempfile.mkdtemp()
|
66
|
-
# mock lbsram
|
67
|
-
settings.mock_lsbram(True)
|
68
|
-
settings._set_lbsram_path(self._src_dir)
|
69
|
-
settings._set_dest_path(self._dst_dir)
|
70
|
-
|
71
|
-
scan_path = os.path.join(self._src_dir, "scan0000")
|
72
|
-
self.mock_scan = MockBlissAcquisition(
|
73
|
-
n_sample=1,
|
74
|
-
n_sequence=1,
|
75
|
-
n_scan_per_sequence=3,
|
76
|
-
n_darks=2,
|
77
|
-
n_flats=2,
|
78
|
-
output_dir=scan_path,
|
79
|
-
)
|
80
|
-
|
81
|
-
self.bliss_acquisition = BlissAcquisition(
|
82
|
-
file_path=self.mock_scan.samples[0].sample_file,
|
83
|
-
proposal_file=self.mock_scan.proposal_file,
|
84
|
-
sample_file=self.mock_scan.samples[0].sample_file,
|
85
|
-
entry_name="self.entry = '/1'",
|
86
|
-
start_time=time.ctime(),
|
87
|
-
)
|
88
|
-
|
89
|
-
self.widget = DataListenerOW()
|
90
|
-
|
91
|
-
def tearDown(self):
|
92
|
-
self.mock_scan = None
|
93
|
-
self.bliss_acquisition = None
|
94
|
-
# self.widget.activate(False)
|
95
|
-
self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
|
96
|
-
self.widget.close()
|
97
|
-
self.widget = None
|
98
|
-
shutil.rmtree(self._src_dir)
|
99
|
-
shutil.rmtree(self._dst_dir)
|
100
|
-
gc.collect()
|
101
|
-
|
102
|
-
@pytest.mark.skipif(not has_rsync, reason="rsync not installed")
|
103
|
-
def testSynchronization(self):
|
104
|
-
"""Make sure the datalistener will launch a synchronization on the
|
105
|
-
data dir when receive it"""
|
106
|
-
self.assertEqual(len(os.listdir(self._dst_dir)), 0)
|
107
|
-
self.widget.activate(True)
|
108
|
-
|
109
|
-
self.widget.get_listening_thread()._rpc_sequence_started(
|
110
|
-
saving_file=self.bliss_acquisition.sample_file,
|
111
|
-
scan_title="toto",
|
112
|
-
sequence_scan_number="1",
|
113
|
-
proposal_file=self.bliss_acquisition.proposal_file,
|
114
|
-
sample_file=self.bliss_acquisition.sample_file,
|
115
|
-
)
|
116
|
-
time.sleep(1.0)
|
117
|
-
self.assertEqual(self.widget._get_n_scan_observe(), 1)
|
118
|
-
self.assertEqual(len(os.listdir(self._dst_dir)), 1)
|
119
|
-
self.widget.get_listening_thread()._rpc_sequence_ended(
|
120
|
-
saving_file=self.bliss_acquisition.sample_file,
|
121
|
-
sequence_scan_number="1",
|
122
|
-
success=True,
|
123
|
-
)
|
124
|
-
nx_pattern = os.path.join(self.mock_scan.samples[0].sample_directory, "*.nx")
|
125
|
-
self.assertEqual(len(glob(nx_pattern)), 0)
|
126
|
-
for i in range(8):
|
127
|
-
self.qapp.processEvents()
|
128
|
-
time.sleep(1.0)
|
129
|
-
# check .nx file has been created
|
130
|
-
#
|
131
|
-
self.assertEqual(len(glob(nx_pattern)), 1)
|
132
|
-
|
133
|
-
def testSerialization(self):
|
134
|
-
pickle.dumps(self.widget.get_configuration())
|
135
|
-
|
136
|
-
def testLiteralDumps(self):
|
137
|
-
literal_dumps(self.widget.get_configuration())
|
@@ -1,95 +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 pickle
|
34
|
-
import shutil
|
35
|
-
import tempfile
|
36
|
-
|
37
|
-
from orangecanvas.scheme.readwrite import literal_dumps
|
38
|
-
from silx.gui import qt
|
39
|
-
from silx.gui.utils.testutils import TestCaseQt
|
40
|
-
|
41
|
-
from orangecontrib.tomwer.widgets.control.DataSelectorOW import DataSelectorOW
|
42
|
-
from tomwer.core.utils.scanutils import MockNXtomo
|
43
|
-
from tomwer.synctools.axis import QAxisRP
|
44
|
-
|
45
|
-
|
46
|
-
class TestDataSelectorOw(TestCaseQt):
|
47
|
-
def setUp(self):
|
48
|
-
super().setUp()
|
49
|
-
self.tempdir = tempfile.mkdtemp()
|
50
|
-
dim = 10
|
51
|
-
mock = MockNXtomo(
|
52
|
-
scan_path=os.path.join(self.tempdir, "scan1"),
|
53
|
-
n_proj=10,
|
54
|
-
n_ini_proj=10,
|
55
|
-
scan_range=180,
|
56
|
-
dim=dim,
|
57
|
-
)
|
58
|
-
self.scan1 = mock.scan
|
59
|
-
mock = MockNXtomo(
|
60
|
-
scan_path=os.path.join(self.tempdir, "scan2"),
|
61
|
-
n_proj=10,
|
62
|
-
n_ini_proj=10,
|
63
|
-
scan_range=180,
|
64
|
-
dim=dim,
|
65
|
-
)
|
66
|
-
self.scan2 = mock.scan
|
67
|
-
self.widget = DataSelectorOW()
|
68
|
-
|
69
|
-
def tearDown(self):
|
70
|
-
self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
|
71
|
-
self.widget.close()
|
72
|
-
self.widget = None
|
73
|
-
shutil.rmtree(self.tempdir)
|
74
|
-
gc.collect()
|
75
|
-
|
76
|
-
def test(self):
|
77
|
-
for scan in (self.scan1, self.scan2):
|
78
|
-
assert scan.axis_params is None
|
79
|
-
scan.axis_params = QAxisRP()
|
80
|
-
self.widget.add(scan)
|
81
|
-
self.qapp.processEvents()
|
82
|
-
scan_1_identifier = scan.get_identifier()
|
83
|
-
assert scan_1_identifier.to_str() in self.widget.widget.dataList._myitems
|
84
|
-
item = self.widget.widget.dataList._myitems[scan_1_identifier.to_str()]
|
85
|
-
data_obj = item.data(qt.Qt.UserRole)
|
86
|
-
assert id(scan) == id(data_obj)
|
87
|
-
assert scan.axis_params is not None
|
88
|
-
self.widget.selectAll()
|
89
|
-
self.widget.send()
|
90
|
-
self.qapp.processEvents()
|
91
|
-
|
92
|
-
# test serialization
|
93
|
-
assert len(self.widget._scanIDs) == 2
|
94
|
-
pickle.dumps(self.widget._scanIDs)
|
95
|
-
literal_dumps(self.widget._scanIDs)
|