tomwer 1.0.3__py3-none-any.whl → 1.1.0__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 (269) hide show
  1. orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
  2. orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
  3. orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
  4. orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
  5. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
  6. orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
  7. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
  9. orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
  10. orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
  11. orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
  12. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
  13. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +3 -5
  14. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
  15. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
  16. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
  17. orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
  18. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
  19. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -129
  20. orangecontrib/tomwer/widgets/control/NotifierOW.py +34 -9
  21. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +19 -13
  23. orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
  24. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
  25. orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
  26. orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
  27. orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
  28. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
  29. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +73 -78
  30. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
  31. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
  32. orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
  33. orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
  34. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
  35. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
  36. orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
  37. orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
  38. orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
  39. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
  40. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -11
  41. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
  42. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
  43. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
  44. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
  45. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
  46. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -20
  47. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -18
  48. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
  49. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
  50. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
  51. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
  52. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
  53. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  54. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
  55. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
  56. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
  57. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
  58. tomwer/__main__.py +10 -5
  59. tomwer/app/canvas_launcher/config.py +10 -10
  60. tomwer/app/canvas_launcher/mainwindow.py +68 -6
  61. tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
  62. tomwer/app/darkref.py +16 -12
  63. tomwer/app/imagekeyeditor.py +2 -2
  64. tomwer/app/imagekeyupgrader.py +104 -0
  65. tomwer/app/intensitynormalization.py +0 -1
  66. tomwer/app/nxtomoeditor.py +103 -0
  67. tomwer/app/rsync.py +1 -1
  68. tomwer/core/cluster/cluster.py +1 -1
  69. tomwer/core/futureobject.py +1 -0
  70. tomwer/core/process/control/datalistener/datalistener.py +7 -1
  71. tomwer/core/process/control/datalistener/rpcserver.py +3 -4
  72. tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
  73. tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
  74. tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
  75. tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
  76. tomwer/core/process/control/nxtomomill.py +33 -58
  77. tomwer/core/process/control/scanlist.py +2 -1
  78. tomwer/core/process/control/scanselector.py +7 -0
  79. tomwer/core/process/control/scantransfer.py +2 -2
  80. tomwer/core/process/control/scanvalidator.py +6 -5
  81. tomwer/core/process/control/singletomoobj.py +2 -1
  82. tomwer/core/process/control/timer.py +2 -1
  83. tomwer/core/process/control/tomoobjserie.py +8 -2
  84. tomwer/core/process/control/volumeselector.py +2 -1
  85. tomwer/core/process/control/volumesymlink.py +2 -1
  86. tomwer/core/process/edit/darkflatpatch.py +2 -1
  87. tomwer/core/process/edit/imagekeyeditor.py +4 -3
  88. tomwer/core/process/reconstruction/axis/axis.py +29 -32
  89. tomwer/core/process/reconstruction/axis/mode.py +3 -2
  90. tomwer/core/process/reconstruction/axis/params.py +35 -16
  91. tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
  92. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
  93. tomwer/core/process/reconstruction/darkref/params.py +62 -67
  94. tomwer/core/process/reconstruction/lamino/tofu.py +1 -2
  95. tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
  96. tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
  97. tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
  98. tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
  99. tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
  100. tomwer/core/process/reconstruction/nabu/utils.py +32 -3
  101. tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
  102. tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
  103. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
  104. tomwer/core/process/reconstruction/test/__init__.py +0 -39
  105. tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
  106. tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
  107. tomwer/core/process/script/python.py +16 -12
  108. tomwer/core/process/task.py +3 -7
  109. tomwer/core/process/test/test_axis.py +1 -1
  110. tomwer/core/process/test/test_dark_and_flat.py +41 -111
  111. tomwer/core/process/test/test_data_listener.py +0 -29
  112. tomwer/core/process/test/test_data_transfer.py +10 -14
  113. tomwer/core/process/test/test_nabu.py +1 -1
  114. tomwer/core/process/test/test_normalization.py +1 -1
  115. tomwer/core/process/visualization/liveslice.py +6 -0
  116. tomwer/core/scan/blissscan.py +37 -2
  117. tomwer/core/scan/edfscan.py +19 -8
  118. tomwer/core/scan/hdf5scan.py +10 -4
  119. tomwer/core/scan/scanbase.py +35 -29
  120. tomwer/core/scan/scanfactory.py +3 -17
  121. tomwer/core/scan/test/test_h5.py +1 -1
  122. tomwer/core/scan/test/test_process_registration.py +0 -11
  123. tomwer/core/scan/test/test_scan.py +32 -30
  124. tomwer/core/settings.py +2 -2
  125. tomwer/core/test/test_utils.py +1 -1
  126. tomwer/core/tomwer_object.py +19 -0
  127. tomwer/core/utils/__init__.py +0 -45
  128. tomwer/core/utils/char.py +2 -0
  129. tomwer/core/utils/gpu.py +5 -5
  130. tomwer/core/utils/nxtomoutils.py +2 -2
  131. tomwer/core/utils/scanutils.py +50 -0
  132. tomwer/core/utils/volumeutils.py +13 -0
  133. tomwer/core/volume/edfvolume.py +4 -0
  134. tomwer/core/volume/hdf5volume.py +4 -0
  135. tomwer/core/volume/jp2kvolume.py +4 -0
  136. tomwer/core/volume/rawvolume.py +22 -5
  137. tomwer/core/volume/tiffvolume.py +4 -0
  138. tomwer/core/volume/volumebase.py +19 -12
  139. tomwer/core/volume/volumefactory.py +20 -1
  140. tomwer/gui/cluster/slurm.py +1 -1
  141. tomwer/gui/cluster/supervisor.py +0 -2
  142. tomwer/gui/cluster/test/test_cluster.py +2 -2
  143. tomwer/gui/control/datalist.py +109 -36
  144. tomwer/gui/control/datatransfert.py +1 -1
  145. tomwer/gui/control/datawatcher/configuration.py +0 -2
  146. tomwer/gui/control/datawatcher/datawatcher.py +23 -13
  147. tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
  148. tomwer/gui/control/observations.py +0 -3
  149. tomwer/gui/control/selectorwidgetbase.py +42 -12
  150. tomwer/gui/control/serie/seriecreator.py +967 -0
  151. tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
  152. tomwer/gui/control/singletomoobj.py +15 -4
  153. tomwer/gui/control/test/test_datalist.py +1 -1
  154. tomwer/gui/control/test/test_datalistener.py +1 -1
  155. tomwer/gui/control/test/test_inputwidget.py +1 -1
  156. tomwer/gui/control/test/test_process_manager.py +1 -13
  157. tomwer/gui/control/test/test_scanselector.py +1 -1
  158. tomwer/gui/control/test/test_scanvalidator.py +1 -1
  159. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  160. tomwer/gui/control/test/test_volume_dialog.py +19 -7
  161. tomwer/gui/control/test/test_volumeselector.py +4 -4
  162. tomwer/gui/debugtools/datasetgenerator.py +1 -9
  163. tomwer/gui/edit/dkrfpatch.py +2 -3
  164. tomwer/gui/edit/imagekeyeditor.py +12 -11
  165. tomwer/gui/edit/nxtomoeditor.py +475 -0
  166. tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
  167. tomwer/gui/edit/test/test_image_key_editor.py +2 -2
  168. tomwer/gui/edit/test/test_nx_editor.py +155 -0
  169. tomwer/gui/icons.py +0 -1
  170. tomwer/gui/qfolderdialog.py +11 -0
  171. tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
  172. tomwer/gui/reconstruction/axis/axis.py +2 -0
  173. tomwer/gui/reconstruction/axis/radioaxis.py +70 -14
  174. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
  175. tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
  176. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  177. tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
  178. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
  179. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -5
  180. tomwer/gui/reconstruction/nabu/castvolume.py +103 -24
  181. tomwer/gui/reconstruction/nabu/check.py +1 -1
  182. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
  183. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
  184. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
  185. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
  186. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
  187. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -15
  188. tomwer/gui/reconstruction/nabu/slices.py +10 -4
  189. tomwer/gui/reconstruction/nabu/slurm.py +1 -1
  190. tomwer/gui/reconstruction/nabu/volume.py +13 -7
  191. tomwer/gui/reconstruction/normalization/intensity.py +1 -5
  192. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -37
  193. tomwer/gui/reconstruction/saaxis/saaxis.py +11 -7
  194. tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
  195. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
  196. tomwer/gui/reconstruction/scores/scoreplot.py +67 -62
  197. tomwer/gui/reconstruction/test/test_axis.py +2 -2
  198. tomwer/gui/reconstruction/test/test_lamino.py +2 -2
  199. tomwer/gui/reconstruction/test/test_nabu.py +14 -1
  200. tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
  201. tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
  202. tomwer/gui/stackplot.py +11 -28
  203. tomwer/gui/test/test_axis_gui.py +4 -4
  204. tomwer/gui/test/test_qfolder_dialog.py +12 -0
  205. tomwer/gui/utils/inputwidget.py +42 -22
  206. tomwer/gui/utils/lineselector/lineselector.py +13 -21
  207. tomwer/gui/utils/scandescription.py +2 -4
  208. tomwer/gui/utils/slider.py +1 -102
  209. tomwer/gui/utils/unitsystem.py +48 -11
  210. tomwer/gui/visualization/dataviewer.py +24 -17
  211. tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
  212. tomwer/gui/visualization/nxtomometadata.py +21 -0
  213. tomwer/gui/visualization/scanoverview.py +0 -1
  214. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
  215. tomwer/gui/visualization/test/test_stacks.py +1 -1
  216. tomwer/gui/visualization/tomoobjoverview.py +49 -0
  217. tomwer/gui/visualization/volumeoverview.py +64 -0
  218. tomwer/gui/visualization/volumeviewer.py +1 -1
  219. tomwer/io/utils/utils.py +2 -2
  220. tomwer/resources/gui/icons/multi-document-save.png +0 -0
  221. tomwer/resources/gui/icons/multi-document-save.svg +101 -0
  222. tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
  223. tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
  224. tomwer/synctools/axis.py +0 -1
  225. tomwer/synctools/darkref.py +0 -1
  226. tomwer/synctools/datalistener.py +5 -1
  227. tomwer/synctools/imageloaderthread.py +2 -2
  228. tomwer/synctools/saaxis.py +0 -1
  229. tomwer/synctools/sadeltabeta.py +0 -1
  230. tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
  231. tomwer/synctools/stacks/processingstack.py +2 -2
  232. tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
  233. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -1
  234. tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
  235. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
  236. tomwer/synctools/test/test_darkRefs.py +32 -149
  237. tomwer/synctools/test/test_foldertransfer.py +1 -1
  238. tomwer/synctools/test/test_scanstages.py +2 -2
  239. tomwer/tests/conftest.py +51 -0
  240. tomwer/{test → tests}/test_scripts.py +1 -1
  241. tomwer/tests/test_utils.py +10 -0
  242. tomwer/{test → tests}/utils/utilstest.py +0 -11
  243. tomwer/version.py +3 -3
  244. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
  245. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/RECORD +255 -235
  246. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
  247. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
  248. orangecontrib/tomwer/setup.py +0 -45
  249. orangecontrib/tomwer/widgets/setup.py +0 -49
  250. tomwer/app/process.py +0 -153
  251. tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
  252. tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
  253. tomwer/core/utils/laminoutils.py +0 -80
  254. tomwer/gui/utils/lineselector/lineselection.py +0 -76
  255. tomwer/setup.py +0 -52
  256. tomwer/slurm/executor.py +0 -36
  257. tomwer/slurm/job.py +0 -349
  258. tomwer/slurm/utils.py +0 -44
  259. tomwer/web/client.py +0 -43
  260. tomwer/web/config.py +0 -36
  261. tomwer/web/test/test_graylog_connection.py +0 -59
  262. {tomwer/slurm → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
  263. /tomwer/{test → gui/control/serie}/__init__.py +0 -0
  264. /tomwer/{web/test → tests}/__init__.py +0 -0
  265. /tomwer/{test → tests}/utils/__init__.py +0 -0
  266. /tomwer-1.0.3-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
  267. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
  268. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
  269. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  # coding: utf-8
2
2
  # /*##########################################################################
3
- # Copyright (C) 2016 European Synchrotron Radiation Facility
3
+ #
4
+ # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
4
5
  #
5
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  # of this software and associated documentation files (the "Software"), to deal
@@ -20,11 +21,8 @@
20
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
22
  # THE SOFTWARE.
22
23
  #
23
- #############################################################################*/
24
- """Module containing process relative to the web (like classes used to link
25
- with graylog)
26
- """
24
+ # ###########################################################################*/
27
25
 
28
- __authors__ = ["H.Payno"]
26
+ __authors__ = ["H. Payno"]
29
27
  __license__ = "MIT"
30
- __date__ = "15/05/2017"
28
+ __date__ = "12/01/2022"
@@ -23,7 +23,6 @@ _logger = logging.getLogger(__name__)
23
23
 
24
24
 
25
25
  class SingleTomoObj(qt.QWidget):
26
-
27
26
  sigTomoObjChanged = qt.Signal(str)
28
27
  """signal emit when the tomo object changed. Parameter is the identifier"""
29
28
 
@@ -51,7 +50,7 @@ class SingleTomoObj(qt.QWidget):
51
50
  def getTomoObjIdentifier(self) -> str:
52
51
  return self._tomoObjIdentifierLineQLE.text()
53
52
 
54
- def _selectObject(self, *args, **kwargs):
53
+ def _selectObject(self, *args, **kwargs): # pragma: no cover
55
54
  dialog = QDataDialog(self, multiSelection=True)
56
55
  dialog.setNameFilters(
57
56
  [
@@ -111,7 +110,7 @@ class SingleTomoObj(qt.QWidget):
111
110
  return ScanFactory.create_scan_objects(path)
112
111
  except: # noqa E722
113
112
  try:
114
- return guess_volumes(
113
+ volumes = guess_volumes(
115
114
  path,
116
115
  scheme_to_vol={
117
116
  EDFVolumeIdentifier.scheme: EDFVolume,
@@ -124,7 +123,19 @@ class SingleTomoObj(qt.QWidget):
124
123
  )
125
124
  except: # noqa E722
126
125
  pass
127
- return None
126
+ return None
127
+ else:
128
+ # filter potential 'nabu histogram'
129
+ if volumes is not None:
130
+
131
+ def is_not_histogram(vol_identifier):
132
+ return not (
133
+ hasattr(vol_identifier, "data_path")
134
+ and vol_identifier.data_path.endswith("histogram")
135
+ )
136
+
137
+ volumes = tuple(filter(is_not_histogram, volumes))
138
+ return volumes
128
139
 
129
140
 
130
141
  class _TomoObjQLE(QLFileSystem):
@@ -29,7 +29,7 @@ __date__ = "05/11/2018"
29
29
 
30
30
  from tomwer.gui.control.datalist import GenericScanListDialog
31
31
  from tomwer.gui.control.datalist import VolumeList
32
- from tomwer.test.utils import skip_gui_test
32
+ from tomwer.tests.utils import skip_gui_test
33
33
  from silx.gui.utils.testutils import TestCaseQt
34
34
  from tomwer.core.utils.scanutils import MockEDF
35
35
  from silx.gui import qt
@@ -30,7 +30,7 @@ __date__ = "18/03/2020"
30
30
 
31
31
  from silx.gui import qt
32
32
  from silx.gui.utils.testutils import TestCaseQt
33
- from tomwer.test.utils import skip_gui_test
33
+ from tomwer.tests.utils import skip_gui_test
34
34
  from tomwer.gui.control.datalistener import ConfigurationWidget
35
35
  from silx.gui.utils.testutils import SignalListener
36
36
  import pytest
@@ -28,7 +28,7 @@ __date__ = "16/06/2021"
28
28
 
29
29
 
30
30
  from tomwer.gui.utils import inputwidget
31
- from tomwer.test.utils import skip_gui_test
31
+ from tomwer.tests.utils import skip_gui_test
32
32
  from silx.gui.utils.testutils import TestCaseQt
33
33
  from silx.gui import qt
34
34
  import numpy
@@ -28,11 +28,10 @@ __license__ = "MIT"
28
28
  __date__ = "09/11/2020"
29
29
 
30
30
 
31
- import unittest
32
31
  import pytest
33
32
  from silx.gui import qt
34
33
  from silx.gui.utils.testutils import TestCaseQt
35
- from tomwer.test.utils import skip_gui_test
34
+ from tomwer.tests.utils import skip_gui_test
36
35
  from tomwer.gui.control.datalistener import ConfigurationWidget
37
36
  from silx.gui.utils.testutils import SignalListener
38
37
 
@@ -64,14 +63,3 @@ class TestProcessManager(TestCaseQt):
64
63
  self.assertEqual(
65
64
  self._configWidget.getConfiguration(), {"host": "toto", "port": 0}
66
65
  )
67
-
68
-
69
- def suite():
70
- test_suite = unittest.TestSuite()
71
- for ui in (TestProcessManager,):
72
- test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
73
- return test_suite
74
-
75
-
76
- if __name__ == "__main__":
77
- unittest.main(defaultTest="suite")
@@ -27,7 +27,7 @@ __license__ = "MIT"
27
27
  __date__ = "22/01/2017"
28
28
 
29
29
 
30
- from tomwer.test.utils import skip_gui_test
30
+ from tomwer.tests.utils import skip_gui_test
31
31
  from silx.gui.utils.testutils import TestCaseQt
32
32
  from tomwer.gui.control.scanselectorwidget import ScanSelectorWidget
33
33
  from tomwer.core.utils.scanutils import MockEDF
@@ -41,7 +41,7 @@ from tomwer.core.utils.scanutils import MockEDF
41
41
  from tomwer.core.process.control.scanvalidator import ScanValidatorP
42
42
  from tomwer.gui.utils.waiterthread import QWaiterThread
43
43
  from tomwer.core.scan.edfscan import EDFTomoScan
44
- from tomwer.test.utils import skip_gui_test
44
+ from tomwer.tests.utils import skip_gui_test
45
45
 
46
46
  logging.disable(logging.INFO)
47
47
 
@@ -22,7 +22,7 @@ class TestSingletomoObj(TestCaseQt):
22
22
  self.volume = HDF5Volume(
23
23
  file_path=self._volume_file_path,
24
24
  data_path="my_volume",
25
- data=numpy.linspace(0, 200, 200).reshape(2, 10, 10),
25
+ data=numpy.linspace(start=0, stop=200, num=200).reshape((2, 10, 10)),
26
26
  )
27
27
  self.volume.save()
28
28
 
@@ -34,7 +34,7 @@ import shutil
34
34
  import tempfile
35
35
  from silx.gui.utils.testutils import TestCaseQt
36
36
  from silx.gui import qt
37
- from tomwer.test.utils import skip_gui_test
37
+ from tomwer.tests.utils import skip_gui_test
38
38
  from tomwer.gui.qfolderdialog import QVolumeDialog
39
39
  from tomoscan.esrf.volume.edfvolume import EDFVolume
40
40
  from tomoscan.esrf.volume.hdf5volume import HDF5Volume
@@ -67,7 +67,9 @@ class TestVolumeDialog(TestCaseQt):
67
67
  volume = HDF5Volume(
68
68
  file_path=file_path,
69
69
  data_path="entry",
70
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
70
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
71
+ (3, 10, 10)
72
+ ),
71
73
  )
72
74
  volume.save()
73
75
  self._dialog.show()
@@ -93,7 +95,9 @@ class TestVolumeDialog(TestCaseQt):
93
95
  volume = HDF5Volume(
94
96
  file_path=file_path,
95
97
  data_path="entry",
96
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
98
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
99
+ (3, 10, 10)
100
+ ),
97
101
  )
98
102
  volume.save()
99
103
 
@@ -115,7 +119,9 @@ class TestVolumeDialog(TestCaseQt):
115
119
  self._dialog.setFullAuto(True)
116
120
  volume = EDFVolume(
117
121
  folder=self.tmp_dir,
118
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
122
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
123
+ (3, 10, 10)
124
+ ),
119
125
  )
120
126
  volume.save()
121
127
  self._dialog.show()
@@ -140,7 +146,9 @@ class TestVolumeDialog(TestCaseQt):
140
146
  self._dialog.setFullAuto(False)
141
147
  volume = EDFVolume(
142
148
  folder=self.tmp_dir,
143
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
149
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
150
+ (3, 10, 10)
151
+ ),
144
152
  volume_basename="test",
145
153
  )
146
154
  volume.save()
@@ -168,7 +176,9 @@ class TestVolumeDialog(TestCaseQt):
168
176
  volume = HDF5Volume(
169
177
  file_path=file_path,
170
178
  data_path="entry",
171
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
179
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
180
+ (3, 10, 10)
181
+ ),
172
182
  )
