tomwer 1.2.1__py3-none-any.whl → 1.3.12__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 (334) hide show
  1. orangecontrib/tomwer/tutorials/icat_publication.ows +58 -0
  2. orangecontrib/tomwer/widgets/__init__.py +11 -11
  3. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
  4. orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
  5. orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
  6. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
  7. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
  8. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +24 -7
  9. orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
  10. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
  11. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +64 -23
  12. orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +20 -8
  13. orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
  14. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
  15. orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
  16. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
  17. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +5 -5
  18. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
  19. orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
  20. orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +8 -1
  21. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
  22. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
  23. orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
  24. orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
  25. orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
  26. orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
  27. orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
  28. orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
  29. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
  30. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
  31. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
  32. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
  33. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
  34. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
  35. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +22 -20
  36. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +19 -3
  37. orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +184 -169
  38. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
  39. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
  40. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +18 -22
  41. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +18 -26
  42. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +15 -19
  43. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
  44. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  45. orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
  46. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
  47. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
  48. orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
  49. tomwer/__main__.py +7 -64
  50. tomwer/app/axis.py +3 -3
  51. tomwer/app/canvas.py +8 -0
  52. tomwer/app/canvas_launcher/config.py +16 -14
  53. tomwer/app/canvas_launcher/environ.py +1 -0
  54. tomwer/app/canvas_launcher/mainwindow.py +4 -1
  55. tomwer/app/darkref.py +1 -1
  56. tomwer/app/darkrefpatch.py +1 -1
  57. tomwer/app/diffframe.py +3 -3
  58. tomwer/app/imagekeyeditor.py +5 -5
  59. tomwer/app/imagekeyupgrader.py +5 -5
  60. tomwer/app/intensitynormalization.py +14 -13
  61. tomwer/app/{saaxis.py → multicor.py} +3 -3
  62. tomwer/app/{sadeltabeta.py → multipag.py} +3 -3
  63. tomwer/app/nabuapp.py +0 -11
  64. tomwer/app/radiostack.py +6 -4
  65. tomwer/app/samplemoved.py +3 -2
  66. tomwer/app/scanviewer.py +4 -2
  67. tomwer/app/sinogramviewer.py +3 -2
  68. tomwer/app/slicestack.py +3 -2
  69. tomwer/app/zstitching.py +88 -6
  70. tomwer/core/cluster/cluster.py +26 -0
  71. tomwer/core/log/logger.py +7 -5
  72. tomwer/core/process/conditions/filters.py +1 -1
  73. tomwer/core/process/control/datalistener/datalistener.py +19 -14
  74. tomwer/core/process/control/datawatcher/edfdwprocess.py +0 -9
  75. tomwer/core/process/control/nxtomoconcatenate.py +13 -13
  76. tomwer/core/process/control/nxtomomill.py +92 -34
  77. tomwer/core/process/control/scantransfer.py +20 -43
  78. tomwer/core/process/control/scanvalidator.py +3 -2
  79. tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
  80. tomwer/core/process/control/test/test_email.py +4 -4
  81. tomwer/core/process/control/test/test_h52nx_process.py +59 -7
  82. tomwer/core/process/control/test/test_volume_link.py +64 -64
  83. tomwer/core/process/control/timer.py +1 -1
  84. tomwer/core/process/control/volumesymlink.py +200 -200
  85. tomwer/core/process/edit/darkflatpatch.py +14 -15
  86. tomwer/core/process/edit/imagekeyeditor.py +41 -39
  87. tomwer/core/process/icat/__init__.py +0 -0
  88. tomwer/core/process/icat/createscreenshots.py +100 -0
  89. tomwer/core/process/icat/gallery.py +377 -0
  90. tomwer/core/process/icat/icatbase.py +36 -0
  91. tomwer/core/process/icat/publish.py +228 -0
  92. tomwer/core/process/icat/screenshots.py +27 -0
  93. tomwer/core/process/output.py +52 -0
  94. tomwer/core/process/reconstruction/axis/axis.py +280 -69
  95. tomwer/core/process/reconstruction/axis/mode.py +163 -48
  96. tomwer/core/process/reconstruction/axis/params.py +29 -21
  97. tomwer/core/process/reconstruction/darkref/darkrefs.py +41 -127
  98. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +4 -3
  99. tomwer/core/process/reconstruction/darkref/params.py +1 -1
  100. tomwer/core/process/reconstruction/nabu/castvolume.py +4 -4
  101. tomwer/core/process/reconstruction/nabu/helical.py +9 -5
  102. tomwer/core/process/reconstruction/nabu/nabucommon.py +71 -78
  103. tomwer/core/process/reconstruction/nabu/nabuscores.py +425 -53
  104. tomwer/core/process/reconstruction/nabu/nabuslices.py +114 -93
  105. tomwer/core/process/reconstruction/nabu/nabuvolume.py +54 -27
  106. tomwer/core/process/reconstruction/nabu/plane.py +9 -0
  107. tomwer/core/process/reconstruction/nabu/settings.py +2 -2
  108. tomwer/core/process/reconstruction/nabu/utils.py +164 -26
  109. tomwer/core/process/reconstruction/output.py +108 -0
  110. tomwer/core/process/reconstruction/saaxis/saaxis.py +238 -264
  111. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +151 -87
  112. tomwer/core/process/reconstruction/scores/params.py +7 -4
  113. tomwer/core/process/reconstruction/scores/scores.py +13 -0
  114. tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
  115. tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
  116. tomwer/core/process/reconstruction/test/test_darkref_copy.py +7 -7
  117. tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
  118. tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
  119. tomwer/core/process/stitching/nabustitcher.py +13 -12
  120. tomwer/core/process/task.py +34 -26
  121. tomwer/core/process/test/test_axis.py +13 -12
  122. tomwer/core/process/test/test_dark_and_flat.py +10 -7
  123. tomwer/core/process/test/test_data_transfer.py +10 -8
  124. tomwer/core/process/test/test_nabu.py +14 -6
  125. tomwer/core/process/test/test_normalization.py +4 -4
  126. tomwer/core/scan/blissscan.py +3 -3
  127. tomwer/core/scan/edfscan.py +13 -10
  128. tomwer/core/scan/hdf5scan.py +19 -530
  129. tomwer/core/scan/nxtomoscan.py +534 -0
  130. tomwer/core/scan/scanbase.py +72 -44
  131. tomwer/core/scan/scanfactory.py +13 -13
  132. tomwer/core/scan/test/test_edf.py +2 -2
  133. tomwer/core/scan/test/test_future_scan.py +3 -3
  134. tomwer/core/scan/test/test_h5.py +18 -16
  135. tomwer/core/scan/test/test_process_registration.py +4 -40
  136. tomwer/core/scan/test/test_scan.py +5 -78
  137. tomwer/core/settings.py +22 -2
  138. tomwer/core/test/test_scanutils.py +8 -7
  139. tomwer/core/test/test_utils.py +35 -28
  140. tomwer/core/tomwer_object.py +1 -1
  141. tomwer/core/utils/__init__.py +0 -466
  142. tomwer/core/utils/deprecation.py +1 -1
  143. tomwer/core/utils/dictutils.py +14 -0
  144. tomwer/core/utils/lbsram.py +35 -0
  145. tomwer/core/utils/nxtomoutils.py +1 -1
  146. tomwer/core/utils/scanutils.py +6 -6
  147. tomwer/core/utils/spec.py +263 -0
  148. tomwer/core/volume/edfvolume.py +6 -6
  149. tomwer/core/volume/hdf5volume.py +6 -6
  150. tomwer/core/volume/jp2kvolume.py +6 -6
  151. tomwer/core/volume/rawvolume.py +6 -6
  152. tomwer/core/volume/tiffvolume.py +12 -12
  153. tomwer/core/volume/volumefactory.py +2 -2
  154. tomwer/gui/cluster/slurm.py +274 -65
  155. tomwer/gui/cluster/supervisor.py +12 -0
  156. tomwer/gui/cluster/test/test_cluster.py +14 -2
  157. tomwer/gui/cluster/test/test_supervisor.py +3 -3
  158. tomwer/gui/configuration/__init__.py +0 -0
  159. tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
  160. tomwer/gui/configuration/level.py +22 -0
  161. tomwer/gui/control/actions.py +54 -0
  162. tomwer/gui/control/datalist.py +83 -16
  163. tomwer/gui/control/datalistener.py +4 -16
  164. tomwer/gui/control/datawatcher/controlwidget.py +2 -4
  165. tomwer/gui/control/datawatcher/datawatcher.py +1 -24
  166. tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
  167. tomwer/gui/control/history.py +2 -2
  168. tomwer/gui/control/observations.py +2 -2
  169. tomwer/gui/control/reducedarkflatselector.py +9 -9
  170. tomwer/gui/control/selectorwidgetbase.py +36 -9
  171. tomwer/gui/control/serie/seriecreator.py +5 -22
  172. tomwer/gui/control/test/test_email.py +1 -1
  173. tomwer/gui/control/test/test_scanvalidator.py +6 -5
  174. tomwer/gui/control/test/test_single_tomo_obj.py +3 -3
  175. tomwer/gui/control/tomoobjdisplaymode.py +8 -0
  176. tomwer/gui/debugtools/datasetgenerator.py +3 -3
  177. tomwer/gui/edit/dkrfpatch.py +20 -26
  178. tomwer/gui/edit/imagekeyeditor.py +11 -12
  179. tomwer/gui/edit/nxtomoeditor.py +111 -44
  180. tomwer/gui/edit/nxtomowarmer.py +7 -6
  181. tomwer/gui/edit/test/test_dkrf_patch.py +13 -13
  182. tomwer/gui/edit/test/test_image_key_editor.py +3 -3
  183. tomwer/gui/edit/test/test_nx_editor.py +40 -16
  184. tomwer/gui/icat/__init__.py +0 -0
  185. tomwer/gui/icat/createscreenshots.py +80 -0
  186. tomwer/gui/icat/gallery.py +214 -0
  187. tomwer/gui/icat/publish.py +187 -0
  188. tomwer/gui/imagefromfile.py +2 -2
  189. tomwer/gui/qfolderdialog.py +24 -1
  190. tomwer/gui/reconstruction/axis/CompareImages.py +88 -168
  191. tomwer/gui/reconstruction/axis/axis.py +171 -57
  192. tomwer/gui/reconstruction/axis/radioaxis.py +122 -257
  193. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
  194. tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
  195. tomwer/gui/reconstruction/nabu/castvolume.py +14 -3
  196. tomwer/gui/reconstruction/nabu/check.py +9 -9
  197. tomwer/gui/reconstruction/nabu/helical.py +29 -12
  198. tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
  199. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +2 -1
  200. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +126 -35
  201. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +39 -32
  202. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +222 -31
  203. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +57 -27
  204. tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
  205. tomwer/gui/reconstruction/nabu/slices.py +10 -11
  206. tomwer/gui/reconstruction/nabu/volume.py +22 -10
  207. tomwer/gui/reconstruction/normalization/intensity.py +18 -48
  208. tomwer/gui/reconstruction/saaxis/corrangeselector.py +8 -24
  209. tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
  210. tomwer/gui/reconstruction/saaxis/saaxis.py +9 -21
  211. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +45 -12
  212. tomwer/gui/reconstruction/scores/control.py +2 -9
  213. tomwer/gui/reconstruction/scores/scoreplot.py +13 -11
  214. tomwer/gui/reconstruction/test/test_axis.py +41 -16
  215. tomwer/gui/reconstruction/test/test_nabu.py +31 -9
  216. tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
  217. tomwer/gui/reconstruction/test/test_sadeltabeta.py +12 -2
  218. tomwer/gui/settings.py +5 -28
  219. tomwer/gui/stackplot.py +2 -5
  220. tomwer/gui/stitching/action.py +49 -0
  221. tomwer/gui/stitching/config/axisparams.py +7 -24
  222. tomwer/gui/stitching/config/output.py +10 -8
  223. tomwer/gui/stitching/config/positionoveraxis.py +22 -23
  224. tomwer/gui/stitching/normalization.py +117 -0
  225. tomwer/gui/stitching/stitchandbackground.py +4 -6
  226. tomwer/gui/stitching/stitching.py +267 -45
  227. tomwer/gui/stitching/stitching_preview.py +62 -55
  228. tomwer/gui/stitching/stitching_raw.py +13 -12
  229. tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
  230. tomwer/gui/utils/buttons.py +112 -29
  231. tomwer/gui/utils/inputwidget.py +43 -25
  232. tomwer/gui/utils/lineselector/lineselector.py +1 -1
  233. tomwer/gui/utils/scandescription.py +4 -0
  234. tomwer/gui/utils/step.py +144 -0
  235. tomwer/gui/utils/unitsystem.py +2 -5
  236. tomwer/gui/utils/vignettes.py +176 -15
  237. tomwer/gui/visualization/dataviewer.py +48 -35
  238. tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
  239. tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
  240. tomwer/gui/visualization/scanoverview.py +1 -1
  241. tomwer/gui/visualization/sinogramviewer.py +20 -36
  242. tomwer/gui/visualization/test/test_diffviewer.py +3 -3
  243. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
  244. tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
  245. tomwer/gui/visualization/test/test_stacks.py +3 -3
  246. tomwer/gui/visualization/test/test_volumeviewer.py +65 -67
  247. tomwer/gui/visualization/volumeviewer.py +114 -113
  248. tomwer/io/utils/h5pyutils.py +3 -3
  249. tomwer/io/utils/raw_and_processed_data.py +84 -0
  250. tomwer/io/utils/tomoobj.py +4 -6
  251. tomwer/io/utils/utils.py +7 -7
  252. tomwer/resources/gui/icons/parameters.svg +1 -1
  253. tomwer/resources/gui/icons/ruler.png +0 -0
  254. tomwer/resources/gui/icons/ruler.svg +273 -0
  255. tomwer/resources/gui/icons/short_description.png +0 -0
  256. tomwer/resources/gui/icons/short_description.svg +58 -0
  257. tomwer/resources/gui/icons/url.png +0 -0
  258. tomwer/resources/gui/icons/url.svg +58 -0
  259. tomwer/resources/gui/illustrations/no_rot.svg +1 -1
  260. tomwer/synctools/stacks/edit/darkflatpatch.py +19 -14
  261. tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
  262. tomwer/synctools/stacks/reconstruction/axis.py +4 -4
  263. tomwer/synctools/stacks/reconstruction/castvolume.py +22 -7
  264. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +25 -20
  265. tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
  266. tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
  267. tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
  268. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
  269. tomwer/synctools/test/test_darkRefs.py +7 -58
  270. tomwer/synctools/test/test_foldertransfer.py +6 -6
  271. tomwer/synctools/utils/scanstages.py +6 -6
  272. tomwer/tests/conftest.py +34 -0
  273. tomwer/tests/datasets.py +13 -0
  274. tomwer/tests/test_scripts.py +91 -41
  275. tomwer/tests/utils.py +5 -0
  276. tomwer/third_part/WaitingOverlay.py +110 -0
  277. tomwer/third_part/__init__.py +0 -0
  278. tomwer/version.py +2 -2
  279. tomwer-1.3.12-py3.11-nspkg.pth +1 -0
  280. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/METADATA +73 -58
  281. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/RECORD +287 -286
  282. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/WHEEL +1 -1
  283. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
  284. orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
  285. orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
  286. orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
  287. tomwer/app/lamino.py +0 -143
  288. tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
  289. tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
  290. tomwer/core/process/test/test_lamino.py +0 -76
  291. tomwer/core/test/test_lamino.py +0 -92
  292. tomwer/gui/reconstruction/lamino/__init__.py +0 -31
  293. tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
  294. tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
  295. tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
  296. tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
  297. tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
  298. tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
  299. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
  300. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -760
  301. tomwer/gui/reconstruction/test/test_lamino.py +0 -189
  302. tomwer/resources/gui/icons/esrf_1.svg +0 -307
  303. tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
  304. tomwer/resources/gui/icons/triangle.svg +0 -80
  305. tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
  306. tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
  307. tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
  308. tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
  309. tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
  310. tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
  311. tomwer/resources/gui/illustrations/manual_slice.png +0 -0
  312. tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
  313. tomwer/resources/gui/illustrations/psi_angle.png +0 -0
  314. tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
  315. tomwer/resources/gui/illustrations/rotation_center.png +0 -0
  316. tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
  317. tomwer/resources/gui/illustrations/slice_stack.png +0 -0
  318. tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
  319. tomwer/resources/gui/illustrations/xy_slice.png +0 -0
  320. tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
  321. tomwer/resources/gui/illustrations/xz_slice.png +0 -0
  322. tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
  323. tomwer/resources/gui/illustrations/yz_slice.png +0 -0
  324. tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
  325. tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
  326. tomwer/synctools/test/test_scanstages.py +0 -162
  327. tomwer/tests/utils/__init__.py +0 -247
  328. tomwer/tests/utils/utilstest.py +0 -220
  329. tomwer-1.2.1-py3.11-nspkg.pth +0 -1
  330. /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
  331. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/LICENSE +0 -0
  332. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/entry_points.txt +0 -0
  333. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/namespace_packages.txt +0 -0
  334. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/top_level.txt +0 -0
