tomwer 1.3.0.dev2__py3-none-any.whl → 1.3.0rc10__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 (156) hide show
  1. orangecontrib/tomwer/widgets/__init__.py +11 -12
  2. orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
  3. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
  4. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
  5. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +10 -8
  6. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
  7. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -98
  9. orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -129
  10. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +13 -12
  11. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +11 -9
  12. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +11 -9
  13. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +12 -15
  14. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
  15. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  16. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
  17. tomwer/__main__.py +0 -10
  18. tomwer/app/canvas_launcher/config.py +3 -3
  19. tomwer/app/canvas_launcher/environ.py +1 -0
  20. tomwer/app/intensitynormalization.py +12 -11
  21. tomwer/app/nabuapp.py +0 -11
  22. tomwer/app/zstitching.py +11 -1
  23. tomwer/core/process/control/datalistener/datalistener.py +15 -10
  24. tomwer/core/process/control/nxtomomill.py +1 -1
  25. tomwer/core/process/control/scantransfer.py +8 -32
  26. tomwer/core/process/edit/darkflatpatch.py +8 -9
  27. tomwer/core/process/edit/imagekeyeditor.py +20 -22
  28. tomwer/core/process/icat/screenshots.py +1 -0
  29. tomwer/core/process/reconstruction/axis/axis.py +263 -59
  30. tomwer/core/process/reconstruction/axis/mode.py +161 -50
  31. tomwer/core/process/reconstruction/axis/params.py +23 -20
  32. tomwer/core/process/reconstruction/darkref/darkrefs.py +12 -13
  33. tomwer/core/process/reconstruction/nabu/castvolume.py +3 -3
  34. tomwer/core/process/reconstruction/nabu/nabucommon.py +43 -19
  35. tomwer/core/process/reconstruction/nabu/nabuscores.py +34 -7
  36. tomwer/core/process/reconstruction/nabu/nabuslices.py +81 -26
  37. tomwer/core/process/reconstruction/nabu/nabuvolume.py +31 -26
  38. tomwer/core/process/reconstruction/nabu/plane.py +9 -0
  39. tomwer/core/process/reconstruction/nabu/utils.py +32 -9
  40. tomwer/core/process/reconstruction/saaxis/saaxis.py +4 -1
  41. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +9 -1
  42. tomwer/core/process/reconstruction/scores/params.py +3 -3
  43. tomwer/core/process/reconstruction/test/test_darkref_copy.py +4 -4
  44. tomwer/core/process/stitching/nabustitcher.py +11 -10
  45. tomwer/core/process/task.py +33 -27
  46. tomwer/core/process/test/test_axis.py +7 -6
  47. tomwer/core/process/test/test_data_transfer.py +3 -3
  48. tomwer/core/process/test/test_nabu.py +10 -2
  49. tomwer/core/process/test/test_normalization.py +2 -2
  50. tomwer/core/scan/blissscan.py +3 -3
  51. tomwer/core/scan/edfscan.py +9 -9
  52. tomwer/core/scan/nxtomoscan.py +11 -11
  53. tomwer/core/scan/scanbase.py +31 -24
  54. tomwer/core/scan/test/test_future_scan.py +1 -1
  55. tomwer/core/scan/test/test_h5.py +4 -4
  56. tomwer/core/scan/test/test_process_registration.py +2 -2
  57. tomwer/core/scan/test/test_scan.py +1 -75
  58. tomwer/core/settings.py +3 -3
  59. tomwer/core/test/test_utils.py +2 -2
  60. tomwer/core/volume/edfvolume.py +6 -6
  61. tomwer/core/volume/hdf5volume.py +6 -6
  62. tomwer/core/volume/jp2kvolume.py +6 -6
  63. tomwer/core/volume/rawvolume.py +6 -6
  64. tomwer/core/volume/tiffvolume.py +12 -12
  65. tomwer/gui/cluster/slurm.py +14 -9
  66. tomwer/gui/cluster/supervisor.py +12 -0
  67. tomwer/gui/cluster/test/test_cluster.py +1 -2
  68. tomwer/gui/cluster/test/test_supervisor.py +1 -1
  69. tomwer/gui/control/datalist.py +5 -0
  70. tomwer/gui/control/datawatcher/controlwidget.py +2 -4
  71. tomwer/gui/control/reducedarkflatselector.py +8 -8
  72. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  73. tomwer/gui/edit/dkrfpatch.py +4 -4
  74. tomwer/gui/edit/nxtomowarmer.py +2 -2
  75. tomwer/gui/edit/test/test_dkrf_patch.py +6 -6
  76. tomwer/gui/imagefromfile.py +2 -2
  77. tomwer/gui/qfolderdialog.py +5 -0
  78. tomwer/gui/reconstruction/axis/CompareImages.py +94 -168
  79. tomwer/gui/reconstruction/axis/radioaxis.py +58 -182
  80. tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
  81. tomwer/gui/reconstruction/nabu/castvolume.py +8 -1
  82. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +54 -21
  83. tomwer/gui/reconstruction/normalization/intensity.py +3 -25
  84. tomwer/gui/reconstruction/saaxis/corrangeselector.py +1 -1
  85. tomwer/gui/reconstruction/saaxis/saaxis.py +1 -11
  86. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +0 -10
  87. tomwer/gui/reconstruction/scores/scoreplot.py +1 -6
  88. tomwer/gui/reconstruction/test/test_axis.py +18 -4
  89. tomwer/gui/reconstruction/test/test_nabu.py +3 -0
  90. tomwer/gui/stitching/stitching.py +2 -2
  91. tomwer/gui/stitching/stitching_preview.py +7 -53
  92. tomwer/gui/stitching/stitching_raw.py +3 -3
  93. tomwer/gui/utils/inputwidget.py +12 -2
  94. tomwer/gui/utils/lineselector/lineselector.py +1 -1
  95. tomwer/gui/visualization/dataviewer.py +47 -17
  96. tomwer/gui/visualization/sinogramviewer.py +19 -26
  97. tomwer/gui/visualization/test/test_volumeviewer.py +64 -66
  98. tomwer/gui/visualization/volumeviewer.py +105 -105
  99. tomwer/io/utils/h5pyutils.py +7 -3
  100. tomwer/io/utils/utils.py +3 -3
  101. tomwer/resources/gui/icons/parameters.svg +1 -1
  102. tomwer/resources/gui/illustrations/no_rot.svg +1 -1
  103. tomwer/synctools/stacks/edit/darkflatpatch.py +17 -12
  104. tomwer/tests/test_scripts.py +0 -3
  105. tomwer/third_part/WaitingOverlay.py +110 -0
  106. tomwer/third_part/__init__.py +0 -0
  107. tomwer/version.py +2 -2
  108. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/METADATA +32 -31
  109. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/RECORD +115 -153
  110. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/WHEEL +1 -1
  111. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
  112. orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
  113. orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
  114. orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
  115. tomwer/app/lamino.py +0 -143
  116. tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
  117. tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
  118. tomwer/core/process/test/test_lamino.py +0 -76
  119. tomwer/core/test/test_lamino.py +0 -92
  120. tomwer/gui/reconstruction/lamino/__init__.py +0 -31
  121. tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
  122. tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
  123. tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
  124. tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
  125. tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
  126. tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
  127. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
  128. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -757
  129. tomwer/gui/reconstruction/test/test_lamino.py +0 -194
  130. tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
  131. tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
  132. tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
  133. tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
  134. tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
  135. tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
  136. tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
  137. tomwer/resources/gui/illustrations/manual_slice.png +0 -0
  138. tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
  139. tomwer/resources/gui/illustrations/psi_angle.png +0 -0
  140. tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
  141. tomwer/resources/gui/illustrations/rotation_center.png +0 -0
  142. tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
  143. tomwer/resources/gui/illustrations/slice_stack.png +0 -0
  144. tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
  145. tomwer/resources/gui/illustrations/xy_slice.png +0 -0
  146. tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
  147. tomwer/resources/gui/illustrations/xz_slice.png +0 -0
  148. tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
  149. tomwer/resources/gui/illustrations/yz_slice.png +0 -0
  150. tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
  151. tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
  152. /tomwer-1.3.0.dev2-py3.11-nspkg.pth → /tomwer-1.3.0rc10-py3.11-nspkg.pth +0 -0
  153. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/LICENSE +0 -0
  154. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/entry_points.txt +0 -0
  155. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/namespace_packages.txt +0 -0
  156. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/top_level.txt +0 -0
