tomwer 1.1.1__py3-none-any.whl → 1.2.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.
Files changed (353) hide show
  1. orangecontrib/tomwer/__init__.py +1 -0
  2. orangecontrib/tomwer/orange/managedprocess.py +6 -4
  3. orangecontrib/tomwer/state_summary.py +3 -2
  4. orangecontrib/tomwer/widgets/__init__.py +2 -2
  5. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +9 -7
  6. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +6 -5
  7. orangecontrib/tomwer/widgets/control/AdvancementOW.py +2 -1
  8. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +235 -0
  9. orangecontrib/tomwer/widgets/control/DataListOW.py +7 -5
  10. orangecontrib/tomwer/widgets/control/DataListenerOW.py +13 -14
  11. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +8 -6
  12. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +9 -9
  13. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +7 -8
  14. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +25 -17
  15. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +8 -8
  16. orangecontrib/tomwer/widgets/control/FilterOW.py +9 -8
  17. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -4
  18. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +13 -14
  19. orangecontrib/tomwer/widgets/control/NotifierOW.py +3 -4
  20. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +7 -5
  21. orangecontrib/tomwer/widgets/control/TimerOW.py +6 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +5 -3
  23. orangecontrib/tomwer/widgets/control/VolumeSelector.py +8 -6
  24. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +10 -9
  25. orangecontrib/tomwer/widgets/control/icons/datadiscover.png +0 -0
  26. orangecontrib/tomwer/widgets/control/icons/datadiscover.svg +137 -0
  27. orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
  28. orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +5 -8
  29. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +13 -15
  30. orangecontrib/tomwer/widgets/debugtools/ObjectInspectorOW.py +3 -2
  31. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +10 -7
  32. orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +8 -5
  33. orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +5 -2
  34. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +6 -3
  35. orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +8 -6
  36. orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +3 -1
  37. orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +3 -1
  38. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -1
  39. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +11 -11
  40. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +22 -27
  41. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +13 -11
  42. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +11 -9
  43. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +16 -14
  44. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +27 -32
  45. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +27 -34
  46. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +23 -25
  47. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +16 -18
  48. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +9 -7
  49. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
  50. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +8 -11
  51. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +8 -8
  52. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +6 -4
  53. orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +4 -3
  54. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +4 -3
  55. orangecontrib/tomwer/widgets/visualization/RadioStackOW.py +6 -4
  56. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +8 -6
  57. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +6 -3
  58. orangecontrib/tomwer/widgets/visualization/SliceStackOW.py +7 -5
  59. orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +5 -4
  60. tomwer/__init__.py +1 -1
  61. tomwer/__main__.py +2 -1
  62. tomwer/app/axis.py +18 -14
  63. tomwer/app/canvas.py +7 -5
  64. tomwer/app/canvas_launcher/config.py +8 -6
  65. tomwer/app/canvas_launcher/environ.py +1 -2
  66. tomwer/app/canvas_launcher/mainwindow.py +23 -22
  67. tomwer/app/canvas_launcher/splash.py +1 -0
  68. tomwer/app/canvas_launcher/widgetsscheme.py +3 -3
  69. tomwer/app/darkref.py +7 -6
  70. tomwer/app/darkrefpatch.py +8 -6
  71. tomwer/app/diffframe.py +6 -4
  72. tomwer/app/imagekeyeditor.py +10 -10
  73. tomwer/app/imagekeyupgrader.py +8 -6
  74. tomwer/app/intensitynormalization.py +8 -8
  75. tomwer/app/lamino.py +5 -3
  76. tomwer/app/nabuapp.py +8 -6
  77. tomwer/app/nxtomoeditor.py +6 -5
  78. tomwer/app/radiostack.py +8 -6
  79. tomwer/app/rsync.py +3 -3
  80. tomwer/app/saaxis.py +22 -23
  81. tomwer/app/sadeltabeta.py +21 -21
  82. tomwer/app/samplemoved.py +8 -6
  83. tomwer/app/scanviewer.py +7 -6
  84. tomwer/app/sinogramviewer.py +8 -7
  85. tomwer/app/slicestack.py +8 -6
  86. tomwer/app/stopdatalistener.py +2 -1
  87. tomwer/core/futureobject.py +15 -6
  88. tomwer/core/log/logger.py +4 -3
  89. tomwer/core/log/processlog.py +0 -1
  90. tomwer/core/process/conditions/filters.py +3 -3
  91. tomwer/core/process/control/datadiscovery.py +7 -0
  92. tomwer/core/process/control/datalistener/datalistener.py +22 -21
  93. tomwer/core/process/control/datalistener/rpcserver.py +18 -28
  94. tomwer/core/process/control/datawatcher/datawatcher.py +15 -12
  95. tomwer/core/process/control/datawatcher/datawatcherobserver.py +11 -8
  96. tomwer/core/process/control/datawatcher/datawatcherprocess.py +7 -5
  97. tomwer/core/process/control/datawatcher/edfdwprocess.py +5 -15
  98. tomwer/core/process/control/datawatcher/hdf5dwprocess.py +3 -1
  99. tomwer/core/process/control/datawatcher/status.py +2 -0
  100. tomwer/core/process/control/nxtomomill.py +7 -6
  101. tomwer/core/process/control/scanlist.py +2 -1
  102. tomwer/core/process/control/scanselector.py +1 -0
  103. tomwer/core/process/control/scantransfer.py +12 -12
  104. tomwer/core/process/control/scanvalidator.py +7 -6
  105. tomwer/core/process/control/test/test_volume_link.py +5 -4
  106. tomwer/core/process/control/timer.py +4 -4
  107. tomwer/core/process/control/volumeselector.py +1 -0
  108. tomwer/core/process/control/volumesymlink.py +8 -9
  109. tomwer/core/process/edit/darkflatpatch.py +9 -12
  110. tomwer/core/process/edit/imagekeyeditor.py +11 -13
  111. tomwer/core/process/reconstruction/axis/axis.py +36 -38
  112. tomwer/core/process/reconstruction/axis/mode.py +2 -1
  113. tomwer/core/process/reconstruction/axis/params.py +23 -28
  114. tomwer/core/process/reconstruction/darkref/darkrefs.py +23 -27
  115. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +14 -18
  116. tomwer/core/process/reconstruction/darkref/params.py +3 -1
  117. tomwer/core/process/reconstruction/lamino/tofu.py +11 -15
  118. tomwer/core/process/reconstruction/nabu/castvolume.py +15 -18
  119. tomwer/core/process/reconstruction/nabu/nabucommon.py +19 -20
  120. tomwer/core/process/reconstruction/nabu/nabuscores.py +16 -14
  121. tomwer/core/process/reconstruction/nabu/nabuslices.py +27 -22
  122. tomwer/core/process/reconstruction/nabu/nabuvolume.py +20 -22
  123. tomwer/core/process/reconstruction/nabu/utils.py +17 -15
  124. tomwer/core/process/reconstruction/normalization/__init__.py +1 -3
  125. tomwer/core/process/reconstruction/normalization/normalization.py +16 -21
  126. tomwer/core/process/reconstruction/normalization/params.py +2 -2
  127. tomwer/core/process/reconstruction/saaxis/__init__.py +1 -1
  128. tomwer/core/process/reconstruction/saaxis/params.py +6 -7
  129. tomwer/core/process/reconstruction/saaxis/saaxis.py +44 -55
  130. tomwer/core/process/reconstruction/sadeltabeta/__init__.py +1 -1
  131. tomwer/core/process/reconstruction/sadeltabeta/params.py +9 -13
  132. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +40 -46
  133. tomwer/core/process/reconstruction/scores/__init__.py +2 -2
  134. tomwer/core/process/reconstruction/scores/params.py +6 -9
  135. tomwer/core/process/reconstruction/scores/scores.py +10 -13
  136. tomwer/core/process/reconstruction/test/test_axis_params.py +4 -2
  137. tomwer/core/process/reconstruction/test/test_darkref.py +1 -2
  138. tomwer/core/process/reconstruction/test/test_darkref_copy.py +3 -1
  139. tomwer/core/process/reconstruction/test/test_paramsbase.py +1 -1
  140. tomwer/core/process/reconstruction/test/test_saaxis.py +11 -7
  141. tomwer/core/process/reconstruction/test/test_sadeltabeta.py +5 -4
  142. tomwer/core/process/reconstruction/test/test_utils.py +3 -2
  143. tomwer/core/process/script/python.py +6 -8
  144. tomwer/core/process/task.py +11 -12
  145. tomwer/core/process/test/test_axis.py +12 -9
  146. tomwer/core/process/test/test_conditions.py +8 -8
  147. tomwer/core/process/test/test_dark_and_flat.py +9 -8
  148. tomwer/core/process/test/test_data_listener.py +5 -3
  149. tomwer/core/process/test/test_data_transfer.py +14 -12
  150. tomwer/core/process/test/test_data_watcher.py +3 -1
  151. tomwer/core/process/test/test_lamino.py +3 -1
  152. tomwer/core/process/test/test_nabu.py +13 -12
  153. tomwer/core/process/test/test_normalization.py +7 -5
  154. tomwer/core/process/test/test_timer.py +2 -1
  155. tomwer/core/process/utils.py +9 -9
  156. tomwer/core/progress.py +3 -4
  157. tomwer/core/scan/blissscan.py +4 -2
  158. tomwer/core/scan/edfscan.py +26 -29
  159. tomwer/core/scan/futurescan.py +2 -1
  160. tomwer/core/scan/hdf5scan.py +21 -28
  161. tomwer/core/scan/scanbase.py +18 -18
  162. tomwer/core/scan/scanfactory.py +20 -21
  163. tomwer/core/scan/scantype.py +7 -0
  164. tomwer/core/scan/test/test_edf.py +2 -1
  165. tomwer/core/scan/test/test_future_scan.py +2 -1
  166. tomwer/core/scan/test/test_h5.py +5 -4
  167. tomwer/core/scan/test/test_process_registration.py +5 -3
  168. tomwer/core/scan/test/test_scan.py +11 -9
  169. tomwer/core/settings.py +1 -2
  170. tomwer/core/test/test_lamino.py +3 -2
  171. tomwer/core/test/test_scanutils.py +3 -2
  172. tomwer/core/test/test_utils.py +6 -4
  173. tomwer/core/utils/__init__.py +8 -6
  174. tomwer/core/utils/deprecation.py +2 -2
  175. tomwer/core/utils/image.py +4 -3
  176. tomwer/core/utils/locker.py +1 -1
  177. tomwer/core/utils/normalization.py +1 -0
  178. tomwer/core/utils/nxtomoutils.py +2 -1
  179. tomwer/core/utils/scanutils.py +9 -6
  180. tomwer/core/utils/slurm.py +2 -1
  181. tomwer/core/utils/time.py +2 -4
  182. tomwer/core/utils/volumeutils.py +2 -1
  183. tomwer/core/volume/__init__.py +1 -1
  184. tomwer/core/volume/edfvolume.py +4 -3
  185. tomwer/core/volume/hdf5volume.py +6 -8
  186. tomwer/core/volume/jp2kvolume.py +4 -3
  187. tomwer/core/volume/rawvolume.py +7 -7
  188. tomwer/core/volume/tiffvolume.py +8 -6
  189. tomwer/core/volume/volumebase.py +1 -0
  190. tomwer/core/volume/volumefactory.py +18 -18
  191. tomwer/gui/cluster/slurm.py +2 -0
  192. tomwer/gui/cluster/supervisor.py +4 -2
  193. tomwer/gui/cluster/test/test_cluster.py +5 -4
  194. tomwer/gui/cluster/test/test_supervisor.py +4 -2
  195. tomwer/gui/conditions/filter.py +7 -6
  196. tomwer/gui/control/actions.py +1 -0
  197. tomwer/gui/control/datadiscovery.py +168 -0
  198. tomwer/gui/control/datalist.py +29 -28
  199. tomwer/gui/control/datalistener.py +8 -4
  200. tomwer/gui/control/datareacheractions.py +2 -1
  201. tomwer/gui/control/datatransfert.py +3 -1
  202. tomwer/gui/control/datavalidator.py +11 -12
  203. tomwer/gui/control/datawatcher/configuration.py +12 -1
  204. tomwer/gui/control/datawatcher/controlwidget.py +116 -0
  205. tomwer/gui/control/datawatcher/datawatcher.py +63 -121
  206. tomwer/gui/control/datawatcher/datawatcherobserver.py +7 -9
  207. tomwer/gui/control/history.py +3 -1
  208. tomwer/gui/control/observations.py +7 -7
  209. tomwer/gui/control/scanselectorwidget.py +4 -2
  210. tomwer/gui/control/selectorwidgetbase.py +3 -1
  211. tomwer/gui/control/serie/seriecreator.py +11 -12
  212. tomwer/gui/control/singletomoobj.py +4 -4
  213. tomwer/gui/control/test/test_datadiscovery.py +27 -0
  214. tomwer/gui/control/test/test_datalist.py +7 -6
  215. tomwer/gui/control/test/test_datalistener.py +4 -4
  216. tomwer/gui/control/test/test_datavalidator.py +3 -1
  217. tomwer/gui/control/test/test_inputwidget.py +5 -4
  218. tomwer/gui/control/test/test_process_manager.py +3 -3
  219. tomwer/gui/control/test/test_scanselector.py +6 -4
  220. tomwer/gui/control/test/test_scanvalidator.py +6 -5
  221. tomwer/gui/control/test/test_single_tomo_obj.py +5 -3
  222. tomwer/gui/control/test/test_volume_dialog.py +7 -5
  223. tomwer/gui/control/test/test_volumeselector.py +8 -6
  224. tomwer/gui/control/volumeselectorwidget.py +2 -1
  225. tomwer/gui/debugtools/datasetgenerator.py +2 -1
  226. tomwer/gui/debugtools/objectinspector.py +6 -7
  227. tomwer/gui/edit/dkrfpatch.py +11 -10
  228. tomwer/gui/edit/imagekeyeditor.py +12 -12
  229. tomwer/gui/edit/nxtomoeditor.py +8 -7
  230. tomwer/gui/edit/test/test_dkrf_patch.py +10 -9
  231. tomwer/gui/edit/test/test_image_key_editor.py +8 -6
  232. tomwer/gui/edit/test/test_nx_editor.py +7 -5
  233. tomwer/gui/icons.py +3 -2
  234. tomwer/gui/illustrations.py +3 -2
  235. tomwer/gui/imagefromfile.py +3 -1
  236. tomwer/gui/qfolderdialog.py +14 -12
  237. tomwer/gui/reconstruction/axis/CompareImages.py +9 -8
  238. tomwer/gui/reconstruction/axis/__init__.py +1 -1
  239. tomwer/gui/reconstruction/axis/axis.py +9 -7
  240. tomwer/gui/reconstruction/axis/radioaxis.py +30 -32
  241. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +6 -5
  242. tomwer/gui/reconstruction/darkref/darkrefwidget.py +4 -2
  243. tomwer/gui/reconstruction/lamino/tofu/misc.py +3 -1
  244. tomwer/gui/reconstruction/lamino/tofu/projections.py +16 -8
  245. tomwer/gui/reconstruction/lamino/tofu/tofu.py +6 -3
  246. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +5 -2
  247. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +8 -5
  248. tomwer/gui/reconstruction/nabu/action.py +1 -0
  249. tomwer/gui/reconstruction/nabu/castvolume.py +6 -4
  250. tomwer/gui/reconstruction/nabu/check.py +3 -2
  251. tomwer/gui/reconstruction/nabu/nabuconfig/base.py +5 -2
  252. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +6 -3
  253. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +4 -3
  254. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +7 -5
  255. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +8 -6
  256. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +7 -7
  257. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +40 -33
  258. tomwer/gui/reconstruction/nabu/nabuflow.py +7 -4
  259. tomwer/gui/reconstruction/nabu/slices.py +14 -10
  260. tomwer/gui/reconstruction/nabu/slurm.py +1 -0
  261. tomwer/gui/reconstruction/nabu/volume.py +5 -3
  262. tomwer/gui/reconstruction/normalization/intensity.py +14 -13
  263. tomwer/gui/reconstruction/saaxis/corrangeselector.py +36 -35
  264. tomwer/gui/reconstruction/saaxis/dimensionwidget.py +5 -4
  265. tomwer/gui/reconstruction/saaxis/saaxis.py +17 -17
  266. tomwer/gui/reconstruction/saaxis/sliceselector.py +5 -5
  267. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +33 -36
  268. tomwer/gui/reconstruction/scores/scoreplot.py +19 -18
  269. tomwer/gui/reconstruction/test/test_axis.py +14 -13
  270. tomwer/gui/reconstruction/test/test_lamino.py +3 -2
  271. tomwer/gui/reconstruction/test/test_nabu.py +8 -6
  272. tomwer/gui/reconstruction/test/test_saaxis.py +17 -15
  273. tomwer/gui/reconstruction/test/test_sadeltabeta.py +15 -13
  274. tomwer/gui/samplemoved/__init__.py +8 -7
  275. tomwer/gui/samplemoved/selectiontable.py +4 -2
  276. tomwer/gui/stackplot.py +14 -13
  277. tomwer/gui/stacks.py +11 -9
  278. tomwer/gui/test/test_axis_gui.py +5 -4
  279. tomwer/gui/test/test_qfolder_dialog.py +2 -1
  280. tomwer/gui/utils/__init__.py +5 -5
  281. tomwer/gui/utils/buttons.py +1 -0
  282. tomwer/gui/utils/completer.py +1 -0
  283. tomwer/gui/utils/flow.py +4 -2
  284. tomwer/gui/utils/illustrations.py +1 -0
  285. tomwer/gui/utils/inputwidget.py +11 -17
  286. tomwer/gui/utils/lineselector/lineselector.py +6 -8
  287. tomwer/gui/utils/qt_utils.py +1 -0
  288. tomwer/gui/utils/scandescription.py +2 -0
  289. tomwer/gui/utils/splashscreen.py +1 -1
  290. tomwer/gui/utils/unitsystem.py +3 -1
  291. tomwer/gui/utils/vignettes.py +8 -8
  292. tomwer/gui/utils/waiterthread.py +2 -1
  293. tomwer/gui/visualization/dataviewer.py +20 -28
  294. tomwer/gui/visualization/diffviewer/diffviewer.py +17 -20
  295. tomwer/gui/visualization/diffviewer/shiftwidget.py +3 -1
  296. tomwer/gui/visualization/nxtomometadata.py +1 -0
  297. tomwer/gui/visualization/reconstructionparameters.py +13 -12
  298. tomwer/gui/visualization/scanoverview.py +5 -3
  299. tomwer/gui/visualization/sinogramviewer.py +3 -2
  300. tomwer/gui/visualization/test/test_dataviewer.py +3 -1
  301. tomwer/gui/visualization/test/test_diffviewer.py +8 -6
  302. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +5 -3
  303. tomwer/gui/visualization/test/test_reconstruction_parameters.py +5 -3
  304. tomwer/gui/visualization/test/test_sinogramviewer.py +10 -9
  305. tomwer/gui/visualization/test/test_stacks.py +8 -6
  306. tomwer/gui/visualization/test/test_volumeviewer.py +10 -8
  307. tomwer/gui/visualization/tomoobjoverview.py +7 -4
  308. tomwer/gui/visualization/volumeoverview.py +5 -3
  309. tomwer/gui/visualization/volumeviewer.py +15 -14
  310. tomwer/io/utils/__init__.py +3 -3
  311. tomwer/io/utils/h5pyutils.py +2 -1
  312. tomwer/io/utils/utils.py +17 -21
  313. tomwer/resources/__init__.py +1 -1
  314. tomwer/synctools/axis.py +3 -1
  315. tomwer/synctools/darkref.py +3 -2
  316. tomwer/synctools/datalistener.py +10 -6
  317. tomwer/synctools/datatransfert.py +2 -3
  318. tomwer/synctools/imageloaderthread.py +5 -3
  319. tomwer/synctools/rsyncmanager.py +3 -2
  320. tomwer/synctools/saaxis.py +3 -1
  321. tomwer/synctools/sadeltabeta.py +3 -1
  322. tomwer/synctools/stacks/control/datalistener.py +9 -12
  323. tomwer/synctools/stacks/edit/darkflatpatch.py +13 -12
  324. tomwer/synctools/stacks/edit/imagekeyeditor.py +12 -11
  325. tomwer/synctools/stacks/processingstack.py +3 -2
  326. tomwer/synctools/stacks/reconstruction/axis.py +12 -12
  327. tomwer/synctools/stacks/reconstruction/castvolume.py +8 -5
  328. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +10 -9
  329. tomwer/synctools/stacks/reconstruction/lamino.py +9 -7
  330. tomwer/synctools/stacks/reconstruction/nabu.py +18 -17
  331. tomwer/synctools/stacks/reconstruction/normalization.py +12 -16
  332. tomwer/synctools/stacks/reconstruction/saaxis.py +13 -11
  333. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +16 -14
  334. tomwer/synctools/test/test_darkRefs.py +4 -3
  335. tomwer/synctools/test/test_foldertransfer.py +14 -12
  336. tomwer/synctools/test/test_scanstages.py +8 -7
  337. tomwer/synctools/utils/scanstages.py +7 -5
  338. tomwer/tests/conftest.py +4 -4
  339. tomwer/tests/test_scripts.py +3 -2
  340. tomwer/tests/utils/__init__.py +5 -4
  341. tomwer/tests/utils/utilstest.py +5 -6
  342. tomwer/third_party/nabu/preproc/phase.py +7 -5
  343. tomwer/third_party/nabu/utils.py +3 -2
  344. tomwer/utils.py +12 -12
  345. tomwer/version.py +4 -4
  346. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/METADATA +2 -2
  347. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/RECORD +353 -345
  348. /tomwer-1.1.1-py3.8-nspkg.pth → /tomwer-1.2.0a0-py3.8-nspkg.pth +0 -0
  349. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/LICENSE +0 -0
  350. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/WHEEL +0 -0
  351. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/entry_points.txt +0 -0
  352. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/namespace_packages.txt +0 -0
  353. {tomwer-1.1.1.dist-info → tomwer-1.2.0a0.dist-info}/top_level.txt +0 -0