@@ -40,10 +40,12 @@ import functools
40
40
  import numpy
41
41
  from silx.io.url import DataUrl
42
42
  from silx.utils.enum import Enum as _Enum
43
+ from silx.io.utils import open as open_hdf5
44
+
43
45
  from tomoscan.identifier import VolumeIdentifier
44
- from tomoscan.io import HDF5File
45
46
  from tomoscan.normalization import IntensityNormalization
46
47
  from tomoscan.volumebase import VolumeBase
48
+ from tomoscan.identifier import BaseIdentifier
47
49
 
48
50
  from tomwer.core.tomwer_object import TomwerObject
49
51
  from tomwer.core.utils.ftseriesutils import orderFileByLastLastModification
@@ -64,8 +66,6 @@ class TomwerScanBase(TomwerObject):
64
66
 
65
67
  _DICT_DARK_REF_KEYS = "dark_ref_params"
66
68
 
67
- _DICT_LAMINO_RP_KEY = "lamino_params"
68
-
69
69
  _DICT_NABU_RP_KEY = "nabu_params"
70
70
 
71
71
  _DICT_AXIS_KEYS = "axis_params"
@@ -87,8 +87,6 @@ class TomwerScanBase(TomwerObject):
87
87
 
88
88
  self._nabu_params = None