173
183
  volume.save()
174
184
  self._dialog.setVolumeUrl(volume.get_identifier().to_str())
@@ -187,7 +197,9 @@ class TestVolumeDialog(TestCaseQt):
187
197
  """
188
198
  volume = EDFVolume(
189
199
  folder=self.tmp_dir,
190
- data=numpy.linspace(1, 10, 300, dtype=numpy.uint8).reshape(3, 10, 10),
200
+ data=numpy.linspace(start=1, stop=10, num=300, dtype=numpy.uint8).reshape(
201
+ (3, 10, 10)
202
+ ),
191
203
  volume_basename="test",
192
204
  )
193
205
  volume.save()
@@ -28,7 +28,7 @@ __date__ = "22/01/2017"
28
28
 
29
29
 
30
30
  import os
31
- from tomwer.test.utils import skip_gui_test
31
+ from tomwer.tests.utils import skip_gui_test
32
32
  from silx.gui import qt
33
33
  from silx.gui.utils.testutils import TestCaseQt
34
34
  from tomwer.gui.control.volumeselectorwidget import VolumeSelectorWidget
@@ -52,20 +52,20 @@ class TestVolumeSelector(TestCaseQt):
52
52
  self.volume_1 = HDF5Volume(
53
53
  file_path=os.path.join(self.folder, "my_volume.hdf5"),
54
54
  data_path="entry0000",
55
- data=numpy.linspace(1, 100, 300).reshape(3, 10, 10),
55
+ data=numpy.linspace(start=1, stop=100, num=300).reshape((3, 10, 10)),
56
56
  )
57
57
  self.volume_1.save()
58
58
 
59
59
  self.volume_2 = HDF5Volume(
60
60
  file_path=os.path.join(self.folder, "my_volume.hdf5"),
61
61
  data_path="entry0001",
62
- data=numpy.linspace(1, 100, 400).reshape(4, 10, 10),
62
+ data=numpy.linspace(start=1, stop=100, num=400).reshape((4, 10, 10)),
63
63
  )
64
64
  self.volume_2.save()
65
65
 
66
66
  self.volume_3 = EDFVolume(
67
67
  folder=os.path.join(self.folder, "vol"),
68
- data=numpy.linspace(1, 100, 500).reshape(5, 10, 10),
68
+ data=numpy.linspace(start=1, stop=100, num=500).reshape((5, 10, 10)),
69
69
  )
70
70
  self.volume_3.save()
71
71
 
@@ -37,7 +37,6 @@ from tomwer.core.scan.blissscan import BlissScan
37
37
 
38
38
 
39
39
  class DatasetGeneratorDialog(qt.QDialog):
40
-
41
40
  sigGenerationStarted = qt.Signal()
42
41
  """signal emitted when the generation is started"""
43
42
 
@@ -183,7 +182,7 @@ class DatasetGeneratorConfig(qt.QWidget):
183
182
  def _signalUpdated(self, *args, **kwargs):
184
183
  self.sigConfigChanged.emit()
185
184
 
186
- def _selectRootFolder(self):
185
+ def _selectRootFolder(self): # pragma: no cover
187
186
  defaultDirectory = self._outputQLE.text()
188
187
  dialog = qt.QFileDialog(self, directory=defaultDirectory)
189
188
  dialog.setFileMode(qt.QFileDialog.DirectoryOnly)
@@ -278,10 +277,3 @@ class DatasetGeneratorConfig(qt.QWidget):
278
277
  if "flat_at_beginning" in config:
279
278
  self.setFlatNeededAtBeginning(config["flat_at_beginning"])
280
279
  self.blockSignals(old)
281
-
282
-
283
- if __name__ == "__main__":
284
- app = qt.QApplication([])
285
- dialog = DatasetGeneratorDialog(parent=None)
286
- dialog.show()
287
- app.exec_()
@@ -31,7 +31,7 @@ __date__ = "30/10/2020"
31
31
  import h5py
32
32
  from silx.gui import qt
33
33
  from silx.io.utils import h5py_read_dataset
34
- from tomoscan.esrf.hdf5scan import ImageKey
34
+ from tomoscan.esrf.scan.hdf5scan import ImageKey
35
35
  from silx.io.url import DataUrl
36
36
  from tomoscan.io import HDF5File
37
37
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
@@ -46,7 +46,6 @@ _logger = logging.getLogger(__name__)
46
46
 
47
47
 
48
48
  class _DarkOrFlatUrl(qt.QWidget):
49
-
50
49
  editingFinished = qt.Signal()
51
50
  """Signal emit when the url changes"""
52
51
 
@@ -242,7 +241,7 @@ class _DarkOrFlatUrl(qt.QWidget):
242
241
  scheme="silx",
243
242
  )
244
243
  except Exception as e:
245
- _logger.warning("Fail to create url. Reason is", str(e))
244
+ _logger.warning(f"Fail to create url. Reason is {e}")
246
245
  return None
247
246
  else:
248
247
  return url
@@ -32,7 +32,7 @@ from silx.gui import qt
32
32
  from tomwer.core.process.edit.imagekeyeditor import IMAGE_KEYS
33
33
  from typing import Union
34
34
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
35
- from tomoscan.esrf.hdf5scan import ImageKey as _ImageKey
35
+ from tomoscan.esrf.scan.hdf5scan import ImageKey as _ImageKey
36
36
  import weakref
37
37
  import functools
38
38
  from collections.abc import Iterable
@@ -154,7 +154,6 @@ class ImageKeyWindow(qt.QMainWindow):
154
154
 
155
155
 
156
156
  class _ImageKeyEditor(qt.QDialog):
157
-
158
157
  sigApply = qt.Signal()
159
158
  """Signal emitted when the user request to apply the current modifications