@@ -279,8 +279,8 @@ class TestMockNXtomo(unittest.TestCase):
279
279
  n_ini_proj=20,
280
280
  n_alignement_proj=2,
281
281
  create_ini_dark=True,
282
- create_ini_ref=True,
283
- create_final_ref=True,
282
+ create_ini_flat=True,
283
+ create_final_flat=True,
284
284
  n_refs=10,
285
285
  )
286
286
  self.assertTrue(0 in mock.scan.darks.keys())
@@ -86,11 +86,11 @@ class EDFVolume(_EDFVolume, TomwerVolumeBase, Dataset):
86
86
  file_prefix=self._volume_basename,
87
87
  metadata={
88
88
  "name": self.url.file_path(),
89
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
90
- if stat
91
- else None,
92
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
93
- if stat
94
- else None,
89
+ "creation_time": (
90
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
91
+ ),
92
+ "modification_time": (
93
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
94
+ ),
95
95
  },
96
96
  )
@@ -103,11 +103,11 @@ class HDF5Volume(_HDF5Volume, TomwerVolumeBase, Dataset):
103
103
  entry=self.url.data_path(),
104
104
  metadata={
105
105
  "name": self.url.file_path(),
106
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
107
- if stat
108
- else None,
109
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
110
- if stat
111
- else None,
106
+ "creation_time": (
107
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
108
+ ),
109
+ "modification_time": (
110
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
111
+ ),
112
112
  },