89
89
  """nabu reconstruction parameters"""
90
- self._lamino_params = None
91
- """Set of reconstructions parameters for laminography"""
92
90
  self._axis_params = None
93
91
  """Axis parameters"""
94
92
  self._saaxis_params = None
@@ -113,6 +111,7 @@ class TomwerScanBase(TomwerObject):
113
111
  self._latest_vol_reconstructions = []
114
112
  """list of url related to latest volume reconstruction from nabu"""
115
113
  self._reconstruction_paths = set()
114
+ self._proposal_name = None
116
115
 
117
116
  def _clear_heavy_cache(self):
118
117
  """For scan for now we don't want to remove any information from the cache.
@@ -133,7 +132,7 @@ class TomwerScanBase(TomwerObject):
133
132
  and self.process_file is not None
134
133
  and os.path.exists(self.process_file)
135
134
  ):
136
- with HDF5File(self.process_file, mode="r", swmr=True) as h5s:
135
+ with open_hdf5(self.process_file) as h5s:
137
136
  self._process_index = len(h5s.items())
138
137
  else:
139
138
  self._process_index = 0
@@ -166,7 +165,7 @@ class TomwerScanBase(TomwerObject):
166
165
 
167
166
  if dark is None:
168
167
  if self._notify_ffc_rsc_missing:
169
- logger.error("cannot make flat field correction, dark not found")
168
+ logger.warning("cannot make flat field correction, dark not found")
170
169
  can_process = False
171
170
 
172
171
  if dark is not None and dark.ndim != 2:
@@ -177,7 +176,7 @@ class TomwerScanBase(TomwerObject):
177
176
 
178
177
  if flat1 is None:
179
178
  if self._notify_ffc_rsc_missing:
180
- logger.error("cannot make flat field correction, flat not found")
179
+ logger.warning("cannot make flat field correction, flat not found")
181
180
  can_process = False
182
181
  else:
183
182
  if flat1.ndim != 2:
@@ -251,14 +250,6 @@ class TomwerScanBase(TomwerObject):
251
250
  def nabu_recons_params(self, recons_params):
252
251
  self._nabu_params = recons_params
253
252
 
254
- @property
255
- def lamino_recons_params(self):
256
- return self._lamino_params
257
-
258
- @lamino_recons_params.setter
259
- def lamino_recons_params(self, recons_params):
260
- self._lamino_params = recons_params
261
-
262
253
  @property
263
254
  def axis_params(self):
264
255
  return self._axis_params
@@ -446,8 +437,6 @@ class TomwerScanBase(TomwerObject):
446
437
  # process index
447
438
  res[self._DICT_PROCESS_INDEX_KEY] = self._process_index
448
439
 
449
- # lamino reconstruction parameters
450
- res[self._DICT_LAMINO_RP_KEY] = self.lamino_recons_params
451
440
  return res
452
441
 
453
442
  def load_from_dict(self, desc):
@@ -466,8 +455,6 @@ class TomwerScanBase(TomwerObject):
466
455
  raise ValueError("Description is not an EDFScan json description")
467
456
 
468
457
  assert self.DICT_PATH_KEY in data # pylint: disable=E1101
469
- assert self._DICT_LAMINO_RP_KEY in data
470
- self.lamino_recons_params = data[self._DICT_LAMINO_RP_KEY]
471
458
  # load axis reconstruction parameters
472
459
  axis_params = data.get(self._DICT_AXIS_KEYS, None)
473
460
  if axis_params is not None:
@@ -518,7 +505,6 @@ class TomwerScanBase(TomwerObject):
518
505
  isinstance(other, self.__class__)
519
506
  or isinstance(self, other.__class__)
520
507
  and self.type == other.type # pylint: disable=E1101
521
- and self.lamino_recons_params == other.lamino_recons_params
522
508
  and self.nabu_recons_params == other.nabu_recons_params
523
509
  and self.path == other.path # pylint: disable=E1101
524
510
  )
@@ -600,8 +586,19 @@ class TomwerScanBase(TomwerObject):
600
586
  :return: list of urls that contains reconstruction from nabu
601
587
  :rtype: list
602
588
  """