160
159
  """
@@ -172,7 +171,7 @@ class _ImageKeyEditor(qt.QDialog):
172
171
  # mode selection
173
172
  self.layout().addWidget(qt.QLabel("selection mode"), 1, 0, 1, 1)
174
173
  self._selectionModeCB = qt.QComboBox(self)
175
- for mode in ("slice", "list"):
174
+ for mode in ("range", "list"):
176
175
  self._selectionModeCB.addItem(mode)
177
176
  self._selectionModeCB.setCurrentIndex(self._selectionModeCB.findText("list"))
178
177
  self.layout().addWidget(self._selectionModeCB, 1, 1, 1, 1)
@@ -225,7 +224,7 @@ class _ImageKeyEditor(qt.QDialog):
225
224
  def getSelectionMode(self) -> str:
226
225
  """
227
226
 
228
- :return: frame indexes selection mode. Can be 'slice' or 'list'
227
+ :return: frame indexes selection mode. Can be 'range' or 'list'
229
228
  """
230
229
  return self._selectionModeCB.currentText()
231
230
 
@@ -235,7 +234,7 @@ class _ImageKeyEditor(qt.QDialog):
235
234
  :return: list of indexes to be modified
236
235
  :rtype: list
237
236
  """
238
- if self.getSelectionMode() == "slice":
237
+ if self.getSelectionMode() == "range":
239
238
  return self._selectionWidget.getSlice()