113
113
  )
@@ -87,11 +87,11 @@ class JP2KVolume(_JP2KVolume, TomwerVolumeBase, Dataset):
87
87
  file_prefix=self._volume_basename,
88
88
  metadata={
89
89
  "name": self.url.file_path(),
90
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
91
- if stat
92
- else None,
93
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
94
- if stat
95
- else None,
90
+ "creation_time": (
91
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
92
+ ),
93
+ "modification_time": (
94
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
95
+ ),
96
96
  },
97
97
  )
@@ -97,11 +97,11 @@ class RawVolume(_RawVolume, TomwerVolumeBase, Dataset):
97
97
  file_path=self.url.file_path(),
98
98
  metadata={
99
99
  "name": self.url.file_path(),
100
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
101
- if stat
102
- else None,
103
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
104
- if stat
105
- else None,
100
+ "creation_time": (
101
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
102
+ ),
103
+ "modification_time": (
104
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
105
+ ),
106
106
  },
107
107
  )
@@ -103,12 +103,12 @@ class TIFFVolume(_TIFFVolume, TomwerVolumeBase, Dataset):
103
103
  file_prefix=self._volume_basename,
104
104
  metadata={
105
105
  "name": self.url.file_path(),
106
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
107
- if stat
108
- else None,
109
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
110
- if stat
111
- else None,
106
+ "creation_time": (
107
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
108
+ ),
109
+ "modification_time": (
110
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
111
+ ),
112
112
  },
113
113
  )
114
114
 
@@ -145,12 +145,12 @@ class MultiTIFFVolume(_MultiTIFFVolume, TomwerVolumeBase, Dataset):
145
145
  tiff_file=self.url.file_path(),
146
146
  metadata={
147
147
  "name": self.url.file_path(),
148
- "creation_time": datetime.fromtimestamp(stat.st_ctime)
149
- if stat
150
- else None,
151
- "modification_time": datetime.fromtimestamp(stat.st_ctime)
152
- if stat
153
- else None,
148
+ "creation_time": (
149
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
150
+ ),
151
+ "modification_time": (
152
+ datetime.fromtimestamp(stat.st_ctime) if stat else None
153
+ ),
154
154
  },
155
155
  )
156
156
 