589
+ from tomwer.core.process.reconstruction.output import (
590
+ PROCESS_FOLDER_NAME,
591
+ ) # avoid cyclic import
592
+
603
593
  all_recons_urls = set()
604
594
  recons_paths = self.reconstruction_paths
595
+ if self.working_directory:
596
+ recons_paths.add(
597
+ os.path.join(
598
+ self.working_directory,
599
+ PROCESS_FOLDER_NAME,
600
+ )
601
+ )
605
602
  for path in recons_paths:
606
603
  all_recons_urls.update(self.get_reconstructions_urls_from_path(path))
607
604
  return all_recons_urls
@@ -610,6 +607,17 @@ class TomwerScanBase(TomwerObject):
610
607
  if path is None or not os.path.isdir(path):
611
608
  return []
612
609
  else:
610
+
611
+ from tomwer.core.process.reconstruction.saaxis.saaxis import (
612
+ DEFAULT_RECONS_FOLDER as MULTI_COR_DEFAULT_FOLDER,
613
+ )
614
+ from tomwer.core.process.reconstruction.sadeltabeta.sadeltabeta import (
615
+ DEFAULT_RECONS_FOLDER as MULTI_DB_DEFAULT_FOLDER,
616
+ )
617
+ from tomwer.core.process.reconstruction.nabu.settings import (
618
+ NABU_CFG_FILE_FOLDER,
619
+ )
620
+
613
621
  res = set()