@@ -31,9 +31,11 @@ __date__ = "05/04/2019"
31
31
  import shutil
32
32
  import tempfile
33
33
  import unittest
34
+
35
+ from tomwer.core.scan.scanbase import TomwerScanBase
34
36
  from tomwer.core.utils.scanutils import MockEDF
37
+
35
38
  from ..reconstruction.lamino import LaminoReconstruction
36
- from tomwer.core.scan.scanbase import TomwerScanBase
37
39
 
38
40
 
39
41
  class TestLaminoIO(unittest.TestCase):
@@ -30,17 +30,18 @@ __date__ = "14/02/2020"
30
30
  import os
31
31
  import shutil
32
32
  import tempfile
33
- from glob import glob
34
33
  import unittest
35
- from tomwer.tests.utils import UtilsTest
34
+ from glob import glob
35
+
36
+ from tomwer.core.process.reconstruction.axis import AxisRP
36
37
  from tomwer.core.process.reconstruction.nabu import nabuslices as nabu
38
+ from tomwer.core.process.reconstruction.nabu import settings as nabu_settings
37
39
  from tomwer.core.process.reconstruction.nabu import utils as nabuutils
38
- from tomwer.core.scan.scanfactory import ScanFactory
39
40
  from tomwer.core.process.reconstruction.nabu.nabuslices import NabuSliceMode