@@ -168,6 +168,7 @@ class SlurmSettingsWindow(qt.QMainWindow):
168
168
  "job_name": settingsClass.PROJECT_NAME,
169
169
  "walltime": settingsClass.DEFAULT_WALLTIME,
170
170
  "python_venv": settingsClass.PYTHON_VENV,
171
+ "modules": settingsClass.MODULES_TO_LOAD,
171
172
  }
172
173
  )
173
174
 
@@ -270,7 +271,7 @@ class SlurmSettingsWidget(qt.QWidget):
270
271
  self.layout().addRow(self._preProcessingGroup)
271
272
 
272
273
  # python venv
273
- self._pythonVenv = qt.QLineEdit("", self)
274
+ self._pythonVenv = qt.QLineEdit("/scisoft/tomotools/activate stable", self)
274
275
  self._sourceScriptCB = qt.QRadioButton("source script (python venv)", self)
275
276
  self._preProcessingButtonGroup.addButton(self._sourceScriptCB)
276
277
  self._preProcessingGroup.layout().addRow(self._sourceScriptCB, self._pythonVenv)
@@ -280,13 +281,13 @@ class SlurmSettingsWidget(qt.QWidget):
280
281
  """
281
282
  )
282
283
 
283
- self._modulesQLE = qt.QLineEdit("tomotools,", self)
284
- self._modulesCB = qt.QRadioButton("module to load", self)
284
+ self._modulesQLE = qt.QLineEdit(", ".join(SlurmSettings.MODULES_TO_LOAD), self)
285
+ self._modulesCB = qt.QRadioButton("module(s) to load", self)
285
286
  self._preProcessingButtonGroup.addButton(self._modulesCB)
286
287
  self._preProcessingGroup.layout().addRow(self._modulesCB, self._modulesQLE)
287
288
  self._preProcessingGroup.setToolTip(
288
289
  """
289
- Optional list of modules to load before executing the script.
290
+ Optional list of modules to load before executing the script. each module must be separated by a coma
290
291
  """
291
292
  )
292
293
 
@@ -372,8 +373,7 @@ class SlurmSettingsWidget(qt.QWidget):
372
373
  self._nGpu.setValue(n_gpu)
373
374
  self._jobName.setText(SlurmSettings.PROJECT_NAME)
374
375
  self._wallTimeQLE.setText(SlurmSettings.DEFAULT_WALLTIME)
375
- self._pythonVenv.setText(SlurmSettings.PYTHON_VENV)
376
- self._sourceScriptCB.setChecked(True)
376
+ self._modulesCB.setChecked(True) # by default we go for modules
377
377
  self._preProcessingModeChanged()
378
378
  self._partitionChanged()
379
379
  self._nGpuChanged()
@@ -569,7 +569,7 @@ class SlurmSettingsWidget(qt.QWidget):
569
569
  self.sigConfigChanged.emit()
570
570
 
571
571
  def getConfiguration(self) -> dict:
572
- return {
572
+ config = {
573
573
  "cpu-per-task": self.getNCores(),
574
574
  "n_tasks": self.getNWorkers(),
575
575
  "n_jobs": self.getNJobs(),
@@ -578,10 +578,15 @@ class SlurmSettingsWidget(qt.QWidget):
578
578
  "n_gpus": self.getNGPU(),
579
579
  "job_name": self.getProjectName(),
580
580
  "walltime": self.getWallTime(),
581
- "python_venv": self.getPythonExe(),
582
- "modules": self.getModulesToLoad(),
583
581
  "sbatch_extra_params": self.getSBatchExtraParams(),
584
582
  }
583
+ if self._modulesCB.isChecked():
584
+ config["modules"] = self.getModulesToLoad()
585
+ elif self._sourceScriptCB.isChecked():
586
+ config["python_venv"] = self.getPythonExe()
587
+ else:
588
+ raise ValueError("'modules' or python environement should be enable")
589
+ return config
585
590
 
586
591
  def getSlurmClusterConfiguration(self):
587
592
  from tomwer.core.cluster import SlurmClusterConfiguration
@@ -102,6 +102,7 @@ class FutureTomwerScanObserverWidget(qt.QWidget):
102
102
  )
103
103
  if future_tomo_obj is not None:
104
104
  self.sigConversionRequested.emit(future_tomo_obj)
105
+ self.observationTable.model().updateIndices()
105
106
  self.observationTable.model().layoutChanged.emit()
106
107
 
107
108
  def _cancelSelected(self, *args, **kwargs):
@@ -123,6 +124,7 @@ class FutureTomwerScanObserverWidget(qt.QWidget):
123
124
  self.observationTable.model().filtered_status = (
124
125
  self.filterWidget.getFilteredStatus()
125
126
  )
127
+ self.observationTable.model().endResetModel()
126
128
 
127
129
  def updateView(self):
128
130
  """