614
622
  for f in os.listdir(path):
615
623
  current_path = os.path.join(path, f)
@@ -624,10 +632,10 @@ class TomwerScanBase(TomwerObject):
624
632
  f
625
633
  in (
626
634
  "matlab",
627
- "saaxis_results",
628
- "sadeltabeta_results",
629
635
  "steps_file_basename_nabu_sinogram_save_step",
630
- "nabu_cfg_files",
636
+ MULTI_COR_DEFAULT_FOLDER,
637
+ MULTI_DB_DEFAULT_FOLDER,
638
+ NABU_CFG_FILE_FOLDER,
631
639
  )
632
640
  or f.endswith("_vol")
633
641
  or "slice" not in f
@@ -681,29 +689,43 @@ class TomwerScanBase(TomwerObject):
681
689
  f"url should be a {VolumeIdentifier} or a string reprenseting a {VolumeIdentifier}. {type(url)} provided instead"
682
690
  )
683
691
 
684
- def set_latest_vol_reconstructions(self, urls: typing.Iterable):
685
- if urls is None:
692
+ def set_latest_vol_reconstructions(self, volume_identifiers: typing.Iterable):
693
+ if volume_identifiers is None:
686
694
  self._latest_vol_reconstructions = None
687
695
  else:
688
696
  self._latest_vol_reconstructions = list(
689
- [self._process_volume_url(url) for url in urls]
697
+ [self._process_volume_url(url) for url in volume_identifiers]
690
698
  )
691
699
 
692
- def add_latest_vol_reconstructions(self, urls):
693
- self._latest_vol_reconstructions.extend(urls)
694
-
695
- def _update_latest_recons_urls(self, old_path, new_path):
696
- new_urls = []
697
- for recons_url in self._latest_reconstructions:
698
- new_urls.append(
699
- DataUrl(
700
- file_path=recons_url.path().replace(old_path, new_path, 1),
701
- data_path=recons_url.data_path(),
702
- data_slice=recons_url.data_slice(),
703
- scheme=recons_url.scheme(),
704
- )
705
- )
706
- self._latest_reconstructions = new_urls
700
+ def add_latest_vol_reconstructions(self, volume_identifiers: tuple):
701
+ assert isinstance(
702
+ volume_identifiers, tuple
703
+ ), "volume_identifiers is expected to be a tuple"
704
+ self._latest_vol_reconstructions.extend(
705
+ self._process_volume_url(volume_identifier)
706
+ for volume_identifier in volume_identifiers
707
+ )
708
+
709
+ def _update_latest_recons_identifiers(self, old_path, new_path):
710
+ def update_identifier(identifier):
711
+ assert isinstance(
712
+ identifier, BaseIdentifier
713
+ ), f"identifier is expected to be an instance of {BaseIdentifier}"
714
+ # small hack as this is not much used: simply try to replace a path by another. this is only used by the data transfer and EDF / SPEC
715
+ # this time is almost over
716
+ # FIXME: correct way to do this would be to recreate the volume, modify file or folder path and
717
+ # recreate the new identifier
718
+ identifier.replace(old_path, new_path, 1)
719
+
720
+ self._latest_reconstructions = [
721
+ update_identifier(identifier=identifier)
722
+ for identifier in self._latest_reconstructions
723
+ ]
724
+
725
+ self._latest_vol_reconstructions = [
726
+ update_identifier(identifier=identifier)
727
+ for identifier in self._latest_vol_reconstructions
728
+ ]
707
729
 
708
730
  def get_url_proj_index(self, url):
709
731
  """Return the index in the acquisition from the url"""
@@ -735,7 +757,7 @@ class TomwerScanBase(TomwerObject):
735
757
  from tomwer.core.process.task import Task
736
758
 
737
759
  if os.path.exists(self.process_file):
738
- with HDF5File(self.process_file, mode="r") as h5s:
760
+ with open_hdf5(self.process_file) as h5s:
739
761
  if not hasattr(self, "entry"):
740
762
  entry = "entry"
741
763
  else:
@@ -764,6 +786,12 @@ class TomwerScanBase(TomwerObject):
764
786
  """Return the equivalent DatasetAnalyzer for nabu"""
765
787
  raise NotImplementedError("Base class")
766
788
 
789
+ def get_proposal_name(self) -> Optional[str]:
790
+ return self._proposal_name
791
+
792
+ def set_proposal_name(self, proposal_name: str) -> None:
793
+ self._proposal_name = proposal_name
794
+
767
795
 
768
796
  class _TomwerBaseDock(object):
