tomwer 1.2.8__py3-none-any.whl → 1.3.0a0__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/icat_publication.ows +58 -0
- orangecontrib/tomwer/widgets/__init__.py +1 -0
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
- orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +11 -5
- orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +31 -18
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +14 -7
- orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +2 -0
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
- orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
- orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
- orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
- orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +9 -8
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +3 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +179 -169
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +7 -13
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +7 -17
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +3 -4
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
- tomwer/__main__.py +11 -58
- tomwer/app/canvas.py +8 -0
- tomwer/app/canvas_launcher/config.py +13 -11
- tomwer/app/darkref.py +1 -1
- tomwer/app/darkrefpatch.py +1 -1
- tomwer/app/imagekeyeditor.py +5 -5
- tomwer/app/imagekeyupgrader.py +5 -5
- tomwer/app/intensitynormalization.py +2 -2
- tomwer/app/radiostack.py +2 -2
- tomwer/app/zstitching.py +74 -3
- tomwer/core/cluster/cluster.py +26 -0
- tomwer/core/log/logger.py +7 -5
- tomwer/core/process/conditions/filters.py +1 -1
- tomwer/core/process/control/datalistener/datalistener.py +3 -3
- tomwer/core/process/control/nxtomoconcatenate.py +13 -13
- tomwer/core/process/control/nxtomomill.py +83 -25
- tomwer/core/process/control/scantransfer.py +11 -10
- tomwer/core/process/control/scanvalidator.py +3 -2
- tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
- tomwer/core/process/control/test/test_email.py +4 -4
- tomwer/core/process/control/test/test_h52nx_process.py +59 -7
- tomwer/core/process/control/test/test_volume_link.py +64 -64
- tomwer/core/process/control/timer.py +1 -1
- tomwer/core/process/control/volumesymlink.py +200 -200
- tomwer/core/process/edit/darkflatpatch.py +6 -6
- tomwer/core/process/edit/imagekeyeditor.py +17 -18
- tomwer/core/process/icat/__init__.py +0 -0
- tomwer/core/process/icat/createscreenshots.py +100 -0
- tomwer/core/process/icat/gallery.py +377 -0
- tomwer/core/process/icat/icatbase.py +36 -0
- tomwer/core/process/icat/publish.py +228 -0
- tomwer/core/process/icat/screenshots.py +26 -0
- tomwer/core/process/output.py +52 -0
- tomwer/core/process/reconstruction/axis/axis.py +17 -10
- tomwer/core/process/reconstruction/axis/mode.py +4 -0
- tomwer/core/process/reconstruction/axis/params.py +9 -4
- tomwer/core/process/reconstruction/darkref/darkrefs.py +8 -6
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
- tomwer/core/process/reconstruction/darkref/params.py +1 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +4 -4
- tomwer/core/process/reconstruction/nabu/castvolume.py +1 -1
- tomwer/core/process/reconstruction/nabu/helical.py +9 -5
- tomwer/core/process/reconstruction/nabu/nabucommon.py +32 -62
- tomwer/core/process/reconstruction/nabu/nabuscores.py +387 -61
- tomwer/core/process/reconstruction/nabu/nabuslices.py +33 -21
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +37 -14
- tomwer/core/process/reconstruction/nabu/settings.py +2 -2
- tomwer/core/process/reconstruction/nabu/utils.py +129 -24
- tomwer/core/process/reconstruction/output.py +108 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +233 -263
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +140 -86
- tomwer/core/process/reconstruction/scores/params.py +4 -1
- tomwer/core/process/reconstruction/scores/scores.py +13 -0
- tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
- tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +3 -3
- tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
- tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/core/process/stitching/nabustitcher.py +2 -2
- tomwer/core/process/test/test_axis.py +6 -6
- tomwer/core/process/test/test_dark_and_flat.py +10 -7
- tomwer/core/process/test/test_data_transfer.py +7 -6
- tomwer/core/process/test/test_nabu.py +4 -4
- tomwer/core/process/test/test_normalization.py +2 -2
- tomwer/core/scan/edfscan.py +4 -1
- tomwer/core/scan/hdf5scan.py +19 -500
- tomwer/core/scan/nxtomoscan.py +532 -0
- tomwer/core/scan/scanbase.py +42 -20
- tomwer/core/scan/scanfactory.py +13 -13
- tomwer/core/scan/test/test_future_scan.py +2 -2
- tomwer/core/scan/test/test_h5.py +12 -10
- tomwer/core/scan/test/test_process_registration.py +2 -2
- tomwer/core/scan/test/test_scan.py +4 -3
- tomwer/core/settings.py +20 -0
- tomwer/core/test/test_scanutils.py +8 -7
- tomwer/core/test/test_utils.py +33 -26
- tomwer/core/utils/__init__.py +0 -466
- tomwer/core/utils/deprecation.py +1 -1
- tomwer/core/utils/dictutils.py +14 -0
- tomwer/core/utils/lbsram.py +35 -0
- tomwer/core/utils/nxtomoutils.py +1 -1
- tomwer/core/utils/scanutils.py +6 -6
- tomwer/core/utils/spec.py +263 -0
- tomwer/core/volume/volumefactory.py +2 -2
- tomwer/gui/cluster/slurm.py +260 -60
- tomwer/gui/cluster/test/test_cluster.py +13 -0
- tomwer/gui/cluster/test/test_supervisor.py +2 -2
- tomwer/gui/configuration/__init__.py +0 -0
- tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
- tomwer/gui/configuration/level.py +22 -0
- tomwer/gui/control/actions.py +54 -0
- tomwer/gui/control/datalist.py +78 -16
- tomwer/gui/control/datalistener.py +4 -16
- tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
- tomwer/gui/control/history.py +2 -2
- tomwer/gui/control/observations.py +2 -2
- tomwer/gui/control/reducedarkflatselector.py +1 -1
- tomwer/gui/control/selectorwidgetbase.py +36 -9
- tomwer/gui/control/serie/seriecreator.py +5 -22
- tomwer/gui/control/test/test_email.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +6 -5
- tomwer/gui/control/test/test_single_tomo_obj.py +2 -2
- tomwer/gui/control/tomoobjdisplaymode.py +8 -0
- tomwer/gui/debugtools/datasetgenerator.py +3 -3
- tomwer/gui/edit/dkrfpatch.py +16 -22
- tomwer/gui/edit/imagekeyeditor.py +8 -11
- tomwer/gui/edit/nxtomoeditor.py +111 -44
- tomwer/gui/edit/nxtomowarmer.py +4 -4
- tomwer/gui/edit/test/test_dkrf_patch.py +7 -7
- tomwer/gui/edit/test/test_image_key_editor.py +3 -3
- tomwer/gui/edit/test/test_nx_editor.py +40 -16
- tomwer/gui/icat/__init__.py +0 -0
- tomwer/gui/icat/createscreenshots.py +80 -0
- tomwer/gui/icat/gallery.py +214 -0
- tomwer/gui/icat/publish.py +187 -0
- tomwer/gui/reconstruction/axis/axis.py +171 -57
- tomwer/gui/reconstruction/axis/radioaxis.py +80 -95
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
- tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +3 -6
- tomwer/gui/reconstruction/nabu/castvolume.py +1 -1
- tomwer/gui/reconstruction/nabu/check.py +9 -9
- tomwer/gui/reconstruction/nabu/helical.py +29 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +110 -33
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +9 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +219 -29
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +3 -6
- tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
- tomwer/gui/reconstruction/nabu/slices.py +6 -7
- tomwer/gui/reconstruction/nabu/volume.py +22 -10
- tomwer/gui/reconstruction/normalization/intensity.py +15 -23
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +7 -23
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +7 -9
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +2 -1
- tomwer/gui/reconstruction/scores/control.py +2 -9
- tomwer/gui/reconstruction/scores/scoreplot.py +11 -5
- tomwer/gui/reconstruction/test/test_axis.py +23 -12
- tomwer/gui/reconstruction/test/test_lamino.py +8 -3
- tomwer/gui/reconstruction/test/test_nabu.py +28 -9
- tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/gui/settings.py +5 -28
- tomwer/gui/stackplot.py +2 -5
- tomwer/gui/stitching/action.py +49 -0
- tomwer/gui/stitching/config/axisparams.py +7 -24
- tomwer/gui/stitching/config/output.py +10 -8
- tomwer/gui/stitching/config/positionoveraxis.py +22 -23
- tomwer/gui/stitching/normalization.py +117 -0
- tomwer/gui/stitching/stitchandbackground.py +4 -6
- tomwer/gui/stitching/stitching.py +265 -43
- tomwer/gui/stitching/stitching_preview.py +62 -5
- tomwer/gui/stitching/stitching_raw.py +2 -5
- tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
- tomwer/gui/utils/buttons.py +112 -29
- tomwer/gui/utils/inputwidget.py +33 -25
- tomwer/gui/utils/scandescription.py +4 -0
- tomwer/gui/utils/step.py +144 -0
- tomwer/gui/utils/unitsystem.py +2 -5
- tomwer/gui/utils/vignettes.py +176 -15
- tomwer/gui/visualization/dataviewer.py +1 -18
- tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
- tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
- tomwer/gui/visualization/scanoverview.py +1 -1
- tomwer/gui/visualization/sinogramviewer.py +1 -10
- tomwer/gui/visualization/test/test_diffviewer.py +3 -3
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
- tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
- tomwer/gui/visualization/test/test_stacks.py +3 -3
- tomwer/gui/visualization/test/test_volumeviewer.py +2 -2
- tomwer/io/utils/raw_and_processed_data.py +84 -0
- tomwer/io/utils/tomoobj.py +4 -6
- tomwer/resources/gui/icons/ruler.png +0 -0
- tomwer/resources/gui/icons/ruler.svg +273 -0
- tomwer/resources/gui/icons/short_description.png +0 -0
- tomwer/resources/gui/icons/short_description.svg +58 -0
- tomwer/resources/gui/icons/url.png +0 -0
- tomwer/resources/gui/icons/url.svg +58 -0
- tomwer/synctools/stacks/edit/darkflatpatch.py +2 -2
- tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
- tomwer/synctools/stacks/reconstruction/axis.py +4 -4
- tomwer/synctools/stacks/reconstruction/castvolume.py +2 -2
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +4 -10
- tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
- tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
- tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
- tomwer/synctools/test/test_darkRefs.py +7 -58
- tomwer/synctools/test/test_foldertransfer.py +6 -6
- tomwer/synctools/utils/scanstages.py +6 -6
- tomwer/tests/conftest.py +34 -0
- tomwer/tests/datasets.py +13 -0
- tomwer/tests/test_scripts.py +92 -39
- tomwer/tests/utils.py +5 -0
- tomwer/version.py +3 -3
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/METADATA +39 -44
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/RECORD +248 -209
- tomwer/resources/gui/icons/esrf_1.svg +0 -307
- tomwer/resources/gui/icons/triangle.svg +0 -80
- tomwer/synctools/test/test_scanstages.py +0 -162
- tomwer/tests/utils/__init__.py +0 -247
- tomwer/tests/utils/utilstest.py +0 -220
- /tomwer/app/{saaxis.py → multicor.py} +0 -0
- /tomwer/app/{sadeltabeta.py → multipag.py} +0 -0
- /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
- /tomwer-1.2.8-py3.11-nspkg.pth → /tomwer-1.3.0a0-py3.11-nspkg.pth +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/LICENSE +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/WHEEL +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/entry_points.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/top_level.txt +0 -0
tomwer/app/zstitching.py
CHANGED
@@ -5,17 +5,21 @@ import argparse
|
|
5
5
|
import logging
|
6
6
|
import signal
|
7
7
|
import sys
|
8
|
+
import functools
|
8
9
|
|
9
10
|
from silx.gui import qt
|
10
11
|
|
11
12
|
from nabu.utils import Progress
|
12
13
|
from nabu.stitching.config import StitchingType
|
13
14
|
|
15
|
+
from tomwer.core.settings import SlurmSettingsMode
|
14
16
|
from tomwer.core.utils.resource import increase_max_number_file
|
17
|
+
from tomwer.gui import icons
|
15
18
|
from tomwer.core.process.stitching.nabustitcher import StitcherTask
|
16
19
|
from tomwer.io.utils.tomoobj import get_tomo_objs_instances
|
17
20
|
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
18
21
|
from tomwer.gui.stitching.stitching import ZStitchingWindow as _ZStitchingWindow
|
22
|
+
from tomwer.gui.stitching import action as stitching_action
|
19
23
|
from tomwer.gui.cluster.slurm import SlurmSettingsWidget
|
20
24
|
|
21
25
|
logging.basicConfig(level=logging.WARNING)
|
@@ -31,12 +35,30 @@ class MainWidget(qt.QTabWidget):
|
|
31
35
|
parent=None,
|
32
36
|
) -> None:
|
33
37
|
super().__init__(parent)
|
34
|
-
self._stitchingConfigWindow = _ZStitchingWindow(
|
38
|
+
self._stitchingConfigWindow = _ZStitchingWindow(
|
39
|
+
parent=self, with_configuration_action=False
|
40
|
+
)
|
35
41
|
self.addTab(self._stitchingConfigWindow, "stitching config")
|
42
|
+
settingsClass = SlurmSettingsMode.get_settings_class(
|
43
|
+
SlurmSettingsMode.STITCHING
|
44
|
+
)
|
36
45
|
self._slurmConfig = SlurmSettingsWidget(
|
37
|
-
parent=self, n_gpu=
|
46
|
+
parent=self, n_gpu=settingsClass.N_GPUS_PER_WORKER, jobLimitation=None
|
38
47
|
)
|
39
|
-
self._slurmConfig.
|
48
|
+
self._slurmConfig.setConfiguration(
|
49
|
+
{
|
50
|
+
"cpu-per-task": settingsClass.N_CORES_PER_TASK,
|
51
|
+
"n_tasks": settingsClass.N_TASKS,
|
52
|
+
"n_jobs": settingsClass.N_JOBS,
|
53
|
+
"memory": settingsClass.MEMORY_PER_WORKER,
|
54
|
+
"partition": settingsClass.PARTITION,
|
55
|
+
"n_gpus": settingsClass.N_GPUS_PER_WORKER,
|
56
|
+
"job_name": settingsClass.PROJECT_NAME,
|
57
|
+
"walltime": settingsClass.DEFAULT_WALLTIME,
|
58
|
+
"python_venv": settingsClass.PYTHON_VENV,
|
59
|
+
}
|
60
|
+
)
|
61
|
+
|
40
62
|
self._stitchingConfigWindow.setCallbackToGetSlurmConfig(
|
41
63
|
self._slurmConfig.getConfiguration
|
42
64
|
)
|
@@ -133,16 +155,63 @@ class MainWindow(qt.QDialog):
|
|
133
155
|
def __init__(self, parent=None) -> None:
|
134
156
|
super().__init__(parent)
|
135
157
|
self.setLayout(qt.QVBoxLayout())
|
158
|
+
# menu
|
159
|
+
self._menuBar = qt.QMenuBar(self)
|
160
|
+
self.layout().addWidget(self._menuBar)
|
161
|
+
self._menu = qt.QMenu("&Stitching")
|
162
|
+
self._menuBar.addMenu(self._menu)
|
163
|
+
# save / load configuration
|
164
|
+
self._loadConfigurationAction = stitching_action.LoadConfigurationAction(
|
165
|
+
self, "&Load configuration"
|
166
|
+
)
|
167
|
+
self._menu.addAction(self._loadConfigurationAction)
|
168
|
+
self._saveConfigurationAction = stitching_action.SaveConfigurationAction(
|
169
|
+
self, "&Save configuration"
|
170
|
+
)
|
171
|
+
self._menu.addAction(self._saveConfigurationAction)
|
172
|
+
# separator
|
173
|
+
self._menu.addSeparator()
|
174
|
+
# add tomo object
|
175
|
+
self._addTomoObjectAction = stitching_action.AddTomoObjectAction(
|
176
|
+
self, "&Add tomo object (volume or NXtomo)"
|
177
|
+
)
|
178
|
+
self._menu.addAction(self._addTomoObjectAction)
|
179
|
+
|
180
|
+
# main window
|
136
181
|
self.setWindowTitle("tomwer z-stitching")
|
137
182
|
self._mainWindow = MainWidget(parent=self)
|
138
183
|
self.layout().addWidget(self._mainWindow)
|
139
184
|
|
185
|
+
# button
|
140
186
|
types = qt.QDialogButtonBox.Apply
|
141
187
|
self._buttons = qt.QDialogButtonBox(self)
|
142
188
|
self._buttons.setStandardButtons(types)
|
143
189
|
self.layout().addWidget(self._buttons)
|
144
190
|
self._buttons.button(qt.QDialogButtonBox.Apply).setText("Launch stitching")
|
191
|
+
|
192
|
+
# connect signal / slot
|
145
193
|
self._buttons.button(qt.QDialogButtonBox.Apply).clicked.connect(self.accept)
|
194
|
+
self._loadConfigurationAction.triggered.connect(
|
195
|
+
functools.partial(
|
196
|
+
self._mainWindow._stitchingConfigWindow._loadSettings, file_path=None
|
197
|
+
)
|
198
|
+
)
|
199
|
+
self._saveConfigurationAction.triggered.connect(
|
200
|
+
functools.partial(
|
201
|
+
self._mainWindow._stitchingConfigWindow._saveSettings, file_path=None
|
202
|
+
)
|
203
|
+
)
|
204
|
+
self._addTomoObjectAction.triggered.connect(self._callbackAddTomoObj)
|
205
|
+
|
206
|
+
def _callbackAddTomoObj(self, *args, **kwargs):
|
207
|
+
"""move interface to the z-ordered list and call the 'add tomo obj' callback"""
|
208
|
+
orderedListWidget = (
|
209
|
+
self._mainWindow._stitchingConfigWindow._widget._mainWidget._zOrderedList
|
210
|
+
)
|
211
|
+
self._mainWindow._stitchingConfigWindow._widget._mainWidget.setCurrentWidget(
|
212
|
+
orderedListWidget
|
213
|
+
)
|
214
|
+
orderedListWidget._callbackAddTomoObj()
|
146
215
|
|
147
216
|
def close(self):
|
148
217
|
self._mainWindow.close()
|
@@ -258,6 +327,8 @@ def main(argv):
|
|
258
327
|
|
259
328
|
window = MainWindow()
|
260
329
|
window.setWindowFlags(qt.Qt.Window)
|
330
|
+
window.setWindowTitle("tomwer: z-stitching")
|
331
|
+
window.setWindowIcon(icons.getQIcon("tomwer"))
|
261
332
|
|
262
333
|
window.show()
|
263
334
|
from sluurp.utils import has_sbatch_available
|
tomwer/core/cluster/cluster.py
CHANGED
@@ -31,8 +31,11 @@ __license__ = "MIT"
|
|
31
31
|
__date__ = "12/10/2021"
|
32
32
|
|
33
33
|
|
34
|
+
import logging
|
34
35
|
from tomwer.core.settings import SlurmSettings as _SlurmSettings
|
35
36
|
|
37
|
+
_logger = logging.getLogger(__name__)
|
38
|
+
|
36
39
|
|
37
40
|
class SlurmClusterConfiguration:
|
38
41
|
"""Object shipping the configuration of a slurm cluster"""
|
@@ -48,6 +51,8 @@ class SlurmClusterConfiguration:
|
|
48
51
|
walltime=_SlurmSettings.DEFAULT_WALLTIME,
|
49
52
|
python_venv=_SlurmSettings.PYTHON_VENV,
|
50
53
|
n_jobs=_SlurmSettings.N_JOBS,
|
54
|
+
modules_to_load: tuple = _SlurmSettings.MODULES_TO_LOAD,
|
55
|
+
sbatch_extra_params: dict = _SlurmSettings.SBATCH_EXTRA_PARAMS,
|
51
56
|
) -> None:
|
52
57
|
self._n_cpu_per_task = n_cpu_per_task
|
53
58
|
self._n_task = n_tasks
|
@@ -57,7 +62,13 @@ class SlurmClusterConfiguration:
|
|
57
62
|
self._project_name = project_name
|
58
63
|
self._walltime = walltime
|
59
64
|
self._python_venv = python_venv
|
65
|
+
self._modules_to_load = modules_to_load
|
60
66
|
self._n_jobs = n_jobs
|
67
|
+
self._sbatch_extra_params = sbatch_extra_params
|
68
|
+
if python_venv not in (None, "") and len(modules_to_load) > 0:
|
69
|
+
_logger.warning(
|
70
|
+
"Either 'modules to load' of 'python venv' can be provided. Not both"
|
71
|
+
)
|
61
72
|
|
62
73
|
@property
|
63
74
|
def n_cpu_per_task(self):
|
@@ -95,11 +106,19 @@ class SlurmClusterConfiguration:
|
|
95
106
|
def python_venv(self):
|
96
107
|
return self._python_venv
|
97
108
|
|
109
|
+
@property
|
110
|
+
def modules_to_load(self) -> tuple:
|
111
|
+
return self._modules_to_load
|
112
|
+
|
98
113
|
@property
|
99
114
|
def port_range(self) -> tuple:
|
100
115
|
"""port range as (start:int, strop:int, step: int)"""
|
101
116
|
return self._port_range
|
102
117
|
|
118
|
+
@property
|
119
|
+
def sbatch_extra_params(self) -> dict:
|
120
|
+
return self._sbatch_extra_params
|
121
|
+
|
103
122
|
@property
|
104
123
|
def dashboard_port(self):
|
105
124
|
return self._dashboard_port
|
@@ -115,6 +134,8 @@ class SlurmClusterConfiguration:
|
|
115
134
|
"job_name": self.project_name,
|
116
135
|
"walltime": self.walltime,
|
117
136
|
"python_venv": self.python_venv,
|
137
|
+
"modules": self.modules_to_load,
|
138
|
+
"sbatch_extra_params": self.sbatch_extra_params,
|
118
139
|
}
|
119
140
|
|
120
141
|
@staticmethod
|
@@ -140,8 +161,13 @@ class SlurmClusterConfiguration:
|
|
140
161
|
self._walltime = dict_["walltime"]
|
141
162
|
if "python_venv" in dict_:
|
142
163
|
self._python_venv = dict_["python_venv"]
|
164
|
+
modules = dict_.get("modules", None)
|
165
|
+
if modules is not None:
|
166
|
+
self._modules_to_load = modules
|
143
167
|
if "port_range" in dict_:
|
144
168
|
self._port_range = dict_["port_range"]
|
145
169
|
if "dashboard_port" in dict_:
|
146
170
|
self._dashboard_port = dict_["dashboard_port"]
|
171
|
+
if "sbatch_extra_params" in dict_:
|
172
|
+
self._sbatch_extra_params = dict_["sbatch_extra_params"]
|
147
173
|
return self
|
tomwer/core/log/logger.py
CHANGED
@@ -51,10 +51,14 @@ from tomwer.core.log.processlog import (
|
|
51
51
|
|
52
52
|
# These are the sequences need to get colored ouput
|
53
53
|
_RESET_SEQ = "\033[0m"
|
54
|
-
_COLOR_SEQ = "\033[1;%dm"
|
55
54
|
_BOLD_SEQ = "\033[1m"
|
56
55
|
|
57
|
-
_BLACK
|
56
|
+
_BLACK = "\033[30m"
|
57
|
+
_RED = "\033[31m"
|
58
|
+
_GREEN = "\033[32m"
|
59
|
+
_YELLOW = "\033[33m"
|
60
|
+
_BLUE = "\033[34m"
|
61
|
+
_MAGENTA = "\033[35m"
|
58
62
|
|
59
63
|
LOG_COLORS = {
|
60
64
|
"WARNING": _MAGENTA,
|
@@ -90,9 +94,7 @@ class _ColoredFormatter(logging.Formatter):
|
|
90
94
|
def format(self, record):
|
91
95
|
levelname = record.levelname
|
92
96
|
if self.use_color is True and levelname in LOG_COLORS:
|
93
|
-
levelname_color =
|
94
|
-
_COLOR_SEQ % (30 + LOG_COLORS[levelname]) + levelname + _RESET_SEQ
|
95
|
-
)
|
97
|
+
levelname_color = LOG_COLORS[levelname] + levelname + _RESET_SEQ
|
96
98
|
record.levelname = levelname_color
|
97
99
|
record.asctime = self.formatTime(record, self.datefmt)
|
98
100
|
return logging.Formatter.format(self, record)
|
@@ -41,7 +41,7 @@ from tomwer.core.process.task import Task
|
|
41
41
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
42
42
|
from tomwer.core.scan.scanfactory import ScanFactory
|
43
43
|
|
44
|
-
from
|
44
|
+
from tomwer.core.utils.deprecation import deprecated_warning
|
45
45
|
|
46
46
|
_logger = logging.getLogger(__name__)
|
47
47
|
|
@@ -43,7 +43,7 @@ import tomwer.version
|
|
43
43
|
from tomwer.core import settings
|
44
44
|
from tomwer.core.process.task import BaseProcessInfo
|
45
45
|
from tomwer.core.scan.blissscan import BlissScan
|
46
|
-
from tomwer.core.scan.
|
46
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
47
47
|
|
48
48
|
from .rpcserver import DataListenerThread
|
49
49
|
|
@@ -191,7 +191,7 @@ class DataListener(BaseProcessInfo):
|
|
191
191
|
for mf_emf in self.convert(bliss_file=sample_file, entry=entry):
|
192
192
|
master_file, entry_master_file = mf_emf
|
193
193
|
if master_file is not None and entry_master_file is not None:
|
194
|
-
scan =
|
194
|
+
scan = NXtomoScan(scan=master_file, entry=entry_master_file)
|
195
195
|
|
196
196
|
try:
|
197
197
|
# register process.
|
@@ -548,7 +548,7 @@ class DataListener(BaseProcessInfo):
|
|
548
548
|
return res == "Y"
|
549
549
|
|
550
550
|
def _signal_scan_ready(self, scan):
|
551
|
-
assert isinstance(scan,
|
551
|
+
assert isinstance(scan, NXtomoScan)
|
552
552
|
pass
|
553
553
|
|
554
554
|
def activate(self, activate=True):
|
@@ -5,10 +5,10 @@ from tomoscan.serie import Serie
|
|
5
5
|
from ewokscore.missing_data import is_missing_data
|
6
6
|
|
7
7
|
from tomwer.core.process.task import TaskWithProgress
|
8
|
-
from tomwer.core.scan.
|
8
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
9
9
|
|
10
|
-
from
|
11
|
-
from nxtomomill.nexus
|
10
|
+
from nxtomo.application.nxtomo import NXtomo
|
11
|
+
from nxtomomill.utils.nexus import concatenate as nx_concatenate
|
12
12
|
|
13
13
|
_logger = logging.getLogger(__name__)
|
14
14
|
|
@@ -28,7 +28,7 @@ class ConcatenateNXtomoTask(
|
|
28
28
|
output_names=("data",),
|
29
29
|
):
|
30
30
|
"""
|
31
|
-
Task used to concatenate a list of NXtomo (
|
31
|
+
Task used to concatenate a list of NXtomo (NXtomoScan) into a single NXtomo
|
32
32
|
"""
|
33
33
|
|
34
34
|
def run(self):
|
@@ -43,17 +43,17 @@ class ConcatenateNXtomoTask(
|
|
43
43
|
file_path=self.inputs.output_file, serie=scans_serie
|
44
44
|
)
|
45
45
|
|
46
|
-
# cast scan from
|
47
|
-
def cast_scan_to_nxtomo(obj:
|
48
|
-
# convert
|
49
|
-
if isinstance(obj,
|
46
|
+
# cast scan from NXtomoScan to NXtomo
|
47
|
+
def cast_scan_to_nxtomo(obj: NXtomoScan):
|
48
|
+
# convert NXtomoScan to NXtomo as we expect to get NXtomoScan
|
49
|
+
if isinstance(obj, NXtomoScan):
|
50
50
|
return NXtomo().load(
|
51
51
|
file_path=obj.master_file,
|
52
52
|
data_path=obj.entry,
|
53
53
|
)
|
54
54
|
else:
|
55
55
|
raise TypeError(
|
56
|
-
f"nxtomos are supposed to be instances of {NXtomo} or {
|
56
|
+
f"nxtomos are supposed to be instances of {NXtomo} or {NXtomoScan}. Get {type(obj)}"
|
57
57
|
)
|
58
58
|
|
59
59
|
scans_serie = tuple([cast_scan_to_nxtomo(nxtomo) for nxtomo in scans_serie])
|
@@ -68,8 +68,8 @@ class ConcatenateNXtomoTask(
|
|
68
68
|
overwrite=self.inputs.overwrite,
|
69
69
|
)
|
70
70
|
|
71
|
-
# cast back nxtomomill NXtomo to
|
72
|
-
scan =
|
71
|
+
# cast back nxtomomill NXtomo to NXtomoScan (reference object for tomwer)
|
72
|
+
scan = NXtomoScan(
|
73
73
|
scan=output_file,
|
74
74
|
entry=self.inputs.output_entry,
|
75
75
|
)
|
@@ -84,14 +84,14 @@ def format_output_location(file_path, serie: Serie):
|
|
84
84
|
format possible keys from the location like {scan_dir} or {scan_path}
|
85
85
|
|
86
86
|
:param file_path:
|
87
|
-
:param serie: serie of
|
87
|
+
:param serie: serie of NXtomoScan
|
88
88
|
:return:
|
89
89
|
"""
|
90
90
|
if serie is None:
|
91
91
|
_logger.warning("scan is !none, enable to format the nabu output location")
|
92
92
|
|
93
93
|
for scan in serie:
|
94
|
-
if not isinstance(scan,
|
94
|
+
if not isinstance(scan, NXtomoScan):
|
95
95
|
raise TypeError
|
96
96
|
|
97
97
|
def get_common_path():
|
@@ -23,6 +23,8 @@
|
|
23
23
|
#
|
24
24
|
# ###########################################################################*/
|
25
25
|
|
26
|
+
from __future__ import annotations
|
27
|
+
|
26
28
|
__authors__ = ["H. Payno"]
|
27
29
|
__license__ = "MIT"
|
28
30
|
__date__ = "30/07/2020"
|
@@ -32,25 +34,24 @@ import logging
|
|
32
34
|
import os
|
33
35
|
import pathlib
|
34
36
|
|
37
|
+
from tomoscan.serie import Serie
|
38
|
+
|
35
39
|
from nxtomomill import converter as nxtomomill_converter
|
36
40
|
from nxtomomill.io.config import TomoEDFConfig as EDFConfig
|
37
41
|
from nxtomomill.io.config import TomoHDF5Config as HDF5Config
|
38
|
-
from nxtomomill.converter.hdf5.utils import
|
42
|
+
from nxtomomill.converter.hdf5.utils import (
|
43
|
+
get_default_output_file,
|
44
|
+
)
|
39
45
|
|
46
|
+
from tomwer.io.utils.raw_and_processed_data import to_raw_data_path
|
47
|
+
from tomwer.core.process.output import ProcessDataOutputDirMode
|
40
48
|
from tomwer.core.process.task import TaskWithProgress
|
41
|
-
from tomwer.core.scan.
|
49
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
42
50
|
from tomwer.core.utils.scanutils import format_output_location
|
43
51
|
|
44
|
-
from silx.utils.enum import Enum as _Enum
|
45
|
-
|
46
52
|
_logger = logging.getLogger(__name__)
|
47
53
|
|
48
54
|
|
49
|
-
class NXtomomillNXDefaultOutput(_Enum):
|
50
|
-
NEAR_INPUT_FILE = "near input"
|
51
|
-
PROCESSED_DATA = "processed data dir"
|
52
|
-
|
53
|
-
|
54
55
|
class H5ToNxProcess(
|
55
56
|
TaskWithProgress,
|
56
57
|
input_names=("h5_to_nx_configuration",),
|
@@ -59,7 +60,7 @@ class H5ToNxProcess(
|
|
59
60
|
"hdf5_scan",
|
60
61
|
"serialize_output_data",
|
61
62
|
),
|
62
|
-
output_names=("data", "
|
63
|
+
output_names=("data", "serie"),
|
63
64
|
):
|
64
65
|
"""
|
65
66
|
Task to convert from a bliss dataset to a nexus compliant dataset
|
@@ -67,21 +68,29 @@ class H5ToNxProcess(
|
|
67
68
|
|
68
69
|
@staticmethod
|
69
70
|
def deduce_output_file_path(master_file_name, scan, entry, outputdir):
|
70
|
-
assert isinstance(outputdir, str), "outputdir is expected to be a str"
|
71
|
-
|
72
71
|
master_file_name = os.path.realpath(master_file_name)
|
73
72
|
# step 1: get output dir
|
74
73
|
try:
|
75
|
-
outputdir =
|
74
|
+
outputdir = ProcessDataOutputDirMode.from_value(outputdir)
|
76
75
|
except ValueError:
|
76
|
+
# case path provided directly
|
77
77
|
output_folder = format_output_location(outputdir, scan=scan)
|
78
78
|
else:
|
79
|
-
if outputdir is
|
79
|
+
if outputdir is ProcessDataOutputDirMode.OTHER:
|
80
|
+
raise ValueError(
|
81
|
+
f"When output dir mode is {ProcessDataOutputDirMode.OTHER} we expect to received the output dir directly"
|
82
|
+
)
|
83
|
+
if outputdir is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
|
80
84
|
path = pathlib.Path(
|
81
85
|
get_default_output_file(input_file=master_file_name)
|
82
86
|
)
|
83
87
|
output_folder = str(path.parent)
|
84
|
-
elif outputdir is
|
88
|
+
elif outputdir is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
|
89
|
+
path = pathlib.Path(
|
90
|
+
get_default_raw_data_output_file(input_file=master_file_name)
|
91
|
+
)
|
92
|
+
output_folder = str(path.parent)
|
93
|
+
elif outputdir is ProcessDataOutputDirMode.IN_SCAN_FOLDER:
|
85
94
|
output_folder = os.path.dirname(master_file_name)
|
86
95
|
else:
|
87
96
|
raise RuntimeError(f"output dir {outputdir} not handled")
|
@@ -119,10 +128,10 @@ class H5ToNxProcess(
|
|
119
128
|
if len(convs) == 0:
|
120
129
|
return
|
121
130
|
|
122
|
-
|
131
|
+
serie = []
|
123
132
|
for conv in convs:
|
124
133
|
conv_file, conv_entry = conv
|
125
|
-
scan_converted =
|
134
|
+
scan_converted = NXtomoScan(scan=conv_file, entry=conv_entry)
|
126
135
|
_logger.processSucceed(
|
127
136
|
f"{config.input_file} {config.entries} has been translated to {scan_converted}"
|
128
137
|
)
|
@@ -130,9 +139,11 @@ class H5ToNxProcess(
|
|
130
139
|
data = scan_converted.to_dict()
|
131
140
|
else:
|
132
141
|
data = scan_converted
|
133
|
-
|
134
|
-
self.outputs.
|
135
|
-
|
142
|
+
serie.append(data)
|
143
|
+
self.outputs.serie = Serie(
|
144
|
+
name=f"serie created from {config.input_file}", iterable=serie
|
145
|
+
)
|
146
|
+
self.outputs.data = serie[-1] if len(serie) > 0 else None
|
136
147
|
|
137
148
|
|
138
149
|
class EDFToNxProcess(
|
@@ -157,23 +168,70 @@ class EDFToNxProcess(
|
|
157
168
|
raise TypeError(
|
158
169
|
"edf_to_nx_configuration should be a dict or an instance of {TomoEDFConfig}"
|
159
170
|
)
|
171
|
+
os.makedirs(os.path.dirname(config.output_file), exist_ok=True)
|
160
172
|
file_path, entry = nxtomomill_converter.from_edf_to_nx(
|
161
173
|
configuration=config, progress=self.progress
|
162
174
|
)
|
163
|
-
scan =
|
175
|
+
scan = NXtomoScan(entry=entry, scan=file_path)
|
164
176
|
if self.get_input_value("serialize_output_data", True):
|
165
177
|
self.outputs.data = scan.to_dict()
|
166
178
|
else:
|
167
179
|
self.outputs.data = scan
|
168
180
|
|
169
181
|
@staticmethod
|
170
|
-
def deduce_output_file_path(
|
171
|
-
|
182
|
+
def deduce_output_file_path(
|
183
|
+
folder_path, output_dir: ProcessDataOutputDirMode | str, scan
|
184
|
+
):
|
185
|
+
try:
|
186
|
+
output_dir = ProcessDataOutputDirMode.from_value(output_dir)
|
187
|
+
except Exception:
|
188
|
+
pass
|
189
|
+
|
190
|
+
if output_dir is ProcessDataOutputDirMode.OTHER:
|
191
|
+
raise ValueError("if mode is other, we expect 'output_dir' to be the path")
|
192
|
+
elif output_dir in (None, ProcessDataOutputDirMode.IN_SCAN_FOLDER):
|
172
193
|
output_folder = os.path.dirname(folder_path)
|
173
|
-
elif output_dir
|
194
|
+
elif output_dir is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
|
174
195
|
path = pathlib.Path(get_default_output_file(folder_path))
|
175
196
|
output_folder = str(path.parent)
|
197
|
+
elif output_dir is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
|
198
|
+
path = pathlib.Path(get_default_raw_data_output_file(folder_path))
|
199
|
+
output_folder = str(path.parent)
|
176
200
|
else:
|
201
|
+
# else we expect people to provide output location
|
177
202
|
output_folder = format_output_location(output_dir, scan=scan)
|
178
|
-
print("output output_folder is", output_folder)
|
179
203
|
return os.path.join(output_folder, os.path.basename(folder_path) + ".nx")
|
204
|
+
|
205
|
+
|
206
|
+
def get_default_raw_data_output_file(
|
207
|
+
input_file: str, output_file_extension: str = ".nx"
|
208
|
+
) -> str:
|
209
|
+
"""
|
210
|
+
Policy: look for any 'RAW_DATA' in file directory. If find any (before any 'PROCESSED_DATA' directory) replace it "RAW_DATA".
|
211
|
+
Then replace input_file by the expected file_extension and make sure the output file is different than the input file. Else append _nxtomo to it.
|
212
|
+
|
213
|
+
:param str input_file: file to be converted from bliss to NXtomo
|
214
|
+
:param str output_file_extension:
|
215
|
+
:return: default output file according to policy
|
216
|
+
"""
|
217
|
+
if isinstance(input_file, pathlib.Path):
|
218
|
+
input_file = str(input_file)
|
219
|
+
if not isinstance(input_file, str):
|
220
|
+
raise TypeError(
|
221
|
+
f"input_file is expected to be an instance of str. {type(input_file)} provided"
|
222
|
+
)
|
223
|
+
if not isinstance(output_file_extension, str):
|
224
|
+
raise TypeError("output_file_extension is expected to be a str")
|
225
|
+
if not output_file_extension.startswith("."):
|
226
|
+
output_file_extension = "." + output_file_extension
|
227
|
+
|
228
|
+
input_file = os.path.abspath(input_file)
|
229
|
+
input_file_no_ext, _ = os.path.splitext(input_file)
|
230
|
+
|
231
|
+
output_path = to_raw_data_path(input_file_no_ext)
|
232
|
+
output_file = output_path + output_file_extension
|
233
|
+
if output_file == input_file:
|
234
|
+
# to be safer if the default output file is the same as the input file (if the input file has a .nx extension and not in any 'RAw_DATA' directory)
|
235
|
+
return output_path + "_nxtomo" + output_file_extension
|
236
|
+
else:
|
237
|
+
return output_file
|
@@ -32,19 +32,20 @@ import fnmatch
|
|
32
32
|
import logging
|
33
33
|
import os
|
34
34
|
import shutil
|
35
|
-
from
|
35
|
+
from tomwer.core.utils.deprecation import deprecated_warning
|
36
36
|
|
37
37
|
import tomwer.version
|
38
38
|
from tomwer.core.process.reconstruction.nabu.settings import NABU_CFG_FILE_FOLDER
|
39
39
|
from tomwer.core.process.reconstruction.nabu.utils import update_cfg_file_after_transfer
|
40
40
|
from tomwer.core.process.task import Task
|
41
41
|
from tomwer.core.scan.edfscan import EDFTomoScan
|
42
|
-
from tomwer.core.scan.
|
42
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
43
43
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
44
44
|
from tomwer.core.scan.scanfactory import ScanFactory
|
45
45
|
from tomwer.core.settings import get_dest_path, get_lbsram_path
|
46
46
|
from tomwer.core.signal import Signal
|
47
|
-
from tomwer.core.utils import logconfig
|
47
|
+
from tomwer.core.utils import logconfig
|
48
|
+
from tomwer.core.utils.spec import rebaseParFile
|
48
49
|
from tomwer.core.utils.scanutils import data_identifier_to_scan
|
49
50
|
from tomwer.io.utils import get_linked_files_with_entry
|
50
51
|
|
@@ -103,7 +104,7 @@ class ScanTransferTask(
|
|
103
104
|
self._copying = inputs.get("copying", False)
|
104
105
|
force_sync = inputs.get("force_sync", None)
|
105
106
|
if force_sync is not None:
|
106
|
-
from
|
107
|
+
from tomwer.core.utils.deprecation import deprecated_warning
|
107
108
|
|
108
109
|
deprecated_warning(
|
109
110
|
type_="Parameter",
|
@@ -190,7 +191,7 @@ class ScanTransferTask(
|
|
190
191
|
else:
|
191
192
|
output_scan = scan._deduce_transfert_scan(outputdir)
|
192
193
|
try:
|
193
|
-
output_scan.
|
194
|
+
output_scan._update_latest_recons_identifiers(
|
194
195
|
old_path=scan.path, new_path=output_scan.path
|
195
196
|
)
|
196
197
|
except Exception as e:
|
@@ -211,7 +212,7 @@ class ScanTransferTask(
|
|
211
212
|
self._signalCopying(scanID=source, outputdir=target)
|
212
213
|
output_scan = scan._deduce_transfert_scan(outputdir)
|
213
214
|
try:
|
214
|
-
output_scan.
|
215
|
+
output_scan._update_latest_recons_identifiers(
|
215
216
|
old_path=scan.path, new_path=output_scan.path
|
216
217
|
)
|
217
218
|
except Exception as e:
|
@@ -266,7 +267,7 @@ class ScanTransferTask(
|
|
266
267
|
return self._getOutputDirSpec() or self._getOutputDirLBS(bliss_sample_file)
|
267
268
|
|
268
269
|
def _process_hdf5_scan(self, scan) -> TomwerScanBase:
|
269
|
-
assert isinstance(scan,
|
270
|
+
assert isinstance(scan, NXtomoScan)
|
270
271
|
from tomwer.core.process.control.datalistener import DataListener
|
271
272
|
|
272
273
|
files_sources = []
|
@@ -339,7 +340,7 @@ class ScanTransferTask(
|
|
339
340
|
files_sources.append(scan.master_file)
|
340
341
|
files_dest.append(new_nx_file)
|
341
342
|
delete_opt.append(True)
|
342
|
-
output_scan =
|
343
|
+
output_scan = NXtomoScan(scan=new_nx_file, entry=scan.entry)
|
343
344
|
else:
|
344
345
|
output_scan = None
|
345
346
|
|
@@ -482,7 +483,7 @@ class ScanTransferTask(
|
|
482
483
|
overwrite=self.get_input_value("overwrite", True),
|
483
484
|
noRsync=self._noRsync,
|
484
485
|
)
|
485
|
-
elif isinstance(scan,
|
486
|
+
elif isinstance(scan, NXtomoScan):
|
486
487
|
if self._move is True:
|
487
488
|
raise NotImplementedError("move option not implemented")
|
488
489
|
if self._noRsync is True:
|
@@ -530,7 +531,7 @@ class ScanTransferTask(
|
|
530
531
|
|
531
532
|
results = {"input_scan": str(input_scan), "output_scan": str(output_scan)}
|
532
533
|
entry = "entry"
|
533
|
-
if isinstance(output_scan,
|
534
|
+
if isinstance(output_scan, NXtomoScan):
|
534
535
|
entry = output_scan.entry
|
535
536
|
self.register_process(
|
536
537
|
process_file=output_scan.process_file,
|
@@ -31,7 +31,8 @@ import logging
|
|
31
31
|
|
32
32
|
from ewokscore.task import Task as EwoksTask
|
33
33
|
|
34
|
-
from tomwer.core import settings
|
34
|
+
from tomwer.core import settings
|
35
|
+
from tomwer.core.utils.lbsram import is_low_on_memory
|
35
36
|
from tomwer.core.process.task import BaseProcessInfo
|
36
37
|
from tomwer.core.scan.scanbase import TomwerScanBase, _TomwerBaseDock
|
37
38
|
from tomwer.core.scan.scanfactory import ScanFactory
|
@@ -98,7 +99,7 @@ class ScanValidator(BaseProcessInfo):
|
|
98
99
|
|
99
100
|
def _freeStackIfNeeded(self):
|
100
101
|
# if we are low in memory in lbsram: we will automatically validate the current scan
|
101
|
-
isLowMemoryLbs =
|
102
|
+
isLowMemoryLbs = is_low_on_memory(settings.get_lbsram_path()) is True
|
102
103
|
if not self.isValidationManual():
|
103
104
|
self._validateStack()
|
104
105
|
elif isLowMemoryLbs:
|