@@ -265,6 +267,16 @@ class _DatasetProcessModel(qt.QAbstractTableModel):
265
267
  del self._tomoObjStatus[future_tomo_obj]
266
268
  self.layoutChanged.emit()
267
269
 
270
+ def updateIndices(self):
271
+ """
272
+ Update tomo object indices when a tomo object has been removed (during a convertion for example)
273
+ """
274
+ tomo_objs = list(self.futureTomoObjs.values())
275
+ self.futureTomoObjs.clear()
276
+ for i_tomo_obj, tomo_obj in enumerate(tomo_objs):
277
+ self.futureTomoObjs[i_tomo_obj] = tomo_obj
278
+ self._computeUnfilteredFutureTomoObjs()
279
+
268
280
  def getUnfilteredFutureTomoObjs(self):
269
281
  return self._filteredFutureTomoObjs
270
282
 
@@ -61,9 +61,8 @@ class TestSlurmWidget(TestCaseQt):
61
61
  "partition": SlurmSettings.PARTITION,
62
62
  "n_gpus": SlurmSettings.N_GPUS_PER_WORKER,
63
63
  "job_name": "tomwer_{scan}_-_{process}_-_{info}",
64
- "modules": tuple(),
65
64
  "n_jobs": 1,
66
- "python_venv": "/scisoft/tomotools/activate stable",
65
+ "modules": ("tomotools/stable",),
67
66
  "walltime": "01:00:00",
68
67
  "sbatch_extra_params": {
69
68
  "export": "NONE",
@@ -57,7 +57,7 @@ class TestSupervisor(TestCaseQt):
57
57
  n_proj=10,
58
58
  n_ini_proj=10,
59
59
  create_ini_dark=False,
60
- create_ini_ref=False,
60
+ create_ini_flat=False,
61
61
  dim=10,
62
62
  ).scan
63
63
  self._scans.append(scan)
@@ -242,6 +242,11 @@ class BlissHDF5DataListDialog(_DataListDialog):
242
242
  os.environ["TOMWER_DEFAULT_INPUT_DIR"]
243
243
  ):
244
244
  dialog.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
245
+ elif dialog.directory() != os.getcwd() or str(dialog.directory()).startswith(
246
+ "/data"
247
+ ):
248
+ # if the directory as already been set by the user. Avoid redefining it
249
+ pass
245
250
  elif os.path.isdir("/data"):
246
251
  dialog.setDirectory("/data")
247
252
 
@@ -99,10 +99,8 @@ class ControlWidget(qt.QWidget):
99
99
  """
100
100
  Ask the user the path to the folder to observe
101
101
  """
102
- defaultDirectory = self.getFolderObserved()
102
+ defaultDirectory = self._qteFolderSelected.text()
103
103
  if defaultDirectory is None or not os.path.isdir(defaultDirectory):
104
- if os.path.isdir(self.DEFAULT_DIRECTORY):
105
- defaultDirectory = self.DEFAULT_DIRECTORY
106
104
  if defaultDirectory is None:
107
105
  defaultDirectory = get_default_directory()
108
106
 
@@ -113,4 +111,4 @@ class ControlWidget(qt.QWidget):
113
111
  dialog.close()
114
112
  return
115
113
 
116
- self.setFolderObserved(dialog.selectedFiles()[0])
114
+ self._qteFolderSelected.setText(dialog.selectedFiles()[0])
@@ -12,7 +12,7 @@ from silx.gui.dialog.DataFileDialog import DataFileDialog
12
12
 