240
239
  elif self.getSelectionMode() == "list":
241
240
  return self._selectionWidget.getList()
@@ -322,7 +321,7 @@ class _ListSelection(qt.QWidget):
322
321
  def _selectFrames(self):
323
322
  if self._scan is None or self._scan() is None:
324
323
  _logger.warning(
325
- "No scan set or has been moved. Unable to select " "slices from it."
324
+ "No scan set or has been moved. Unable to select slices from it."
326
325
  )
327
326
  return
328
327
  scan = self._scan()
@@ -376,11 +375,14 @@ class _EditionSelection(qt.QWidget):
376
375
  def setSelectionMode(self, mode: str) -> None:
377
376
  """
378
377
 
379
- :param str mode: define indexes selection mode. Can be 'slice' or
378
+ :param str mode: define indexes selection mode. Can be 'range' or
380
379
  'list'
381
380
  """
382
- assert mode in ("slice", "list")
383
- self._sliceSelection.setVisible(mode == "slice")
381
+ if mode == "slice":
382
+ # for backward compatibility (user can have .ows with old name)
383
+ mode = "range"
384
+ assert mode in ("range", "list")
385
+ self._sliceSelection.setVisible(mode == "range")
384
386
  self._listSelection.setVisible(mode == "list")
385
387
 
386
388
  def getList(self) -> list:
@@ -446,7 +448,7 @@ class _ImageKeyList(qt.QTableWidget):
446
448
  """
447
449
  Update the QTableWidget for the provided frames
448
450
 
449
- :param Iterable frames: Iterable of tomoscan.esrf.HDF5TomoScan.Frame
451
+ :param Iterable frames: Iterable of tomoscan.esrf.scan.HDF5TomoScan.Frame
450
452
  :param dict frames_new_keys: dictionary with frame edited. key is frame
451
453
  index. Value is the new `image_key` value
452
454
  """
@@ -572,7 +574,6 @@ class _ImageKeyList(qt.QTableWidget):
572
574
 
573
575
 
574
576
  class _ImageKeyListFiltered(qt.QWidget):
575
-
576
577
  MODIFIED_IMG_FILTER = "modified"
577
578
  ALL_IMG_FILTER = "all"
578
579