tomwer 1.4.0rc6__py3-none-any.whl → 1.4.1__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.
- orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +2 -2
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +19 -47
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +8 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +4 -6
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +8 -4
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +0 -4
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +1 -13
- tomwer/app/axis.py +0 -1
- tomwer/app/intensitynormalization.py +0 -14
- tomwer/app/multicor.py +1 -33
- tomwer/app/multipag.py +1 -31
- tomwer/app/nabuapp.py +0 -1
- tomwer/app/patchrawdarkflat.py +0 -3
- tomwer/app/reducedarkflat.py +0 -1
- tomwer/core/process/control/datalistener/datalistener.py +0 -232
- tomwer/core/process/control/datawatcher/datawatcher.py +0 -5
- tomwer/core/process/control/scantransfer.py +3 -60
- tomwer/core/process/edit/darkflatpatch.py +0 -8
- tomwer/core/process/edit/imagekeyeditor.py +2 -19
- tomwer/core/process/reconstruction/axis/axis.py +0 -13
- tomwer/core/process/reconstruction/darkref/darkrefs.py +0 -59
- tomwer/core/process/reconstruction/nabu/nabuslices.py +0 -88
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +0 -10
- tomwer/core/process/reconstruction/params_cache.py +36 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +80 -88
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +78 -86
- tomwer/core/process/reconstruction/tests/test_params_cache.py +37 -0
- tomwer/core/process/script/python.py +0 -19
- tomwer/core/process/task.py +0 -290
- tomwer/core/process/tests/test_dark_and_flat.py +0 -6
- tomwer/core/process/tests/test_data_transfer.py +0 -1
- tomwer/core/process/tests/test_data_watcher.py +6 -23
- tomwer/core/scan/edfscan.py +0 -11
- tomwer/core/scan/nxtomoscan.py +0 -12
- tomwer/core/scan/scanbase.py +0 -81
- tomwer/gui/reconstruction/axis/CalculationWidget.py +3 -5
- tomwer/gui/reconstruction/tests/test_saaxis.py +2 -2
- tomwer/gui/reconstruction/tests/test_sadeltabeta.py +2 -2
- tomwer/gui/stitching/config/axisparams.py +2 -0
- tomwer/synctools/stacks/reconstruction/axis.py +0 -18
- tomwer/synctools/tests/test_foldertransfer.py +2 -19
- tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_i_norm.py +0 -10
- tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_sa_delta_beta.py +103 -153
- tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_saaxis.py +117 -152
- tomwer/tests/orangecontrib/tomwer/widgets/{tests/test_darkref.py → test_darkref.py} +0 -9
- tomwer/tests/orangecontrib/tomwer/widgets/{tests/test_foldertransfert.py → test_foldertransfert.py} +1 -1
- tomwer/tests/test_ewoks/test_workflows.py +0 -4
- tomwer/version.py +3 -3
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/METADATA +1 -2
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/RECORD +55 -56
- tomwer/core/scan/tests/test_process_registration.py +0 -64
- tomwer/core/utils/Singleton.py +0 -36
- tomwer/core/utils/locker.py +0 -58
- /tomwer/tests/orangecontrib/tomwer/widgets/{tests/test_conditions.py → test_conditions.py} +0 -0
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/LICENSE +0 -0
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/WHEEL +0 -0
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/entry_points.txt +0 -0
- {tomwer-1.4.0rc6.dist-info → tomwer-1.4.1.dist-info}/top_level.txt +0 -0
@@ -1,28 +1,21 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
from __future__ import annotations
|
3
3
|
|
4
|
-
import gc
|
5
|
-
import logging
|
6
4
|
import os
|
5
|
+
import logging
|
7
6
|
import pickle
|
8
|
-
import shutil
|
9
|
-
import tempfile
|
10
7
|
import time
|
11
|
-
import uuid
|
12
8
|
|
13
|
-
import h5py
|
14
9
|
import numpy
|
15
10
|
from orangecanvas.scheme.readwrite import literal_dumps
|
16
11
|
from processview.core.manager import DatasetState, ProcessManager
|
17
|
-
from silx.gui import qt
|
18
|
-
from silx.gui.utils.testutils import TestCaseQt
|
19
12
|
from silx.io.url import DataUrl
|
13
|
+
from silx.gui import qt
|
20
14
|
|
21
15
|
from orangecontrib.tomwer.widgets.reconstruction.SAAxisOW import SAAxisOW as _SAAxisOW
|
22
|
-
from tomwer.core import settings
|
23
|
-
from tomwer.core.utils.lbsram import mock_low_memory
|
24
16
|
from tomwer.core.process.reconstruction.scores import ComputedScore
|
25
17
|
from tomwer.core.utils.scanutils import MockNXtomo
|
18
|
+
from tomwer.tests.conftest import qtapp # noqa F401
|
26
19
|
|
27
20
|
logger = logging.getLogger(__name__)
|
28
21
|
|
@@ -33,7 +26,6 @@ class SAAxisOW(_SAAxisOW):
|
|
33
26
|
super().__init__(parent)
|
34
27
|
|
35
28
|
def processing_finished(self, scan):
|
36
|
-
# TODO: add message processing finished
|
37
29
|
self._scans_finished.append(scan)
|
38
30
|
|
39
31
|
@property
|
@@ -45,150 +37,123 @@ class SAAxisOW(_SAAxisOW):
|
|
45
37
|
super().close()
|
46
38
|
|
47
39
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
self.widget.compute()
|
118
|
-
self.qapp.processEvents()
|
119
|
-
self.widget.wait_processing(5000)
|
120
|
-
self.qapp.processEvents()
|
121
|
-
|
122
|
-
self.widget.process(self.scan_1)
|
123
|
-
manual_processing()
|
124
|
-
self.assertEqual(
|
125
|
-
self._process_manager.get_dataset_state(
|
126
|
-
dataset_id=self.scan_1.get_identifier(),
|
127
|
-
process=self.widget,
|
128
|
-
),
|
129
|
-
DatasetState.WAIT_USER_VALIDATION,
|
40
|
+
FRAME_DIM = 100
|
41
|
+
|
42
|
+
|
43
|
+
def create_scan(output_dir):
|
44
|
+
return MockNXtomo(
|
45
|
+
scan_path=output_dir,
|
46
|
+
n_ini_proj=20,
|
47
|
+
n_proj=20,
|
48
|
+
n_alignement_proj=2,
|
49
|
+
create_final_flat=False,
|
50
|
+
create_ini_dark=True,
|
51
|
+
create_ini_flat=True,
|
52
|
+
n_refs=1,
|
53
|
+
dim=FRAME_DIM,
|
54
|
+
).scan
|
55
|
+
|
56
|
+
|
57
|
+
def patch_score(*args, **kwargs):
|
58
|
+
"""Function to save some result"""
|
59
|
+
return DataUrl(
|
60
|
+
file_path="/no_existing/path.hdf5",
|
61
|
+
data_path="/no_existing_data_path",
|
62
|
+
scheme="silx",
|
63
|
+
), ComputedScore(
|
64
|
+
tv=numpy.random.random(),
|
65
|
+
std=numpy.random.random(),
|
66
|
+
)
|
67
|
+
|
68
|
+
|
69
|
+
def test_SAAxisOW(
|
70
|
+
qtapp, # noqa F811
|
71
|
+
tmp_path,
|
72
|
+
):
|
73
|
+
source_dir = tmp_path / "source"
|
74
|
+
source_dir.mkdir()
|
75
|
+
|
76
|
+
# create scans
|
77
|
+
scan_1 = create_scan(os.path.join(source_dir, "scan_1"))
|
78
|
+
scan_2 = create_scan(os.path.join(source_dir, "scan_2"))
|
79
|
+
scan_3 = create_scan(os.path.join(source_dir, "scan_3"))
|
80
|
+
process_manager = ProcessManager()
|
81
|
+
|
82
|
+
widget = SAAxisOW()
|
83
|
+
widget.show()
|
84
|
+
|
85
|
+
widget._widget._processing_stack.patch_processing(patch_score)
|
86
|
+
|
87
|
+
# test configuration serialization
|
88
|
+
pickle.dumps(widget.getConfiguration())
|
89
|
+
|
90
|
+
# test configuration is compatible with 'litteral dumps'
|
91
|
+
literal_dumps(widget.getConfiguration())
|
92
|
+
|
93
|
+
# test behavior when 'auto focus' is lock (so widget is automated, should take the value with the higher score)
|
94
|
+
widget.lockAutofocus(False)
|
95
|
+
|
96
|
+
def manual_processing():
|
97
|
+
widget.load_sinogram()
|
98
|
+
widget.compute()
|
99
|
+
qt.QApplication.processEvents()
|
100
|
+
widget.wait_processing(5000)
|
101
|
+
qt.QApplication.processEvents()
|
102
|
+
|
103
|
+
widget.process(scan_1)
|
104
|
+
manual_processing()
|
105
|
+
assert (
|
106
|
+
process_manager.get_dataset_state(
|
107
|
+
dataset_id=scan_1.get_identifier(),
|
108
|
+
process=widget,
|
130
109
|
)
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
),
|
140
|
-
|
110
|
+
== DatasetState.WAIT_USER_VALIDATION
|
111
|
+
)
|
112
|
+
|
113
|
+
widget.process(scan_2)
|
114
|
+
manual_processing()
|
115
|
+
assert len(widget.scans_finished) == 0
|
116
|
+
assert (
|
117
|
+
process_manager.get_dataset_state(
|
118
|
+
dataset_id=scan_1.get_identifier(),
|
119
|
+
process=widget,
|
141
120
|
)
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
),
|
147
|
-
|
121
|
+
== DatasetState.SKIPPED
|
122
|
+
)
|
123
|
+
assert (
|
124
|
+
process_manager.get_dataset_state(
|
125
|
+
dataset_id=scan_2.get_identifier(),
|
126
|
+
process=widget,
|
148
127
|
)
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
128
|
+
== DatasetState.WAIT_USER_VALIDATION
|
129
|
+
)
|
130
|
+
|
131
|
+
widget.process(scan_3)
|
132
|
+
manual_processing()
|
133
|
+
widget.validateCurrentScan()
|
134
|
+
assert (
|
135
|
+
process_manager.get_dataset_state(
|
136
|
+
dataset_id=scan_3.get_identifier(),
|
137
|
+
process=widget,
|
158
138
|
)
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
with self.subTest(scan=str(scan)):
|
172
|
-
self.assertEqual(
|
173
|
-
self._process_manager.get_dataset_state(
|
174
|
-
dataset_id=scan.get_identifier(),
|
175
|
-
process=self.widget,
|
176
|
-
),
|
177
|
-
DatasetState.SKIPPED,
|
178
|
-
)
|
179
|
-
|
180
|
-
def testAutoFocusLock(self):
|
181
|
-
self.widget.lockAutofocus(True)
|
182
|
-
for scan in (self.scan_1, self.scan_2, self.scan_3):
|
183
|
-
self.widget.process(scan)
|
184
|
-
self.widget.wait_processing(10000)
|
185
|
-
self.qapp.processEvents()
|
139
|
+
== DatasetState.SUCCEED
|
140
|
+
)
|
141
|
+
|
142
|
+
# insure a cor has been registered
|
143
|
+
assert scan_3.axis_params.relative_cor_value is not None
|
144
|
+
|
145
|
+
# test autofocus is unlocked
|
146
|
+
widget.lockAutofocus(True)
|
147
|
+
for scan in (scan_1, scan_2, scan_3):
|
148
|
+
widget.process(scan)
|
149
|
+
widget.wait_processing(10000)
|
150
|
+
while qt.QApplication.hasPendingEvents():
|
186
151
|
time.sleep(0.1)
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
),
|
193
|
-
DatasetState.SUCCEED,
|
152
|
+
qt.QApplication.processEvents()
|
153
|
+
assert (
|
154
|
+
process_manager.get_dataset_state(
|
155
|
+
dataset_id=scan.get_identifier(),
|
156
|
+
process=widget,
|
194
157
|
)
|
158
|
+
== DatasetState.SUCCEED
|
159
|
+
)
|
@@ -170,7 +170,6 @@ class TestDarkRefCopyWithEDFAndHDF5(TestCaseQt):
|
|
170
170
|
self.widget.setCopyActive(False)
|
171
171
|
|
172
172
|
self.widget.process(self.hdf5_acquisition_with_refs)
|
173
|
-
self.assertTrue(os.path.exists(self.hdf5_acquisition_with_refs.process_file))
|
174
173
|
|
175
174
|
# make sure no dark or flats exists for the hdf5 without refs
|
176
175
|
for scan in (
|
@@ -178,7 +177,6 @@ class TestDarkRefCopyWithEDFAndHDF5(TestCaseQt):
|
|
178
177
|
self.hdf5_acquisition_without_refs,
|
179
178
|
):
|
180
179
|
self.widget.process(scan)
|
181
|
-
self.assertFalse(os.path.exists(scan.process_file))
|
182
180
|
|
183
181
|
# make sure no dark or flats exists for the edf one
|
184
182
|
self.widget.process(self.edf_acquisition_without_ref)
|
@@ -188,14 +186,12 @@ class TestDarkRefCopyWithEDFAndHDF5(TestCaseQt):
|
|
188
186
|
self.widget.setModeAuto(True)
|
189
187
|
|
190
188
|
self.widget.process(self.hdf5_acquisition_with_refs)
|
191
|
-
self.assertTrue(os.path.exists(self.hdf5_acquisition_with_refs.process_file))
|
192
189
|
# 1. make sure dark has been processed for the one with ref
|
193
190
|
self.assertTrue(self.widget.hasDarkStored())
|
194
191
|
self.assertTrue(self.widget.hasFlatStored())
|
195
192
|
|
196
193
|
# 2. make sure copy has been processed for the the 'compatible hdf5'
|
197
194
|
self.widget.process(self.hdf5_acquisition_without_refs)
|
198
|
-
self.assertTrue(os.path.exists(self.hdf5_acquisition_without_refs.process_file))
|
199
195
|
|
200
196
|
# 3. make sure copy has been processed for the the 'compatible edf'
|
201
197
|
self.widget.process(self.edf_acquisition_without_ref)
|
@@ -218,8 +214,3 @@ class TestDarkRefCopyWithEDFAndHDF5(TestCaseQt):
|
|
218
214
|
|
219
215
|
# 4. make sure process but no copy made if incompatible size
|
220
216
|
self.widget.process(self.hdf5_acquisition_without_refs_incoherent_dim)
|
221
|
-
self.assertFalse(
|
222
|
-
os.path.exists(
|
223
|
-
self.hdf5_acquisition_without_refs_incoherent_dim.process_file
|
224
|
-
)
|
225
|
-
)
|
@@ -40,9 +40,6 @@ def test_simple_workflow_nabu():
|
|
40
40
|
) as scan:
|
41
41
|
# insure no cfg yet
|
42
42
|
assert len(glob(os.path.join(scan.path, "*.cfg"))) == 0
|
43
|
-
assert not os.path.exists(
|
44
|
-
scan.process_file
|
45
|
-
), "check tomwer should not have been processed yet"
|
46
43
|
|
47
44
|
graph = load_graph(
|
48
45
|
source={
|
@@ -130,7 +127,6 @@ def test_simple_workflow_nabu():
|
|
130
127
|
"nabu volume"
|
131
128
|
}, "should only have one result nodes"
|
132
129
|
assert "data" in result, f"cannot find `nabu volume` in {result}"
|
133
|
-
assert os.path.exists(scan.process_file), "check tomwer has been processed"
|
134
130
|
assert os.path.exists(
|
135
131
|
os.path.join(
|
136
132
|
scan.path, PROCESS_FOLDER_RECONSTRUCTED_VOLUMES, "nabu_cfg_files"
|
tomwer/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tomwer
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.1
|
4
4
|
Summary: "tomography workflow tools"
|
5
5
|
Home-page: https://gitlab.esrf.fr/tomotools/tomwer
|
6
6
|
Author: Henri Payno, Pierre Paleo, Pierre-Olivier Autran, Jérôme Lesaint, Alessandro Mirone
|
@@ -32,7 +32,6 @@ Requires-Dist: processview>=1.4.3
|
|
32
32
|
Requires-Dist: ewoks>=0.1.1
|
33
33
|
Requires-Dist: sluurp>=0.4.1
|
34
34
|
Requires-Dist: packaging
|
35
|
-
Requires-Dist: flufl-lock
|
36
35
|
Requires-Dist: pyunitsystem>=2.0.0a
|
37
36
|
Requires-Dist: tqdm
|
38
37
|
Provides-Extra: full-base
|