13
13
  from tomoscan.esrf.scan.utils import cwd_context
14
14
  from tomoscan.framereducer.target import REDUCER_TARGET
15
- from tomoscan.io import HDF5File
15
+ from tomoscan.io import HDF5File, get_swmr_mode
16
16
 
17
17
  from tomwer.io.utils import get_default_directory
18
18
 
@@ -249,7 +249,7 @@ class ReduceDarkFlatSelectorTableWidget(qt.QWidget):
249
249
  if not os.path.exists(file_path):
250
250
  _logger.error(f"file doesn't exists ({file_path})")
251
251
 
252
- with HDF5File(file_path, mode="r") as h5f:
252
+ with HDF5File(file_path, mode="r", swmr=get_swmr_mode()) as h5f:
253
253
  entries = tuple(h5f.keys())
254
254
 
255
255
  res = []
@@ -289,16 +289,16 @@ class ReduceDarkFlatSelectorTableWidget(qt.QWidget):
289
289
  for target in REDUCER_TARGET.values():
290
290
  if target in reduced_info_dict:
291
291
  reduced_frames = reduced_info_dict[target]
292
- reduced_frames[
293
- "reduce_frames_name"
294
- ] = f"{target} from {url.data_path()}@{os.path.basename(url.file_path())}"
292
+ reduced_frames["reduce_frames_name"] = (
293
+ f"{target} from {url.data_path()}@{os.path.basename(url.file_path())}"
294
+ )
295
295
  result.append(reduced_frames)
296
296
 
297
297
  if len(reduced_frames) == 0:
298
298
  # else we consider the data_path is the valid one
299
- reduced_frames[
300
- "reduce_frames_name"
301
- ] = f"{url.data_path()}@{os.path.basename(url.file_path())}"
299
+ reduced_frames["reduce_frames_name"] = (
300
+ f"{url.data_path()}@{os.path.basename(url.file_path())}"
301
+ )
302
302
  result.append(reduced_frames)
303
303
 
304
304
  return tuple(result)
@@ -34,7 +34,7 @@ class TestSingletomoObj(TestCaseQt):
34
34
  n_proj=10,
35
35
  n_ini_proj=10,
36
36
  create_ini_dark=False,
37
- create_ini_ref=False,
37
+ create_ini_flat=False,
38
38
  dim=10,
39
39
  ).scan
40
40
 
@@ -37,7 +37,7 @@ from silx.gui.dialog.DataFileDialog import DataFileDialog
37
37
  from silx.io.url import DataUrl
38
38
  from silx.io.utils import h5py_read_dataset
39
39
  from nxtomo.nxobject.nxdetector import ImageKey
40
- from tomoscan.io import HDF5File
40
+ from tomoscan.io import HDF5File, get_swmr_mode
41
41
 
42
42
  import tomwer.core.utils.nxtomoutils as nxtomo_utils
43
43
  from tomwer.core.scan.nxtomoscan import NXtomoScan
@@ -83,7 +83,7 @@ class _DarkOrFlatUrl(qt.QWidget):
83
83
  url = self._redirectDataPath(url, logger=_logger)
84
84
 
85
85
  def dataset_invalid(url):
86
- with HDF5File(url.file_path(), mode="r") as h5s:
86
+ with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
87
87
  if not isinstance(h5s[url.data_path()], h5py.Dataset):
88
88
  return True
89
89
  return False
@@ -113,7 +113,7 @@ class _DarkOrFlatUrl(qt.QWidget):
113
113
 
114
114
  def _redirectDataPath(self, url, logger=None):
115
115
  try:
116
- with HDF5File(url.file_path(), mode="r") as h5s:
116
+ with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
117
117
  node = h5s[url.data_path()]
118
118
 
119
119
  if NXtomoScan.entry_is_nx_tomo(node):
@@ -188,7 +188,7 @@ class _DarkOrFlatUrl(qt.QWidget):
188
188
  def _getImageKey(self, url):
189
189
  # if we are on a 'detector / data dataset' then we can try to reach