769
797
  """
@@ -837,7 +865,7 @@ def _get_reconstructed_single_file_volume(
837
865
 
838
866
  if check_url is True:
839
867
  try:
840
- with HDF5File(os.path.abspath(file_), "r", swmr=True) as h5f:
868
+ with open_hdf5(os.path.abspath(file_)) as h5f:
841
869
  if entry not in h5f:
842
870
  logger.info("{volume} does not exists")
843
871
  return None
@@ -36,17 +36,17 @@ from urllib.parse import urlparse
36
36
 
37
37
  import h5py
38
38
  from tomoscan.esrf.identifier.url_utils import split_path
39
- from tomoscan.esrf.scan.hdf5scan import HDF5TomoScan as _oHDF5TomoScan
40
39
  from tomoscan.factory import Factory as _oScanFactory
41
40
  from tomoscan.identifier import BaseIdentifier, ScanIdentifier, VolumeIdentifier
42
41
  from tomoscan.scanbase import TomoScanBase
43
42
  from tomoscan.tomoobject import TomoObject
43
+ from nxtomo.application.nxtomo import NXtomo
44
44
 
45
45
  from tomwer.utils import docstring
46
46
 
47
47
  from .blissscan import BlissScan
48
48
  from .edfscan import EDFTomoScan, EDFTomoScanIdentifier
49
- from .hdf5scan import HDF5TomoScan, HDF5TomoScanIdentifier
49
+ from .hdf5scan import NXtomoScan, NXtomoScanIdentifier
50
50
 
51
51
  _logger = logging.getLogger(__name__)
52
52
 
@@ -93,7 +93,7 @@ class ScanFactory(object):
93
93
  if scheme == "edf":
94
94
  identifier = EDFTomoScanIdentifier.from_str(identifier=identifier)
95
95
  elif scheme == "hdf5":
96
- identifier = HDF5TomoScanIdentifier.from_str(identifier=identifier)
96
+ identifier = NXtomoScanIdentifier.from_str(identifier=identifier)
97
97
  else:
98
98
  raise ValueError(f"Scheme {scheme} not recognized")
99
99
  else:
@@ -111,7 +111,7 @@ class ScanFactory(object):
111
111
  raise NotImplementedError()
112
112
  elif scheme == "hdf5":
113
113
  if tomo_type == ScanIdentifier.TOMO_TYPE:
114
- return HDF5TomoScan.from_identifier(identifier=identifier)
114
+ return NXtomoScan.from_identifier(identifier=identifier)
115
115
  else:
116
116
  raise NotImplementedError()
117
117
  else:
@@ -135,7 +135,7 @@ class ScanFactory(object):
135
135
  if entry is not None and not entry.startswith("/"):
136
136
  entry = "/" + entry
137
137
  if os.path.isfile(scan_path) and ScanFactory.is_hdf5_tomo(scan_path):
138
- valid_entries = _oHDF5TomoScan.get_valid_entries(scan_path)
138
+ valid_entries = NXtomo.get_valid_entries(scan_path)
139
139
  if entry is None:
140
140
  if len(valid_entries) > 1:
141
141
  _logger.warning(
@@ -148,7 +148,7 @@ class ScanFactory(object):
148
148
  f"entry {entry} is invalid. Does it exists ? Is the "
149
149
  f"file NXTomo compliant ?. Valid entry are {valid_entries}"
150
150
  )
151
- return HDF5TomoScan(scan=scan_path, entry=entry)
151
+ return NXtomoScan(scan=scan_path, entry=entry)
152
152
  elif ScanFactory.is_edf_tomo(scan_path):
153
153
  return EDFTomoScan(scan=scan_path)
154
154
  elif accept_bliss_scan and BlissScan.is_bliss_file(scan_path):
@@ -169,12 +169,12 @@ class ScanFactory(object):
169
169
  scan_path = scan_path.rstrip(os.path.sep)
170
170
  if EDFTomoScan.is_tomoscan_dir(scan_path):
171
171
  return (EDFTomoScan(scan=scan_path),)
172
- elif HDF5TomoScan.is_tomoscan_dir(scan_path):
172
+ elif NXtomoScan.is_tomoscan_dir(scan_path):
173
173
  scans = []
174
- master_file = HDF5TomoScan.get_master_file(scan_path=scan_path)
175
- entries = HDF5TomoScan.get_valid_entries(master_file)
174
+ master_file = NXtomoScan.get_master_file(scan_path=scan_path)
175
+ entries = NXtomo.get_valid_entries(master_file)
176
176
  for entry in entries:
177
- scans.append(HDF5TomoScan(scan=scan_path, entry=entry, index=None))
177
+ scans.append(NXtomoScan(scan=scan_path, entry=entry, index=None))
178
178
  return tuple(scans)
179
179
  elif accept_bliss_scan and BlissScan.is_bliss_file(scan_path):
180
180
  scans = []
@@ -201,8 +201,8 @@ class ScanFactory(object):
201
201
  )
202
202
  elif _dict[TomoScanBase.DICT_TYPE_KEY] == EDFTomoScan._TYPE:
203
203
  return EDFTomoScan(scan=None).load_from_dict(_dict)
204
- elif _dict[TomoScanBase.DICT_TYPE_KEY] == HDF5TomoScan._TYPE:
205
- return HDF5TomoScan.from_dict(_dict)
204
+ elif _dict[TomoScanBase.DICT_TYPE_KEY] == NXtomoScan._TYPE:
205
+ return NXtomoScan.from_dict(_dict)
206
206
  else:
207
207
  raise ValueError(
208
208
  f"Scan type {_dict[TomoScanBase.DICT_TYPE_KEY]} is not managed"
@@ -253,4 +253,4 @@ class ScanFactory(object):
253
253
  if os.path.isfile(scan_path):
254
254
  return h5py.is_hdf5(scan_path)
255
255
  else:
256
- return HDF5TomoScan.directory_contains_scan(scan_path)
256
+ return NXtomoScan.directory_contains_scan(scan_path)
@@ -48,6 +48,6 @@ def test_working_directory():
48
48
  scan = EDFTomoScan(scan=None)
49
49
  assert scan.working_directory is None
50
50
  scan = EDFTomoScan(scan="my_folder")
51
- assert scan.working_directory == os.path.realpath("my_folder")
51
+ assert scan.working_directory == os.path.abspath("my_folder")
52
52
  scan = EDFTomoScan(scan="/full/path/to/my/folder")
53
- assert scan.working_directory == os.path.realpath("/full/path/to/my/folder")
53
+ assert scan.working_directory == os.path.abspath("/full/path/to/my/folder")
@@ -33,17 +33,17 @@ import asyncio
33
33
  import os
34
34
 
35
35
  from tomwer.core.futureobject import FutureTomwerObject
36
- from tomwer.core.utils.scanutils import MockHDF5
36
+ from tomwer.core.utils.scanutils import MockNXtomo
37
37
 
38
38
 
39
39
  def test_simple_future_tomo_obj(tmpdir):
40
40
  """Simple test of the FutureTomwerScan API"""
41
- scan = MockHDF5(
41
+ scan = MockNXtomo(
42
42
  scan_path=os.path.join(tmpdir, "scan_test"),
43
43
  n_proj=10,
44
44
  n_ini_proj=10,
45
45
  create_ini_dark=False,
46
- create_ini_ref=False,
46
+ create_ini_flat=False,
47
47
  dim=10,
48
48
  ).scan
49
49
  future = asyncio.Future()
@@ -33,9 +33,9 @@ import shutil
33
33
  import tempfile
34
34
  import unittest
35
35
 
36
- from tomwer.core.scan.hdf5scan import HDF5TomoScan
37
- from tomwer.core.utils.scanutils import MockHDF5
38
- from tomwer.tests.utils import UtilsTest
36
+ from tomwer.core.scan.nxtomoscan import NXtomoScan
37
+ from tomwer.core.utils.scanutils import MockNXtomo
38
+ from tomwer.tests.datasets import TomwerCIDatasets
39
39
 
40
40
 
41
41
  class TestHDF5Scan(unittest.TestCase):
@@ -46,11 +46,13 @@ class TestHDF5Scan(unittest.TestCase):
46
46
  self._tmp_dir = tempfile.mkdtemp()
47
47
  self.dataset_file = os.path.join(self._tmp_dir, "frm_edftomomill_twoentries.nx")
48
48
  shutil.copyfile(
49
- UtilsTest.getH5Dataset(folderID="frm_edftomomill_twoentries.nx"),
49
+ TomwerCIDatasets.get_dataset(
50
+ "h5_datasets/frm_edftomomill_twoentries.nx",
51
+ ),
50
52
  self.dataset_file,
51
53
  )
52
54
  assert os.path.isfile(self.dataset_file)
53
- self.scan = HDF5TomoScan(scan=self.dataset_file, entry="entry0000")
55
+ self.scan = NXtomoScan(scan=self.dataset_file, entry="entry0000")
54
56
 
55
57
  def test_scan_dir(self):
56
58
  assert self.scan.scan_dir_name() == self._tmp_dir.split(os.sep)[-1]
@@ -58,27 +60,27 @@ class TestHDF5Scan(unittest.TestCase):
58
60
  def testFFInterval(self):
59
61
  """test the call to ff_interval"""
60
62
  scan_path = os.path.join(self._tmp_dir, "my_scan_1")
61
- scan_1 = MockHDF5(
63
+ scan_1 = MockNXtomo(
62
64
  scan_path=scan_path,
63
65
  n_ini_proj=20,
64
66
  n_proj=20,
65
67
  n_alignement_proj=2,
66
- create_final_ref=True,
68
+ create_final_flat=True,
67
69
  create_ini_dark=True,
68
- create_ini_ref=True,
70
+ create_ini_flat=True,
69
71
  n_refs=5,
70
72
  ).scan
71
73
  self.assertEqual(scan_1.ff_interval, 20)
72
74
 
73
75
  scan_path2 = os.path.join(self._tmp_dir, "my_scan_2")
74
- scan_2 = MockHDF5(
76
+ scan_2 = MockNXtomo(
75
77
  scan_path=scan_path2,
76
78
  n_ini_proj=10,
77
79
  n_proj=10,
78
80
  n_alignement_proj=2,
79
- create_final_ref=False,
81
+ create_final_flat=False,
80
82
  create_ini_dark=True,
81
- create_ini_ref=True,
83
+ create_ini_flat=True,
82
84
  n_refs=1,
83
85
  ).scan
84
86
  self.assertEqual(scan_2.ff_interval, 0)
@@ -86,9 +88,9 @@ class TestHDF5Scan(unittest.TestCase):
86
88
 
87
89
  def test_working_directory():
88
90
  """test behavior of the working directory function"""
89
- scan = HDF5TomoScan(scan=None, entry="my_entry")
91
+ scan = NXtomoScan(scan=None, entry="my_entry")
90
92
  assert scan.working_directory is None
91
- scan = HDF5TomoScan(scan="/full/path/my_file.sh", entry="my_entry")
92
- assert scan.working_directory == os.path.realpath("/full/path")
93
- scan = HDF5TomoScan(scan="my_file.sh", entry="my_entry")
94
- assert scan.working_directory == os.path.realpath(".")
93
+ scan = NXtomoScan(scan="/full/path/my_file.sh", entry="my_entry")
94
+ assert scan.working_directory == os.path.abspath("/full/path")
95
+ scan = NXtomoScan(scan="my_file.sh", entry="my_entry")
96
+ assert scan.working_directory == os.path.abspath(".")
@@ -32,10 +32,10 @@ import shutil
32
32
  import tempfile
33
33
  import unittest
34
34
 
35
- from tomoscan.io import HDF5File
35
+ from tomoscan.io import HDF5File, get_swmr_mode
36
36
 
37
37
  from tomwer.core.process.task import Task
38
- from tomwer.core.utils.scanutils import MockHDF5
38
+ from tomwer.core.utils.scanutils import MockNXtomo
39
39
 
40
40
 
41
41
  class TestProcessRegistration(unittest.TestCase):
@@ -62,7 +62,7 @@ class TestProcessRegistration(unittest.TestCase):
62
62
 
63
63
  def setUp(self):
64
64
  self.tmp_dir = tempfile.mkdtemp()
65
- self.scan = MockHDF5(scan_path=self.tmp_dir, n_proj=2).scan
65
+ self.scan = MockNXtomo(scan_path=self.tmp_dir, n_proj=2).scan
66
66
 
67
67
  def tearDown(self):
68
68
  shutil.rmtree(self.tmp_dir)
@@ -85,42 +85,6 @@ class TestProcessRegistration(unittest.TestCase):
85
85
  )
86
86
  self.assertEqual(cor_value, 19)
87
87
 
88
- def testGetDarks(self):
89
- from tomwer.core.process.reconstruction.darkref.darkrefs import DarkRefsTask
90
-
91
- for i in range(20):
92
- results = {"darks": {"0": i * 2}, "flats": {"1": i}}
93
- Task._register_process(
94
- self.scan.process_file,
95
- process=DarkRefsTask,
96
- entry=self.scan.entry,
97
- configuration=None,
98
- results=results,
99
- process_index=i,
100
- )
101
- flats = DarkRefsTask.get_darks_frm_process_file(
102
- self.scan.process_file, entry=self.scan.entry
103
- )
104
- self.assertEqual(flats[list(flats.keys())[0]], 19 * 2)
105
-
106
- def testGetFlats(self):
107
- from tomwer.core.process.reconstruction.darkref.darkrefs import DarkRefsTask
108
-
109
- for i in range(20):
110
- results = {"darks": {"0": i}, "flats": {"1": i}}
111
- Task._register_process(
112
- self.scan.process_file,
113
- process=DarkRefsTask,
114
- entry=self.scan.entry,
115
- configuration=None,
116
- results=results,
117
- process_index=i,
118
- )
119
- flats = DarkRefsTask.get_flats_frm_process_file(
120
- self.scan.process_file, entry=self.scan.entry
121
- )
122
- self.assertEqual(flats[list(flats.keys())[0]], 19)
123
-
124
88
  def testGetProcessNodes(self):
125
89
  """insure it return the last dark process based on the processing index"""
126
90
 
@@ -134,7 +98,7 @@ class TestProcessRegistration(unittest.TestCase):
134
98
  process_index=i,
135
99
  )
136
100
 
137
- with HDF5File(self.scan.process_file, "r", swmr=True) as h5f:
101
+ with HDF5File(self.scan.process_file, "r", swmr=get_swmr_mode()) as h5f:
138
102
  nodes = Task._get_process_nodes(
139
103
  root_node=h5f[self.scan.entry], process=self.DummyProcess
140
104
  )
@@ -1,49 +1,18 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "24/01/2017"
29
-
30
1
  import contextlib
31
2
  import logging
32
3
  import os
33
4
  import shutil
34
5
  import tempfile
35
6
  import unittest
36
- from multiprocessing import Process
37
7
 
38
8
  import fabio.edfimage
39
9
  import numpy
40
10
 
41
11
  from tomwer.core.process.reconstruction.nabu import nabuslices
42
- from tomwer.core.process.task import Task
43
12
  from tomwer.core.scan.edfscan import EDFTomoScan
44
13
  from tomwer.core.scan.scanfactory import ScanFactory
45
14
  from tomwer.core.utils.scanutils import MockEDF
46
- from tomwer.tests.utils import UtilsTest
15
+ from tomwer.tests.datasets import TomwerCIDatasets
47
16
 
48
17
  logging.disable(logging.INFO)
49
18
 
@@ -59,7 +28,9 @@ class TestScanFactory(unittest.TestCase):
59
28
  ScanFactory.create_scan_object(scan_dir)
60
29
 
61
30
  def test_scan_edf(self):
62
- scan_dir = UtilsTest.getEDFDataset("test10")
31
+ scan_dir = TomwerCIDatasets.get_dataset(
32
+ "edf_datasets/test10",
33
+ )
63
34
  scan = ScanFactory.create_scan_object(scan_dir)
64
35
  self.assertTrue(isinstance(scan, EDFTomoScan))
65
36
 
@@ -101,8 +72,8 @@ class TestScanValidatorFindNabuFiles(unittest.TestCase):
101
72
  pag=pag if delta_beta is not None else False,
102
73
  ctf=ctf if delta_beta is not None else False,
103
74
  db=delta_beta,
75
+ axis="XY",
104
76
  )
105
- print("file_name is", file_name)
106
77
  with self.subTest(
107
78
  slice_index=slice_index,
108
79
  pag_db=delta_beta,
@@ -400,47 +371,3 @@ def test_get_sinogram(tmp_path):
400
371
  sinogram_1,
401
372
  numpy.array([[2, 3], [6, 7], [10, 11], [14, 15]]),
402
373
  )
403
-
404
-
405
- class TestSeveralWriteWithThreading(unittest.TestCase):
406
- class DummyProcess(Task):
407
- @staticmethod
408
- def program_name():
409
- """Name of the program used for this processing"""
410
- return "dummy program"
411
-
412
- @staticmethod
413
- def program_version():
414
- """version of the program used for this processing"""
415
- return "0.0.0"
416
-
417
- @staticmethod
418
- def definition():
419
- """definition of the process"""
420
- return "no definition"
421
-
422
- def setUp(self):
423
- self.tmp_dir = tempfile.mkdtemp()
424
- self._file = os.path.join(self.tmp_dir, "XXXtomwer_processes.h5")
425
-
426
- def tearDown(self):
427
- shutil.rmtree(self.tmp_dir)
428
-
429
- def testSeveralWrite(self):
430
- processes = []
431
- for i in range(20):
432
- args = (
433
- self._file,
434
- TestSeveralWriteWithThreading.DummyProcess,
435
- "entry0000",
436
- {"info": "no configuration"},
437
- {"data": numpy.random.random(2000)},
438
- i,
439
- None,
440
- True,
441
- )
442
- processes.append(Process(target=Task._register_process, args=args))
443
- for process in processes:
444
- process.start()
445
- for process in processes:
446
- process.join()