40
- from tomwer.core.utils.scanutils import MockEDF
41
41
  from tomwer.core.scan.edfscan import EDFTomoScan
42
- from tomwer.core.process.reconstruction.axis import AxisRP
43
- from tomwer.core.process.reconstruction.nabu import settings as nabu_settings
42
+ from tomwer.core.scan.scanfactory import ScanFactory
43
+ from tomwer.core.utils.scanutils import MockEDF
44
+ from tomwer.tests.utils import UtilsTest
44
45
 
45
46
 
46
47
  class TestNabuDescUtils(unittest.TestCase):
@@ -300,9 +301,9 @@ class TestTomwerConfForNabu(unittest.TestCase):
300
301
 
301
302
  def testSlices(self):
302
303
  # check if single value
303
- for slice in ("1", NabuSliceMode.MIDDLE):
304
- with self.subTest(slice=slice):
305
- self.conf["tomwer_slices"] = slice
304
+ for data_slice in ("1", NabuSliceMode.MIDDLE):
305
+ with self.subTest(data_slice=data_slice):
306
+ self.conf["tomwer_slices"] = data_slice
306
307
 
307
308
  sub_confs = nabu.interpret_tomwer_configuration(
308
309
  self.conf, scan=self.scan
@@ -312,9 +313,9 @@ class TestTomwerConfForNabu(unittest.TestCase):
312
313
  self.assertEqual(len(sub_confs), 1 + 1)
313
314
 
314
315
  # check single values or list of values
315
- for slice in ("[2, 3, 7]", "(6, 9,56)", "5;6; 9"):
316
- with self.subTest(slice=slice):
317
- self.conf["tomwer_slices"] = slice
316
+ for data_slice in ("[2, 3, 7]", "(6, 9,56)", "5;6; 9"):
317
+ with self.subTest(slice=data_slice):
318
+ self.conf["tomwer_slices"] = data_slice
318
319
 
319
320
  sub_confs = nabu.interpret_tomwer_configuration(
320
321
  self.conf, scan=self.scan
@@ -27,14 +27,16 @@ __license__ = "MIT"
27
27
  __date__ = "11/07/2021"
28
28
 
29
29
 
30
- from tomwer.core.process.reconstruction.normalization import params, normalization
31
- from tomoscan.normalization import Method
32
- from tomwer.core.utils.scanutils import MockHDF5
33
- import unittest
34
- import tempfile
35
30
  import shutil
31
+ import tempfile
32
+ import unittest
33
+
36
34
  import h5py
37
35
  import numpy
36
+ from tomoscan.normalization import Method
37
+
38
+ from tomwer.core.process.reconstruction.normalization import normalization, params
39
+ from tomwer.core.utils.scanutils import MockHDF5
38
40
 
39
41
 
40
42
  class TestNormalization(unittest.TestCase):
@@ -31,9 +31,10 @@ __date__ = "05/04/2019"
31
31
  import shutil
32
32
  import tempfile
33
33
  import unittest
34
- from tomwer.core.utils.scanutils import MockEDF
34
+
35
35
  from tomwer.core.process.control.timer import Timer
36
36
  from tomwer.core.scan.scanbase import TomwerScanBase
37
+ from tomwer.core.utils.scanutils import MockEDF
37
38
 
38
39
 
39
40
  class TestTimerIO(unittest.TestCase):
@@ -28,16 +28,18 @@ __license__ = "MIT"
28
28
  __date__ = "04/03/2019"
29
29
 
30
30
 
31
- from collections import OrderedDict
32
31
  import datetime
33
- from tomwer.core.scan.scanbase import TomwerScanBase
34
- from tomwer.core.scan.blissscan import BlissScan
32
+ import logging
33
+ import typing
34
+ from collections import OrderedDict
35
+
36
+ import h5py
35
37
  from silx.io.url import DataUrl
36
38
  from silx.io.utils import h5py_read_dataset
39
+
37
40
  from tomwer.core.process.reconstruction.scores import ComputedScore
38
- import h5py
39
- import typing
40
- import logging
41
+ from tomwer.core.scan.blissscan import BlissScan
42
+ from tomwer.core.scan.scanbase import TomwerScanBase
41
43
 
42
44
  _logger = logging.getLogger(__name__)
43
45
 
@@ -106,9 +108,7 @@ def get_scores(node: h5py.Group) -> typing.Union[None, dict]:
106
108
  )
107
109
  scores[float(res_item)] = (url, score)
108
110
  except Exception as e:
109
- _logger.warning(
110
- "Unable to load {}. Reason is {}".format(score_node.name, str(e))
111
- )
111
+ _logger.warning(f"Unable to load {score_node.name}. Reason is {e}")
112
112
  scores = dict(sorted(scores.items(), key=lambda item: item[0]))
113
113
 
114
114
  return scores
tomwer/core/progress.py CHANGED
@@ -29,9 +29,9 @@ __license__ = "MIT"
29
29
  __date__ = "07/08/2019"
30
30
 
31
31
 
32
+ import logging
32
33
  import sys
33
34
  from enum import Enum
34
- import logging
35
35
 
36
36
  _logger = logging.getLogger(__name__)
37
37
 
@@ -82,9 +82,8 @@ class Progress(object):
82
82
  def setAdvancement(self, value):
83
83
  length = 20 # modify this to change the length
84
84
  block = int(round(length * value / 100))
85
- msg = "\r{0}: [{1}] {2}%".format(
86
- self._name, "#" * block + "-" * (length - block), round(value, 2)
87
- )
85
+ blocks_str = "#" * block + "-" * (length - block)
86
+ msg = f"\r{self._name}: [{blocks_str}] {round(value, 2)}%"
88
87
  if value >= 100:
89
88
  msg += " DONE\r\n"
90
89
  sys.stdout.write(msg)
@@ -29,6 +29,7 @@ __date__ = "09/08/2018"
29
29
 
30
30
 
31
31
  import os
32
+
32
33
  import h5py
33
34
 
34
35
  try:
@@ -48,11 +49,12 @@ except ImportError:
48
49
  from nxtomomill.settings import H5_INIT_TITLES
49
50
  from nxtomomill.settings import H5_ZSERIE_INIT_TITLES
50
51
  from nxtomomill.settings import H5_PCOTOMO_INIT_TITLES
51
- from silx.io.utils import h5py_read_dataset
52
+
52
53
  import logging
53
- from tomoscan.io import HDF5File
54
54
  from typing import Optional
55
55
 
56
+ from silx.io.utils import h5py_read_dataset
57
+ from tomoscan.io import HDF5File
56
58
 
57
59
  _logger = logging.getLogger(__name__)
58
60
 
@@ -28,31 +28,34 @@ __license__ = "MIT"
28
28
  __date__ = "09/08/2018"
29
29
 
30
30
 
31
+ import functools
32
+ import logging
31
33
  import os
32
34
  import re
33
35
  from collections import OrderedDict
36
+ from glob import glob
34
37
  from math import ceil
38
+ from typing import Optional
39
+
35
40
  import fabio
36
41
  import numpy
37
- import functools
38
- import logging
42
+ from processview.core.dataset import DatasetIdentifier
43
+ from silx.io.url import DataUrl
44
+ from tomoscan.esrf.identifier.edfidentifier import (
45
+ EDFTomoScanIdentifier as _EDFTomoScanIdentifier,
46
+ )
47
+ from tomoscan.esrf.scan.edfscan import EDFTomoScan as _tsEDFTomoScan
48
+ from tomoscan.esrf.scan.utils import get_data
39
49
  from tomoscan.scanbase import FOV
50
+
40
51
  from tomwer.core.process.reconstruction.darkref.settings import (
41
- REFHST_PREFIX,
42
52
  DARKHST_PREFIX,
53
+ REFHST_PREFIX,
43
54
  )
44
55
  from tomwer.core.progress import Progress
45
- from silx.io.url import DataUrl
46
- from tomoscan.esrf.scan.utils import get_data
47
- from glob import glob
48
- from .scanbase import TomwerScanBase
49
- from tomoscan.esrf.scan.edfscan import EDFTomoScan as _tsEDFTomoScan
50
- from tomoscan.esrf.identifier.edfidentifier import (
51
- EDFTomoScanIdentifier as _EDFTomoScanIdentifier,
52
- )
53
56
  from tomwer.utils import docstring
54
- from processview.core.dataset import DatasetIdentifier
55
- from typing import Optional
57
+
58
+ from .scanbase import TomwerScanBase
56
59
 
57
60
  _logger = logging.getLogger(__name__)
58
61
 
@@ -223,8 +226,8 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
223
226
  return a dict with the index of the slice reconstructed.
224
227
  """
225
228
 
226
- def containsDigits(input):
227
- return any(char.isdigit() for char in input)
229
+ def containsDigits(input_):
230
+ return any(char.isdigit() for char in input_)
228
231
 
229
232
  if (scanID is None) or (not os.path.isdir(scanID)):
230
233
  if withIndex is True:
@@ -308,8 +311,7 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
308
311
  :rtype: numpy.array
309
312
  """
310
313
  _logger.info(
311
- "compute sinogram for line %s of %s (subsampling: %s)"
312
- % (line, self.path, subsampling)
314
+ f"compute sinogram for line {line} of {self.path} (subsampling: {subsampling})"
313
315
  )
314
316
  assert isinstance(line, int)
315
317
  if self.tomo_n is not None and self.dim_2 is not None and line > self.dim_2:
@@ -323,8 +325,7 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
323
325
  proj_sort = list(filter(lambda x: not isinstance(x, str), proj_sort))
324
326
  proj_sort.sort()
325
327
  advancement = Progress(
326
- name="compute sinogram for %s, line=%s,"
327
- "sampling=%s" % (os.path.basename(self.path), line, subsampling)
328
+ name=f"compute sinogram for {os.path.basename(self.path)}, line={line}, sampling={subsampling}"
328
329
  )
329
330
  advancement.setMaxAdvancement(len(proj_sort))
330
331
  for i_proj, proj in enumerate(proj_sort):
@@ -393,7 +394,7 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
393
394
  return None
394
395
  path = os.path.join(self.path, f)
395
396
  if os.path.exists(path):
396
- _logger.info("Getting %s from %s" % (what, f))
397
+ _logger.info(f"Getting {what} from {f}")
397
398
  try:
398
399
  data = fabio.open(path).data
399
400
  except Exception:
@@ -456,8 +457,7 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
456
457
 
457
458
  if len(oProj) > 2:
458
459
  _logger.info(
459
- "Only bordering projections (%s and %s) will "
460
- "be used for extracting %s" % (lowPI, uppPI, what)
460
+ f"Only bordering projections ({lowPI} and {uppPI}) will be used for extracting {what}"
461
461
  )
462
462
 
463
463
  uppPI = uppPI
@@ -468,15 +468,13 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
468
468
  if (index >= lowPI) is False:
469
469
  index = lowPI
470
470
  _logger.warning(
471
- "ProjectionI not in the files indexes"
472
- "range (projectionI >= lowerProjIndex)"
471
+ "ProjectionI not in the files indexes range (projectionI >= lowerProjIndex)"
473
472
  )
474
473
 
475
474
  if (index <= uppPI) is False:
476
475
  index = uppPI
477
476
  _logger.warning(
478
- "ProjectionI not in the files indexes"
479
- "range upperProjIndex >= projectionI"
477
+ "ProjectionI not in the files indexes range upperProjIndex >= projectionI"
480
478
  )
481
479
 
482
480
  # simple interpolation
@@ -524,9 +522,8 @@ class EDFTomoScan(_tsEDFTomoScan, TomwerScanBase):
524
522
  def _deduce_transfert_scan(self, output_dir):
525
523
  if os.path.basename(output_dir) != os.path.basename(self.path):
526
524
  raise ValueError(
527
- "Transfert to a new EDFTomoScan requires an "
528
- "equal basename. Current path is {}, requested "
529
- "one is {}".format(self.path, output_dir)
525
+ "Transfert to a new EDFTomoScan requires an equal basename. "
526
+ f"Current path is {self.path}, requested one is {output_dir}"
530
527
  )
531
528
  # here: avoir reloading the metadata because not sure there will be some processing after the 'data transfert'. And can be long with EDF + GPFS at esrf
532
529
  return EDFTomoScan(scan=output_dir, update=False)
@@ -1,6 +1,7 @@
1
- from tomwer.core.futureobject import TomwerScanBase
2
1
  from silx.utils.deprecation import deprecated
3
2
 
3
+ from tomwer.core.futureobject import TomwerScanBase
4
+
4
5
 
5
6
  @deprecated(replacement="TomwerScanBase", since_version="1.0")
6
7
  class FutureTomwerScan(TomwerScanBase):
@@ -28,35 +28,34 @@ __license__ = "MIT"
28
28
  __date__ = "09/08/2018"
29
29
 
30
30
 
31
- from .scanbase import TomwerScanBase
32
- from tomoscan.esrf.scan.hdf5scan import HDF5TomoScan as _tsHDF5TomoScan
33
- from tomoscan.esrf.identifier.hdf5Identifier import (
34
- HDF5TomoScanIdentifier as _HDF5TomoScanIdentifier,
35
- )
36
- from tomoscan.esrf.scan.hdf5scan import ImageKey
37
- from tomoscan.io import HDF5File
38
- from processview.core.dataset import DatasetIdentifier
39
31
  import functools
40
- import json
41
32
  import io
42
- import h5py
43
- import os
44
- from tomwer.utils import docstring
33
+ import json
45
34
  import logging
35
+ import os
46
36
  from typing import Optional
47
37
  from urllib.parse import urlparse
48
- from tomoscan.esrf.identifier.url_utils import (
49
- UrlSettings,
50
- split_path,
51
- split_query,
38
+
39
+ import h5py
40
+ from processview.core.dataset import DatasetIdentifier
41
+ from tomoscan.esrf.identifier.hdf5Identifier import (
42
+ HDF5TomoScanIdentifier as _HDF5TomoScanIdentifier,
52
43
  )
44
+ from tomoscan.esrf.identifier.url_utils import UrlSettings, split_path, split_query
45
+ from tomoscan.esrf.scan.hdf5scan import HDF5TomoScan as _tsHDF5TomoScan
46
+ from tomoscan.esrf.scan.hdf5scan import ImageKey
47
+ from tomoscan.io import HDF5File
48
+
49
+ from tomwer.utils import docstring
50
+
51
+ from .scanbase import TomwerScanBase
53
52
 
54
53
  _logger = logging.getLogger(__name__)
55
54
 
56
55
 
57
56
  class HDF5TomoScanIdentifier(_HDF5TomoScanIdentifier, DatasetIdentifier):
58
- def __init__(self, object, hdf5_file, entry):
59
- super().__init__(object, hdf5_file, entry)
57
+ def __init__(self, *args, **kwargs):
58
+ super().__init__(*args, **kwargs)
60
59
  DatasetIdentifier.__init__(self, data_builder=HDF5TomoScan.from_identifier)
61
60
 
62
61
  @staticmethod
@@ -325,9 +324,7 @@ class HDF5TomoScan(_tsHDF5TomoScan, TomwerScanBase):
325
324
  for frame in frames:
326
325
  if frame.image_key is ImageKey.PROJECTION:
327
326
  if frame.is_control:
328
- self._cache_proj_urls[
329
- "{} (1)".format(frame.rotation_angle)
330
- ] = frame.url
327
+ self._cache_proj_urls[f"{frame.rotation_angle} (1)"] = frame.url
331
328
  else:
332
329
  self._cache_proj_urls[str(frame.rotation_angle)] = frame.url
333
330
  return self._cache_proj_urls
@@ -460,16 +457,12 @@ class HDF5TomoScan(_tsHDF5TomoScan, TomwerScanBase):
460
457
  @docstring(TomwerScanBase)
461
458
  def get_nabu_dataset_info(self, binning=1, binning_z=1, proj_subsampling=1):
462
459
  if not isinstance(binning, int):
463
- raise TypeError("binning should be an int. Not {}".format(type(binning)))
460
+ raise TypeError(f"binning should be an int. Not {type(binning)}")
464
461
  if not isinstance(binning_z, int):
465
- raise TypeError(
466
- "binning_z should be an int. Not {}".format(type(binning_z))
467
- )
462
+ raise TypeError(f"binning_z should be an int. Not {type(binning_z)}")
468
463
  if not isinstance(proj_subsampling, int):
469
464
  raise TypeError(
470
- "proj_subsampling should be an int. Not {}".format(
471
- type(proj_subsampling)
472
- )
465
+ f"proj_subsampling should be an int. Not {type(proj_subsampling)}"
473
466
  )
474
467
  return {
475
468
  "hdf5_entry": self.entry,
@@ -28,29 +28,30 @@ __license__ = "MIT"
28
28
  __date__ = "09/08/2018"
29
29
 
30
30
 
31
- import numpy
32
- import logging
33
- import typing
34
- import json
35
31
  import io
32
+ import json
33
+ import logging
36
34
  import os
35
+ import typing
37
36
  from glob import glob
37
+ from typing import Optional
38
+
39
+ import numpy
38
40
  from silx.io.url import DataUrl
39
- from tomwer.core.tomwer_object import TomwerObject
40
- from tomwer.core.utils.locker import FileLockerManager, FileLockerContext
41
- from tomwer.core.utils.ftseriesutils import orderFileByLastLastModification
42
- from tomoscan.normalization import IntensityNormalization
43
- from tomoscan.io import HDF5File
41
+ from silx.utils.enum import Enum as _Enum
44
42
  from tomoscan.identifier import VolumeIdentifier
43
+ from tomoscan.io import HDF5File
44
+ from tomoscan.normalization import IntensityNormalization
45
45
  from tomoscan.volumebase import VolumeBase
46
- from typing import Optional
47
- from silx.utils.enum import Enum as _Enum
48
- from tomwer.core.volume.hdf5volume import HDF5Volume
46
+
47
+ from tomwer.core.tomwer_object import TomwerObject
48
+ from tomwer.core.utils.ftseriesutils import orderFileByLastLastModification
49
+ from tomwer.core.utils.locker import FileLockerContext, FileLockerManager
49
50
  from tomwer.core.volume.edfvolume import EDFVolume
51
+ from tomwer.core.volume.hdf5volume import HDF5Volume
50
52
  from tomwer.core.volume.jp2kvolume import JP2KVolume
51
53
  from tomwer.core.volume.tiffvolume import MultiTIFFVolume
52
54
 
53
-
54
55
  logger = logging.getLogger(__name__)
55
56
 
56
57
 
@@ -327,10 +328,10 @@ class TomwerScanBase(TomwerObject):
327
328
  del self._cache_radio_axis[(mode, nearest)]
328
329
 
329
330
  def compute():
331
+ from ..process.reconstruction.axis.anglemode import CorAngleMode
330
332
  from ..process.reconstruction.axis.params import (
331
333
  AxisResource,
332
334
  ) # avoid cyclic import
333
- from ..process.reconstruction.axis.anglemode import CorAngleMode
334
335
 
335
336
  _mode = CorAngleMode.from_value(mode)
336
337
  if self.path is None: # pylint: disable=E1101
@@ -759,8 +760,7 @@ class TomwerScanBase(TomwerObject):
759
760
  if len(indexes) > 0:
760
761
  self._process_index = max(indexes) + 1
761
762
  logger.debug(
762
- "set process_index from tomwer process file"
763
- "to {}".format(self._process_index)
763
+ f"set process_index from tomwer process file to {self._process_index}"
764
764
  )
765
765
 
766
766
  def get_nabu_dataset_info(self, binning=1, binning_z=1, proj_subsampling=1):
@@ -790,8 +790,8 @@ class _TomwerBaseDock(object):
790
790
  return self.__instance
791
791
 
792
792
 
793
- def _containsDigits(input):
794
- return any(char.isdigit() for char in input)
793
+ def _containsDigits(input_):
794
+ return any(char.isdigit() for char in input_)
795
795
 
796
796
 
797
797
  def _get_reconstructed_single_file_volume(
@@ -28,22 +28,25 @@ __license__ = "MIT"
28
28
  __date__ = "27/02/2019"
29
29
 
30
30
 
31
+ import glob
32
+ import logging
33
+ import os
34
+ from typing import Union
35
+ from urllib.parse import urlparse
36
+
31
37
  import h5py
32
- from tomoscan.scanbase import TomoScanBase
33
- from tomoscan.factory import Factory as _oScanFactory
38
+ from tomoscan.esrf.identifier.url_utils import split_path
34
39
  from tomoscan.esrf.scan.hdf5scan import HDF5TomoScan as _oHDF5TomoScan
40
+ from tomoscan.factory import Factory as _oScanFactory
35
41
  from tomoscan.identifier import BaseIdentifier, ScanIdentifier, VolumeIdentifier
42
+ from tomoscan.scanbase import TomoScanBase
36
43
  from tomoscan.tomoobject import TomoObject
44
+
37
45
  from tomwer.utils import docstring
38
- from typing import Union
46
+
47
+ from .blissscan import BlissScan
39
48
  from .edfscan import EDFTomoScan, EDFTomoScanIdentifier
40
49
  from .hdf5scan import HDF5TomoScan, HDF5TomoScanIdentifier
41
- from .blissscan import BlissScan
42
- import os
43
- import glob
44
- import logging
45
- from urllib.parse import urlparse
46
- from tomoscan.esrf.identifier.url_utils import split_path
47
50
 
48
51
  _logger = logging.getLogger(__name__)
49
52
 
@@ -140,9 +143,8 @@ class ScanFactory(object):
140
143
  entry = valid_entries[-1]
141
144
  elif entry not in valid_entries:
142
145
  raise ValueError(
143
- "entry {} is invalid. Does it exists ? Is the "
144
- "file NXTomo compliant ?. Valid entry are {}"
145
- "".format(entry, valid_entries)
146
+ f"entry {entry} is invalid. Does it exists ? Is the "
147
+ f"file NXTomo compliant ?. Valid entry are {valid_entries}"
146
148
  )
147
149
  return HDF5TomoScan(scan=scan_path, entry=entry)
148
150
  elif ScanFactory.is_edf_tomo(scan_path):
@@ -152,13 +154,12 @@ class ScanFactory(object):
152
154
  valid_entries = BlissScan.get_valid_entries(scan_path)
153
155
  if len(valid_entries) > 1:
154
156
  _logger.warning(
155
- "more than one entry found for %s."
156
- "Pick the last entry" % scan_path
157
+ f"more than one entry found for {scan_path}. Pick the last entry"
157
158
  )
158
159
  entry = valid_entries[-1]
159
160
  return BlissScan(master_file=scan_path, entry=entry, proposal_file=None)
160
161
 
161
- raise ValueError("Unable to generate a scan object from %s" % scan_path)
162
+ raise ValueError(f"Unable to generate a scan object from {scan_path}")
162
163
 
163
164
  @docstring(_oScanFactory.create_scan_objects)
164
165
  @staticmethod
@@ -183,9 +184,9 @@ class ScanFactory(object):
183
184
  return tuple()
184
185
 
185
186
  @staticmethod
186
- def mock_scan(type="edf"):
187
+ def mock_scan(type_="edf"):
187
188
  """Mock a scan structure which is not associated to any real acquistion"""
188
- if type == "edf":
189
+ if type_ == "edf":
189
190
  return EDFTomoScan(scan=None)
190
191
  else:
191
192
  raise NotImplementedError("Other TomoScan are not defined yet")
@@ -194,9 +195,7 @@ class ScanFactory(object):
194
195
  def create_scan_object_frm_dict(_dict):
195
196
  if TomoScanBase.DICT_TYPE_KEY not in _dict:
196
197
  raise ValueError(
197
- "given dict is not recognized. Cannot find {}".format(
198
- TomoScanBase.DICT_TYPE_KEY
199
- )
198
+ f"given dict is not recognized. Cannot find {TomoScanBase.DICT_TYPE_KEY}"
200
199
  )
201
200
  elif _dict[TomoScanBase.DICT_TYPE_KEY] == EDFTomoScan._TYPE:
202
201
  return EDFTomoScan(scan=None).load_from_dict(_dict)
@@ -204,7 +203,7 @@ class ScanFactory(object):
204
203
  return HDF5TomoScan.from_dict(_dict)
205
204
  else:
206
205
  raise ValueError(
207
- "Scan type {} is not managed".format(_dict[TomoScanBase.DICT_TYPE_KEY])
206
+ f"Scan type {_dict[TomoScanBase.DICT_TYPE_KEY]} is not managed"
208
207
  )
209
208
 
210
209
  @staticmethod
@@ -0,0 +1,7 @@
1
+ from silx.utils.enum import Enum as _Enum
2
+
3
+
4
+ class ScanType(_Enum):
5
+ BLISS = "bliss-hdf5"
6
+ SPEC = "spec-edf"
7
+ NX_TOMO = "NXtomo"
@@ -29,9 +29,10 @@ __license__ = "MIT"
29
29
  __date__ = "23/11/2021"
30
30
 
31
31
 
32
+ import os
33
+
32
34
  from tomwer.core.scan.edfscan import EDFTomoScan
33
35
  from tomwer.core.utils.scanutils import MockEDF
34
- import os
35
36
 
36
37
 
37
38
  def test_scan_dir(tmpdir):
@@ -30,9 +30,10 @@ __date__ = "04/11/2021"
30
30
 
31
31
 
32
32
  import asyncio
33
+ import os
34
+
33
35
  from tomwer.core.futureobject import FutureTomwerObject
34
36
  from tomwer.core.utils.scanutils import MockHDF5
35
- import os
36
37
 
37
38
 
38
39
  def test_simple_future_tomo_obj(tmpdir):
@@ -28,14 +28,15 @@ __authors__ = ["H. Payno"]
28
28
  __license__ = "MIT"
29
29
  __date__ = "16/09/2019"
30
30
 
31
- import unittest
32
- import shutil
33
31
  import os
32
+ import shutil
34
33
  import tempfile
35
- from tomwer.tests.utils import UtilsTest
36
- from tomwer.core.scan.hdf5scan import HDF5TomoScan
34
+ import unittest
35
+
37
36
  from tomwer.core.process.reconstruction.darkref.darkrefs import DarkRefs
37
+ from tomwer.core.scan.hdf5scan import HDF5TomoScan
38
38
  from tomwer.core.utils.scanutils import MockHDF5
39
+ from tomwer.tests.utils import UtilsTest
39
40
 
40
41
 
41
42
  class TestHDF5Scan(unittest.TestCase):
@@ -28,12 +28,14 @@ __license__ = "MIT"
28
28
  __date__ = "02/09/2020"
29
29
 
30
30
 
31
+ import shutil
32
+ import tempfile
31
33
  import unittest
34
+
35
+ from tomoscan.io import HDF5File
36
+
32
37
  from tomwer.core.process.task import Task
33
38
  from tomwer.core.utils.scanutils import MockHDF5
34
- import tempfile
35
- import shutil
36
- from tomoscan.io import HDF5File
37
39
 
38
40
 
39
41
  class TestProcessRegistration(unittest.TestCase):