190
190
  # image_key information
191
- with HDF5File(url.file_path(), mode="r") as h5s:
191
+ with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
192
192
  dataset = h5s[url.data_path()]
193
193
  grp_parent = dataset.parent
194
194
  if grp_parent is not None and NXtomoScan.is_nxdetector(grp_parent):
@@ -3,7 +3,7 @@ import h5py
3
3
  from silx.gui import qt
4
4
  from tomwer.core.scan.nxtomoscan import NXtomoScan
5
5
  from tomwer.gui import icons
6
- from tomoscan.io import HDF5File
6
+ from tomoscan.io import HDF5File, get_swmr_mode
7
7
 
8
8
 
9
9
  class NXtomoProxyWarmer(qt.QWidget):
@@ -44,7 +44,7 @@ class NXtomoProxyWarmer(qt.QWidget):
44
44
  if scan is None:
45
45
  self._activateWarning(False)
46
46
  elif isinstance(scan, NXtomoScan):
47
- with HDF5File(scan.master_file, mode="r") as h5f:
47
+ with HDF5File(scan.master_file, mode="r", swmr=get_swmr_mode()) as h5f:
48
48
  entry = h5f.get(
49
49
  name=scan.entry, getclass=True, getlink=True, default=None
50
50
  )
@@ -67,8 +67,8 @@ class TestDarkOrFlatUrl(TestCaseQt):
67
67
  n_ini_proj=20,
68
68
  n_proj=20,
69
69
  create_ini_dark=True,
70
- create_ini_ref=True,
71
- create_final_ref=True,
70
+ create_ini_flat=True,
71
+ create_final_flat=True,
72
72
  )
73
73
  self._scan = hdf5_mock.scan
74
74
  self.scan_url = DataUrl(
@@ -135,8 +135,8 @@ class TestDarkRefPatchWidget(TestCaseQt):
135
135
  n_ini_proj=20,
136
136
  n_proj=20,
137
137
  create_ini_dark=True,
138
- create_ini_ref=True,
139
- create_final_ref=True,
138
+ create_ini_flat=True,
139
+ create_final_flat=True,
140
140
  )
141
141
  self._scanWithDarkAndRef = hdf5_mock.scan
142
142
 
@@ -145,8 +145,8 @@ class TestDarkRefPatchWidget(TestCaseQt):
145
145
  n_ini_proj=20,
146
146
  n_proj=20,
147
147
  create_ini_dark=False,
148
- create_ini_ref=False,
149
- create_final_ref=False,
148
+ create_ini_flat=False,
149
+ create_final_flat=False,
150
150
  )
151
151
  self._scan = hdf5_mock.scan
152
152
  assert len(self._scan.darks) == 0
@@ -34,7 +34,7 @@ import logging
34
34
 
35
35
  from silx.gui import qt
36
36
  from silx.io.url import DataUrl
37
- from tomoscan.io import HDF5File
37
+ from tomoscan.io import HDF5File, get_swmr_mode
38
38
 
39
39
  from tomwer.core.scan.scanbase import TomwerScanBase
40
40
  from tomwer.synctools.imageloaderthread import ImageLoaderThread
@@ -71,7 +71,7 @@ class ImageFromFile(_Image):
71
71
 
72
72
  def get_nabu_entry():
73
73
  try:
74
- with HDF5File(_file, mode="r", swmr=True) as h5s:
74
+ with HDF5File(_file, mode="r", swmr=get_swmr_mode()) as h5s:
75
75
  for node in h5s:
76
76
  if "reconstruction" in h5s[node]:
77
77
  return "/".join(
@@ -78,6 +78,11 @@ class QDataDialog(qt.QFileDialog):
78
78
  os.environ["TOMWER_DEFAULT_INPUT_DIR"]
79
79
  ):
80
80
  self.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
81
+ elif self.directory() != os.getcwd() or str(self.directory()).startswith(
82
+ "/data"
83
+ ):
84
+ # if the directory as already been set by the user. Avoid redefining it
85
+ pass
81
86
  elif os.path.isdir("/data"):
82
87
  self.setDirectory("/data")
83
88