tomwer 1.0.4__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 (256) 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 +4 -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 -128
  20. orangecontrib/tomwer/widgets/control/NotifierOW.py +31 -7
  21. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +85 -0
  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 +138 -0
  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 -10
  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 -18
  47. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -17
  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/nxtomoeditor.py +103 -0
  66. tomwer/app/rsync.py +1 -1
  67. tomwer/core/cluster/cluster.py +1 -1
  68. tomwer/core/futureobject.py +1 -0
  69. tomwer/core/process/control/datalistener/datalistener.py +7 -1
  70. tomwer/core/process/control/datalistener/rpcserver.py +3 -3
  71. tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
  72. tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
  73. tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
  74. tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
  75. tomwer/core/process/control/nxtomomill.py +33 -58
  76. tomwer/core/process/control/scanlist.py +2 -1
  77. tomwer/core/process/control/scanselector.py +7 -0
  78. tomwer/core/process/control/scantransfer.py +9 -18
  79. tomwer/core/process/control/scanvalidator.py +6 -5
  80. tomwer/core/process/control/singletomoobj.py +2 -1
  81. tomwer/core/process/control/timer.py +2 -1
  82. tomwer/core/process/control/tomoobjserie.py +8 -0
  83. tomwer/core/process/control/volumeselector.py +2 -1
  84. tomwer/core/process/control/volumesymlink.py +2 -1
  85. tomwer/core/process/edit/darkflatpatch.py +2 -1
  86. tomwer/core/process/edit/imagekeyeditor.py +4 -3
  87. tomwer/core/process/reconstruction/axis/axis.py +29 -32
  88. tomwer/core/process/reconstruction/axis/mode.py +3 -2
  89. tomwer/core/process/reconstruction/axis/params.py +35 -16
  90. tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
  91. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
  92. tomwer/core/process/reconstruction/darkref/params.py +62 -67
  93. tomwer/core/process/reconstruction/lamino/tofu.py +1 -1
  94. tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
  95. tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
  96. tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
  97. tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
  98. tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
  99. tomwer/core/process/reconstruction/nabu/utils.py +12 -1
  100. tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
  101. tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
  102. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
  103. tomwer/core/process/reconstruction/test/__init__.py +0 -39
  104. tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
  105. tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
  106. tomwer/core/process/script/python.py +16 -12
  107. tomwer/core/process/task.py +3 -7
  108. tomwer/core/process/test/test_axis.py +1 -1
  109. tomwer/core/process/test/test_dark_and_flat.py +41 -111
  110. tomwer/core/process/test/test_data_listener.py +0 -29
  111. tomwer/core/process/test/test_data_transfer.py +10 -14
  112. tomwer/core/process/test/test_nabu.py +1 -1
  113. tomwer/core/process/test/test_normalization.py +1 -1
  114. tomwer/core/process/visualization/liveslice.py +6 -0
  115. tomwer/core/scan/blissscan.py +37 -2
  116. tomwer/core/scan/edfscan.py +14 -4
  117. tomwer/core/scan/hdf5scan.py +10 -4
  118. tomwer/core/scan/scanbase.py +35 -29
  119. tomwer/core/scan/scanfactory.py +3 -17
  120. tomwer/core/scan/test/test_h5.py +1 -1
  121. tomwer/core/scan/test/test_process_registration.py +0 -11
  122. tomwer/core/scan/test/test_scan.py +32 -30
  123. tomwer/core/settings.py +2 -2
  124. tomwer/core/test/test_utils.py +1 -1
  125. tomwer/core/tomwer_object.py +19 -0
  126. tomwer/core/utils/__init__.py +0 -45
  127. tomwer/core/utils/char.py +2 -0
  128. tomwer/core/utils/gpu.py +5 -5
  129. tomwer/core/utils/nxtomoutils.py +2 -2
  130. tomwer/core/utils/scanutils.py +50 -0
  131. tomwer/core/utils/volumeutils.py +13 -0
  132. tomwer/core/volume/edfvolume.py +4 -0
  133. tomwer/core/volume/hdf5volume.py +4 -0
  134. tomwer/core/volume/jp2kvolume.py +4 -0
  135. tomwer/core/volume/rawvolume.py +4 -0
  136. tomwer/core/volume/tiffvolume.py +4 -0
  137. tomwer/core/volume/volumebase.py +19 -12
  138. tomwer/core/volume/volumefactory.py +20 -1
  139. tomwer/gui/cluster/slurm.py +1 -1
  140. tomwer/gui/cluster/test/test_cluster.py +2 -2
  141. tomwer/gui/control/datalist.py +109 -34
  142. tomwer/gui/control/datatransfert.py +1 -1
  143. tomwer/gui/control/datawatcher/datawatcher.py +23 -13
  144. tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
  145. tomwer/gui/control/observations.py +0 -3
  146. tomwer/gui/control/selectorwidgetbase.py +42 -11
  147. tomwer/gui/control/serie/seriecreator.py +967 -0
  148. tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
  149. tomwer/gui/control/singletomoobj.py +15 -3
  150. tomwer/gui/control/test/test_datalist.py +1 -1
  151. tomwer/gui/control/test/test_datalistener.py +1 -1
  152. tomwer/gui/control/test/test_inputwidget.py +1 -1
  153. tomwer/gui/control/test/test_process_manager.py +1 -13
  154. tomwer/gui/control/test/test_scanselector.py +1 -1
  155. tomwer/gui/control/test/test_scanvalidator.py +1 -1
  156. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  157. tomwer/gui/control/test/test_volume_dialog.py +19 -7
  158. tomwer/gui/control/test/test_volumeselector.py +4 -4
  159. tomwer/gui/debugtools/datasetgenerator.py +1 -8
  160. tomwer/gui/edit/dkrfpatch.py +2 -2
  161. tomwer/gui/edit/imagekeyeditor.py +12 -9
  162. tomwer/gui/edit/nxtomoeditor.py +475 -0
  163. tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
  164. tomwer/gui/edit/test/test_image_key_editor.py +2 -2
  165. tomwer/gui/edit/test/test_nx_editor.py +155 -0
  166. tomwer/gui/qfolderdialog.py +11 -0
  167. tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
  168. tomwer/gui/reconstruction/axis/axis.py +2 -0
  169. tomwer/gui/reconstruction/axis/radioaxis.py +67 -11
  170. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
  171. tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
  172. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  173. tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
  174. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
  175. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -4
  176. tomwer/gui/reconstruction/nabu/castvolume.py +80 -11
  177. tomwer/gui/reconstruction/nabu/check.py +1 -1
  178. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
  179. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
  180. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
  181. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
  182. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
  183. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -13
  184. tomwer/gui/reconstruction/nabu/slices.py +10 -2
  185. tomwer/gui/reconstruction/nabu/slurm.py +1 -1
  186. tomwer/gui/reconstruction/nabu/volume.py +13 -7
  187. tomwer/gui/reconstruction/normalization/intensity.py +1 -1
  188. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -34
  189. tomwer/gui/reconstruction/saaxis/saaxis.py +11 -6
  190. tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
  191. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
  192. tomwer/gui/reconstruction/scores/scoreplot.py +67 -61
  193. tomwer/gui/reconstruction/test/test_axis.py +2 -2
  194. tomwer/gui/reconstruction/test/test_lamino.py +2 -2
  195. tomwer/gui/reconstruction/test/test_nabu.py +14 -1
  196. tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
  197. tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
  198. tomwer/gui/stackplot.py +11 -28
  199. tomwer/gui/test/test_axis_gui.py +4 -4
  200. tomwer/gui/test/test_qfolder_dialog.py +12 -0
  201. tomwer/gui/utils/inputwidget.py +42 -21
  202. tomwer/gui/utils/lineselector/lineselector.py +13 -21
  203. tomwer/gui/utils/scandescription.py +2 -4
  204. tomwer/gui/utils/slider.py +1 -102
  205. tomwer/gui/utils/unitsystem.py +48 -11
  206. tomwer/gui/visualization/dataviewer.py +24 -17
  207. tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
  208. tomwer/gui/visualization/nxtomometadata.py +21 -0
  209. tomwer/gui/visualization/scanoverview.py +0 -1
  210. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
  211. tomwer/gui/visualization/test/test_stacks.py +1 -1
  212. tomwer/gui/visualization/tomoobjoverview.py +49 -0
  213. tomwer/gui/visualization/volumeoverview.py +64 -0
  214. tomwer/gui/visualization/volumeviewer.py +1 -1
  215. tomwer/resources/gui/icons/multi-document-save.png +0 -0
  216. tomwer/resources/gui/icons/multi-document-save.svg +101 -0
  217. tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
  218. tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
  219. tomwer/synctools/datalistener.py +5 -1
  220. tomwer/synctools/imageloaderthread.py +2 -2
  221. tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
  222. tomwer/synctools/stacks/processingstack.py +2 -2
  223. tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
  224. tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
  225. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
  226. tomwer/synctools/test/test_darkRefs.py +32 -149
  227. tomwer/synctools/test/test_foldertransfer.py +1 -1
  228. tomwer/synctools/test/test_scanstages.py +2 -2
  229. tomwer/tests/__init__.py +0 -0
  230. tomwer/tests/conftest.py +51 -0
  231. tomwer/{test → tests}/test_scripts.py +1 -1
  232. tomwer/tests/test_utils.py +10 -0
  233. tomwer/{test → tests}/utils/utilstest.py +0 -11
  234. tomwer/version.py +3 -3
  235. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
  236. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/RECORD +245 -217
  237. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
  238. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
  239. orangecontrib/tomwer/setup.py +0 -45
  240. orangecontrib/tomwer/widgets/setup.py +0 -49
  241. tomwer/app/process.py +0 -153
  242. tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
  243. tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
  244. tomwer/core/utils/laminoutils.py +0 -80
  245. tomwer/gui/utils/lineselector/lineselection.py +0 -76
  246. tomwer/setup.py +0 -52
  247. tomwer/web/client.py +0 -43
  248. tomwer/web/config.py +0 -36
  249. tomwer/web/test/test_graylog_connection.py +0 -59
  250. {tomwer/test → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
  251. /tomwer/{web/test → gui/control/serie}/__init__.py +0 -0
  252. /tomwer/{test → tests}/utils/__init__.py +0 -0
  253. /tomwer-1.0.4-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
  254. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
  255. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
  256. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -36,18 +36,28 @@ from processview.core.manager.manager import ProcessManager
36
36
 
37
37
  from tomwer.core.futureobject import FutureTomwerObject
38
38
  from tomwer.core.utils.slurm import is_slurm_available
39
+ from tomwer.core.utils.scanutils import data_identifier_to_scan
39
40
 
40
41
  try:
41
- from nabu.pipeline.fullfield.local_reconstruction import ( # noqa F401
42
- ChunkedReconstructor,
42
+ from nabu.pipeline.fullfield.reconstruction import ( # noqa F401
43
+ FullFieldReconstructor,
43
44
  )
44
45
  except (ImportError, OSError) as e:
45
- # import of cufft library can bring an OSError if cuda not install
46
- has_nabu = False
47
46
  _err_import_nabu = e
47
+ try:
48
+ from nabu.pipeline.fullfield.local_reconstruction import ( # noqa F401
49
+ ChunkedReconstructor,
50
+ )
51
+ except (ImportError, OSError):
52
+ # import of cufft library can bring an OSError if cuda not install
53
+ has_nabu = False
54
+ else:
55
+ has_nabu = True
56
+ _err_import_nabu = None
48
57
  else:
49
58
  has_nabu = True
50
59
  _err_import_nabu = None
60
+
51
61
  from silx.utils.enum import Enum as _Enum
52
62
  from tomwer.core.scan.scanbase import TomwerScanBase
53
63
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
@@ -128,6 +138,9 @@ def run_slices_reconstruction(
128
138
  "job on cluster requested but no access to slurm cluster found"
129
139
  )
130
140
 
141
+ # beam shape is not directly used by nabu (uses ctf_geometry directly)
142
+ config.get("phase", {}).pop("beam_shape", None)
143
+
131
144
  # if scan contains some center of position copy it to nabu
132
145
  if scan.axis_params is not None and scan.axis_params.relative_cor_value is not None:
133
146
  if "reconstruction" in config:
@@ -258,7 +271,7 @@ class NabuSlices(
258
271
  self._dry_run = inputs.get("dry_run", False)
259
272
 
260
273
  def run(self):
261
- scan = self.inputs.data
274
+ scan = data_identifier_to_scan(self.inputs.data)
262
275
  self.outputs.nabu_params = None
263
276
  if scan is None:
264
277
  self.outputs.data = None
@@ -298,9 +311,6 @@ class NabuSlices(
298
311
  if "dry_run" in configuration:
299
312
  self.set_dry_run(bool(configuration["dry_run"]))
300
313
 
301
- def pathReceived(self, scan):
302
- return self.process(scan=scan)
303
-
304
314
  # TODO: those get / set configuration should be removed now that Task is used
305
315
  def get_configuration(self):
306
316
  return self._settings
@@ -423,9 +433,9 @@ def interpret_tomwer_configuration(
423
433
  slices = []
424
434
 
425
435
  if "phase" in config and "delta_beta" in config["phase"]:
426
- pag_dbs = utils.retrieve_lst_of_value_from_str(
427
- config["phase"]["delta_beta"], type_=float
428
- )
436
+ pag_dbs = config["phase"]["delta_beta"]
437
+ if isinstance(pag_dbs, str):
438
+ pag_dbs = utils.retrieve_lst_of_value_from_str(pag_dbs, type_=float)
429
439
  if len(pag_dbs) == 0:
430
440
  pag_dbs = (None,)
431
441
  else:
@@ -511,6 +521,11 @@ class SingleSliceRunner(_NabuBaseReconstructor):
511
521
  raise ValueError(
512
522
  f"slice index is expected to an int or 'middle' and not {type(self.slice_index)}"
513
523
  )
524
+ elif (
525
+ isinstance(self.slice_index, float)
526
+ and int(self.slice_index) == self.slice_index
527
+ ):
528
+ self._slice_index = int(self.slice_index)
514
529
  elif not isinstance(self.slice_index, (int, type(None))):
515
530
  raise TypeError(
516
531
  f"slice index is expected to an int or 'middle' or None and not {type(self.slice_index)}"
@@ -628,7 +643,9 @@ class SingleSliceRunner(_NabuBaseReconstructor):
628
643
  return super()._get_futures_slurm_callback(config_to_dump)
629
644
 
630
645
  @staticmethod
631
- def get_file_basename_reconstruction(scan, pag, db, slice_index: Union[str, int]):
646
+ def get_file_basename_reconstruction(
647
+ scan, pag, ctf, db, slice_index: Union[str, int]
648
+ ):
632
649
  if pag:
633
650
  assert db is not None, "if paganin defined, db should not be None"
634
651
  if slice_index == "middle":
@@ -642,6 +659,8 @@ class SingleSliceRunner(_NabuBaseReconstructor):
642
659
  if slice_index is None:
643
660
  if pag:
644
661
  return "_".join((basename + "pag", "db" + str(db).zfill(4)))
662
+ elif ctf:
663
+ return "_".join((basename + "ctf", "db" + str(db).zfill(4)))
645
664
  else:
646
665
  return basename
647
666
  else:
@@ -653,11 +672,19 @@ class SingleSliceRunner(_NabuBaseReconstructor):
653
672
  "db" + str(db).zfill(4),
654
673
  )
655
674
  )
675
+ elif ctf:
676
+ return "_".join(
677
+ (
678
+ basename + "slice_ctf",
679
+ str(slice_index).zfill(4),
680
+ "db" + str(db).zfill(4),
681
+ )
682
+ )
656
683
  else:
657
684
  return "_".join((basename + "slice", str(slice_index).zfill(4)))
658
685
 
659
686
  @docstring(_NabuBaseReconstructor)
660
- def _get_file_basename_reconstruction(self, pag, db):
687
+ def _get_file_basename_reconstruction(self, pag, db, ctf):
661
688
  """
662
689
 
663
690
  :param TomwerScanBase scan: scan reconstructed
@@ -669,7 +696,7 @@ class SingleSliceRunner(_NabuBaseReconstructor):
669
696
  :return: basename of the file reconstructed (without any extension)
670
697
  """
671
698
  return self.get_file_basename_reconstruction(
672
- scan=self.scan, db=db, pag=pag, slice_index=self.slice_index
699
+ scan=self.scan, db=db, pag=pag, slice_index=self.slice_index, ctf=ctf
673
700
  )
674
701
 
675
702
 
@@ -36,6 +36,7 @@ from tomwer.core.futureobject import FutureTomwerObject
36
36
  from tomwer.core.scan.scanbase import TomwerScanBase
37
37
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
38
38
  from tomwer.core.scan.scanfactory import ScanFactory
39
+ from tomwer.core.utils.scanutils import data_identifier_to_scan
39
40
  from . import utils
40
41
  from . import settings
41
42
  from nabu.pipeline.config import generate_nabu_configfile
@@ -94,15 +95,18 @@ def run_volume_reconstruction(
94
95
  else:
95
96
  target = Target.SLURM
96
97
 
98
+ # beam shape is not directly used by nabu (uses ctf_geometry directly)
99
+ config.get("phase", {}).pop("beam_shape", None)
100
+
97
101
  config_volume = copy.copy(config)
98
102
  config_nabu_slices = copy.deepcopy(scan.nabu_recons_params)
99
103
  if "tomwer_slices" in config_nabu_slices:
100
104
  del config_nabu_slices["tomwer_slices"]
101
105
 
102
106
  if "phase" in config_nabu_slices and "delta_beta" in config_nabu_slices["phase"]:
103
- pag_dbs = utils.retrieve_lst_of_value_from_str(
104
- config_nabu_slices["phase"]["delta_beta"], type_=float
105
- )
107
+ pag_dbs = config_nabu_slices["phase"]["delta_beta"]
108
+ if isinstance(pag_dbs, str):
109
+ pag_dbs = utils.retrieve_lst_of_value_from_str(pag_dbs, type_=float)
106
110
  if len(pag_dbs) > 1:
107
111
  raise ValueError(
108
112
  "Several value of delta / beta found for volume reconstruction"
@@ -336,7 +340,7 @@ class VolumeRunner(_NabuBaseReconstructor):
336
340
  return config_s, extra_opts
337
341
 
338
342
  @docstring(_NabuBaseReconstructor)
339
- def _get_file_basename_reconstruction(self, pag, db):
343
+ def _get_file_basename_reconstruction(self, pag, db, ctf):
340
344
  """
341
345
 
342
346
  :param TomwerScanBase scan: scan reconstructed
@@ -348,6 +352,7 @@ class VolumeRunner(_NabuBaseReconstructor):
348
352
  :return: basename of the file reconstructed (without any extension)
349
353
  """
350
354
  assert type(db) in (int, type(None))
355
+ assert not pag == ctf == True, "cannot ask for both pag and ctf active"
351
356
  if isinstance(self.scan, HDF5TomoScan):
352
357
  basename, _ = os.path.splitext(self.scan.master_file)
353
358
  basename = os.path.basename(basename)
@@ -355,14 +360,19 @@ class VolumeRunner(_NabuBaseReconstructor):
355
360
  basename = os.path.basename(self.scan.path)
356
361
  if pag:
357
362
  return "_".join((basename + "pag", "db" + str(db).zfill(4), "vol"))
363
+ elif ctf:
364
+ return "_".join((basename + "ctf", "db" + str(db).zfill(4), "vol"))
358
365
  else:
359
366
  return "_".join((basename, "vol"))
360
367
 
361
368
 
362
369
  class NabuVolume(
363
370
  Task,
364
- input_names=("data", "nabu_params"),
365
- optional_input_names=("nabu_volume_params",),
371
+ input_names=("data",),
372
+ optional_input_names=(
373
+ "nabu_params",
374
+ "nabu_volume_params",
375
+ ),
366
376
  output_names=("data", "volumes"),
367
377
  ):
368
378
  def __init__(
@@ -379,12 +389,13 @@ class NabuVolume(
379
389
  self._dry_run = inputs.get("dry_run", False)
380
390
 
381
391
  def run(self):
382
- scan = self.inputs.data
383
- if self.inputs.nabu_params is None:
384
- raise ValueError("nabu params should be provided")
392
+ scan = data_identifier_to_scan(self.inputs.data)
385
393
  if scan is None:
386
394
  self.outputs.data = None
387
395
  return
396
+ nabu_params = self.inputs.nabu_params
397
+ if nabu_params is None:
398
+ nabu_params = scan.nabu_params
388
399
  if isinstance(scan, TomwerScanBase):
389
400
  scan = scan
390
401
  elif isinstance(scan, dict):
@@ -398,6 +409,7 @@ class NabuVolume(
398
409
  'registered. Did you process "Nabu slices" '
399
410
  "already ?"
400
411
  )
412
+ print("configuration params to be used are", scan.nabu_recons_params)
401
413
 
402
414
  run_volume_reconstruction(
403
415
  scan=scan,
@@ -440,9 +452,6 @@ class NabuVolume(
440
452
  def dry_run(self):
441
453
  return self._dry_run
442
454
 
443
- def pathReceived(self, scan):
444
- return self.process(scan=scan)
445
-
446
455
  @staticmethod
447
456
  def retrieve_last_relative_cor(scan):
448
457
  with EntryReader(scan.process_file_url) as h5f:
@@ -78,7 +78,10 @@ def retrieve_lst_of_value_from_str(my_string: str, type_) -> tuple:
78
78
  :param str mystring:
79
79
  :return: list of single value
80
80
  """
81
- assert type(my_string) is str, "work on string only"
81
+ if not isinstance(my_string, str):
82
+ raise TypeError(
83
+ f"my_string is expected to be a string. {type(my_string)} provided"
84
+ )
82
85
  res = []
83
86
  my_string = my_string.replace("(", "")
84
87
  my_string = my_string.replace(")", "")
@@ -360,12 +363,20 @@ class _NabuPhaseMethod(_Enum):
360
363
  """
361
364
 
362
365
  PAGANIN = "Paganin"
366
+ CTF = "CTF"
363
367
  NONE = "None"
364
368
 
365
369
  @classmethod
366
370
  def from_value(cls, value):
367
371
  if value in (None, ""):
368
372
  return _NabuPhaseMethod.NONE
373
+ elif isinstance(value, str):
374
+ if value.lower() == "paganin":
375
+ return _NabuPhaseMethod.PAGANIN
376
+ elif value.lower() == "none":
377
+ return _NabuPhaseMethod.NONE
378
+ elif value.lower() == "ctf":
379
+ return _NabuPhaseMethod.CTF
369
380
  else:
370
381
  return super().from_value(value=value)
371
382
 
@@ -34,22 +34,23 @@ __license__ = "MIT"
34
34
  __date__ = "25/06/2021"
35
35
 
36
36
 
37
+ import numpy
38
+ import logging
39
+ import functools
40
+ from silx.io.url import DataUrl
41
+ import tomwer.version
37
42
  from tomwer.core.process.task import Task
43
+ from tomwer.core.utils.scanutils import data_identifier_to_scan
38
44
  from .params import (
39
45
  SinoNormalizationParams,
40
46
  _ValueCalculationFct,
41
47
  _ValueSource,
42
48
  )
43
49
  from tomoscan.normalization import Method as NormMethod
44
- from processview.core.superviseprocess import SuperviseProcess
45
- from silx.io.url import DataUrl
46
- from processview.core.dataset import DatasetIdentifier
47
50
  import tomoscan.esrf.scan.utils
48
- import tomwer.version
49
51
  from tomoscan.esrf.scan.utils import get_data
50
- import functools
51
- import numpy
52
- import logging
52
+ from processview.core.dataset import DatasetIdentifier
53
+ from processview.core.superviseprocess import SuperviseProcess
53
54
 
54
55
 
55
56
  _logger = logging.getLogger(__name__)
@@ -94,7 +95,7 @@ class SinoNormalizationTask(
94
95
  self.set_properties(configuration)
95
96
 
96
97
  def run(self):
97
- scan = self.inputs.data
98
+ scan = data_identifier_to_scan(self.inputs.data)
98
99
  if scan is None:
99
100
  return
100
101
  extra_infos = scan.intensity_normalization.get_extra_infos()
@@ -32,15 +32,26 @@ __license__ = "MIT"
32
32
  __date__ = "10/02/2021"
33
33
 
34
34
 
35
+ import os
36
+ import copy
37
+ import h5py
38
+ import numpy
39
+ import logging
40
+ from typing import Iterable, Optional
35
41
  from silx.io.url import DataUrl
42
+ from tomoscan.io import HDF5File
43
+ from processview.core.manager import ProcessManager, DatasetState
44
+ from processview.core.superviseprocess import SuperviseProcess
45
+ from nabu.pipeline.config import get_default_nabu_config
46
+ from nabu.pipeline.fullfield.nabu_config import (
47
+ nabu_config as nabu_fullfield_default_config,
48
+ )
36
49
  from tomwer.core.scan.edfscan import EDFTomoScan
37
50
  from tomwer.core.scan.scanfactory import ScanFactory
38
51
  from tomwer.core.process.reconstruction.nabu.nabuslices import (
39
52
  SingleSliceRunner,
40
53
  interpret_tomwer_configuration,
41
54
  )
42
- from typing import Iterable, Optional
43
-
44
55
  from tomwer.core.utils.slurm import is_slurm_available
45
56
  from tomwer.core.volume.volumefactory import VolumeFactory
46
57
  from tomwer.io.utils.utils import get_slice_data
@@ -50,25 +61,18 @@ from .params import ReconstructionMode
50
61
  from .params import SAAxisParams
51
62
  from tomwer.core.scan.scanbase import TomwerScanBase
52
63
  from tomwer.core.utils import logconfig
53
- from processview.core.manager import ProcessManager, DatasetState
54
- from processview.core.superviseprocess import SuperviseProcess
55
64
  from tomwer.core.process.task import Task
56
65
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
57
- from tomoscan.io import HDF5File
58
66
  import tomwer.version
59
- import numpy
60
67
  from tomwer.core.progress import Progress
61
68
  from tomwer.core.process.reconstruction.axis import AxisRP
62
- import os
63
- import logging
64
- import copy
65
- import h5py
66
69
  from tomwer.core.process.reconstruction.scores import compute_score
67
70
  from tomwer.core.process.reconstruction.scores import ComputedScore
68
71
  from tomwer.core.process.reconstruction.scores import get_disk_mask_radius, apply_roi
69
72
  from tomwer.core.process.reconstruction.nabu.nabuscores import (
70
73
  run_nabu_one_slice_several_config,
71
74
  )
75
+ from tomwer.core.utils.scanutils import data_identifier_to_scan
72
76
 
73
77
 
74
78
  _logger = logging.getLogger(__name__)
@@ -145,12 +149,16 @@ def one_slice_several_cor(
145
149
  output_dir = os.path.join(scan.path, DEFAULT_RECONS_FOLDER)
146
150
 
147
151
  db = None
148
- pag = None
152
+ pag = False
153
+ ctf = False
149
154
  if "phase" in nabu_config:
150
- if "method" in nabu_config["phase"] and nabu_config["phase"]["method"] != "":
151
- if "delta_beta" in nabu_config["phase"]:
152
- pag = True
153
- db = round(float(nabu_config["phase"]["delta_beta"]))
155
+ phase_method = nabu_config["phase"].get("method", "").lower()
156
+ if phase_method in ("pag", "paganin"):
157
+ pag = True
158
+ elif phase_method in ("ctf",):
159
+ ctf = True
160
+ if "delta_beta" in nabu_config["phase"]:
161
+ db = round(float(nabu_config["phase"]["delta_beta"]))
154
162
 
155
163
  for cor, future_tomo_obj in future_tomo_objs.items():
156
164
  future_tomo_obj.results()
@@ -159,7 +167,11 @@ def one_slice_several_cor(
159
167
  continue
160
168
  else:
161
169
  _file_name = SingleSliceRunner.get_file_basename_reconstruction(
162
- scan=scan, slice_index=slice_index, pag=pag, db=db
170
+ scan=scan,
171
+ slice_index=slice_index,
172
+ pag=pag,
173
+ db=db,
174
+ ctf=ctf,
163
175
  )
164
176
  file_prefix = "cor_{}_{}".format(_file_name, cor)
165
177
 
@@ -256,7 +268,7 @@ def one_slice_several_cor(
256
268
  urls = tuple(volume.browse_data_urls())
257
269
  if len(urls) != 1:
258
270
  raise ValueError(
259
- "volume is expected to have at most one url (single slice volume)"
271
+ f"volume is expected to have at most one url (single slice volume). get {len(urls)}"
260
272
  )
261
273
  url = urls[0]
262
274
  if not isinstance(url, (DataUrl, str)):
@@ -463,7 +475,7 @@ class SAAxisProcess(
463
475
  )
464
476
 
465
477
  @staticmethod
466
- def autofocus(scan):
478
+ def autofocus(scan) -> Optional[float]:
467
479
  scores = scan.saaxis_params.scores
468
480
  if scores is None:
469
481
  return
@@ -482,9 +494,10 @@ class SAAxisProcess(
482
494
  scan.axis_params = AxisRP()
483
495
  scan.axis_params.frame_width = scan.dim_1
484
496
  scan.axis_params.set_relative_value(best_cor)
497
+ return best_cor
485
498
 
486
499
  def run(self):
487
- scan = self.inputs.data
500
+ scan = data_identifier_to_scan(self.inputs.data)
488
501
  if scan is None:
489
502
  self.outputs.data = None
490
503
  return
@@ -535,7 +548,20 @@ class SAAxisProcess(
535
548
  process_id=self.process_id,
536
549
  )
537
550
  scan.saaxis_params.scores = cors_res
538
- self.autofocus(scan=scan)
551
+ best_relative_cor = self.autofocus(scan=scan)
552
+
553
+ # store nabu settings to be used later like in the volume reconstruction
554
+ config = self.get_configuration()["nabu_params"]
555
+ # beam shape is not directly used by nabu (uses ctf_geometry directly)
556
+ config.get("phase", {}).pop("beam_shape", None)
557
+
558
+ # update nabu recons_params used
559
+ sc_config = get_default_nabu_config(nabu_fullfield_default_config)
560
+ sc_config.update(config)
561
+ scan.nabu_recons_params = sc_config
562
+ if best_relative_cor is not None:
563
+ scan.axis_params.relative_cor_values = best_relative_cor
564
+
539
565
  self._process_end(scan=scan, cors_res=cors_res, score_rois=rois)
540
566
  self.outputs.data = scan
541
567
 
@@ -32,7 +32,18 @@ __license__ = "MIT"
32
32
  __date__ = "28/10/2021"
33
33
 
34
34
 
35
+ import os
36
+ import logging
37
+ import h5py
38
+ import numpy
35
39
  from copy import copy
40
+ from typing import Optional, Union
41
+ from nabu.pipeline.config import get_default_nabu_config
42
+ from nabu.pipeline.fullfield.nabu_config import (
43
+ nabu_config as nabu_fullfield_default_config,
44
+ )
45
+ from processview.core.manager import ProcessManager, DatasetState
46
+ from processview.core.superviseprocess import SuperviseProcess
36
47
  from tomwer.core.process.reconstruction.nabu.nabucommon import (
37
48
  ResultSlurmRun,
38
49
  ResultsLocalRun,
@@ -42,8 +53,6 @@ from tomwer.core.scan.scanfactory import ScanFactory
42
53
  from .params import SADeltaBetaParams
43
54
  from tomwer.core.scan.scanbase import TomwerScanBase
44
55
  from tomwer.core.utils import logconfig
45
- from processview.core.manager import ProcessManager, DatasetState
46
- from processview.core.superviseprocess import SuperviseProcess
47
56
  from tomwer.core.process.task import Task
48
57
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
49
58
  from tomoscan.io import HDF5File
@@ -54,11 +63,6 @@ from tomwer.core.process.reconstruction.nabu.nabuslices import (
54
63
  )
55
64
  from tomwer.core.process.reconstruction.nabu.nabucommon import ResultsRun
56
65
  from tomwer.core.progress import Progress
57
- from typing import Optional, Union
58
- import os
59
- import logging
60
- import h5py
61
- import numpy
62
66
  from ..nabu import utils as nabu_utils
63
67
  from tomwer.core.process.reconstruction.scores import compute_score
64
68
  from tomwer.core.process.reconstruction.scores import ScoreMethod
@@ -66,6 +70,7 @@ from tomwer.core.process.reconstruction.scores import ComputedScore
66
70
  from tomwer.core.process.reconstruction.scores import get_disk_mask_radius, apply_roi
67
71
  from tomwer.core.process.reconstruction.nabu.nabuslices import SingleSliceRunner
68
72
  from tomwer.core.volume.volumefactory import VolumeFactory
73
+ from tomwer.core.utils.scanutils import data_identifier_to_scan
69
74
 
70
75
  _logger = logging.getLogger(__name__)
71
76
 
@@ -156,7 +161,9 @@ def one_slice_several_db(
156
161
  config["output"]["file_format"] = "hdf5"
157
162
  if "phase" not in config:
158
163
  config["phase"] = {}
159
- config["phase"]["delta_beta"] = db
164
+ config["phase"]["delta_beta"] = (
165
+ db,
166
+ ) # warning: at this tage delta_beta expects a list of value
160
167
  config["phase"]["method"] = "Paganin"
161
168
  res = run_single_slice_reconstruction(
162
169
  nabu_config=config,
@@ -185,9 +192,13 @@ def one_slice_several_db(
185
192
  advancement.increaseAdvancement(1)
186
193
 
187
194
  pag = False
195
+ ctf = False
188
196
  if "phase" in config:
189
- if "method" in config["phase"] and config["phase"]["method"] != "":
197
+ phase_method = config["phase"].get("method", "").lower()
198
+ if phase_method in ("pag", "paganin"):
190
199
  pag = True
200
+ elif phase_method in ("ctf",):
201
+ ctf = True
191
202
 
192
203
  # treat future.
193
204
  for db, future_tomo_obj_list in future_tomo_objs.items():
@@ -203,6 +214,7 @@ def one_slice_several_db(
203
214
  slice_index=slice_index,
204
215
  pag=pag,
205
216
  db=int(db) if db is not None else None,
217
+ ctf=ctf,
206
218
  )
207
219
  # retrieve url
208
220
  volume_identifier = nabu_utils.get_recons_volume_identifier(
@@ -371,7 +383,7 @@ class SADeltaBetaProcess(
371
383
  )
372
384
 
373
385
  @staticmethod
374
- def autofocus(scan):
386
+ def autofocus(scan) -> Optional[float]:
375
387
  scores = scan.sa_delta_beta_params.scores
376
388
  if scores is None:
377
389
  return
@@ -387,9 +399,10 @@ class SADeltaBetaProcess(
387
399
  best_db, best_score = cor, score
388
400
  scan.sa_delta_beta_params.autofocus = best_db
389
401
  scan.sa_delta_beta_params.value = best_db
402
+ return best_db
390
403
 
391
404
  def run(self):
392
- scan = self.inputs.data
405
+ scan = data_identifier_to_scan(self.inputs.data)
393
406
  if scan is None:
394
407
  self.outputs.data = scan
395
408
  return
@@ -418,7 +431,20 @@ class SADeltaBetaProcess(
418
431
  process_id=self.process_id,
419
432
  )
420
433
  scan.sa_delta_beta_params.scores = db_res
421
- self.autofocus(scan=scan)
434
+ best_db = self.autofocus(scan=scan)
435
+ # store nabu recons parameters to be used within the nabu volume for example.
436
+ config = self.get_configuration()["nabu_params"]
437
+ # beam shape is not directly used by nabu (uses ctf_geometry directly)
438
+ config.get("phase", {}).pop("beam_shape", None)
439
+ sc_config = get_default_nabu_config(nabu_fullfield_default_config)
440
+ sc_config.update(config)
441
+ if best_db is not None:
442
+ sc_config["phase"]["delta_beta"] = (
443
+ best_db,
444
+ ) # warning: at this tage delta_beta expects a list of value
445
+ scan.nabu_recons_params = sc_config
446
+
447
+ # end processing
422
448
  self._process_end(scan=scan, db_res=db_res, score_rois=rois)
423
449
  self.outputs.data = scan
424
450
 
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 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__ = "02/08/2017"
29
-
30
- import unittest
31
-
32
- from . import test_saaxis
33
-
34
-
35
- def suite():
36
- test_suite = unittest.TestSuite()
37
- test_suite.addTest(test_saaxis.suite())
38
-
39
- return test_suite
@@ -1,6 +1,9 @@
1
1
  import os
2
2
  import pytest
3
- from tomwer.core.process.reconstruction.axis.params import AxisResource
3
+ from tomwer.core.process.reconstruction.axis.params import (
4
+ AxisResource,
5
+ AxisCalculationInput,
6
+ )
4
7
  from tomwer.core.utils.scanutils import MockHDF5
5
8
  import numpy
6
9
 
@@ -22,7 +25,8 @@ def test_axis_resource(tmp_path):
22
25
  first_proj = list(scan.projections.keys())[0]
23
26
  data_url = scan.projections[first_proj]
24
27
 
25
- axis_resource = AxisResource(data_url)
28
+ axis_resource = AxisResource(url=data_url)
29
+ assert axis_resource.data is not None
26
30
 
27
31
  with pytest.raises(TypeError):
28
32
  axis_resource.normalize_data(scan=None, log_=True)
@@ -34,4 +38,22 @@ def test_axis_resource(tmp_path):
34
38
 
35
39
  assert isinstance(axis_resource.normalized_data_paganin, numpy.ndarray)
36
40
 
37
- assert isinstance(axis_resource.normalized_data_paganin, numpy.ndarray)
41
+ assert isinstance(str(axis_resource), str)
42
+ axis_resource.data = None
43
+ assert axis_resource is not None
44
+
45
+
46
+ def test_AxisCalculationInput():
47
+ """test all class AxisCalculationInput which is a bit 'malformed'"""
48
+ assert (
49
+ AxisCalculationInput.from_value("transmission_withpag")
50
+ is AxisCalculationInput.transmission_pag
51
+ )
52
+ assert (
53
+ AxisCalculationInput.from_value("transmission_nopag")
54
+ is AxisCalculationInput.transmission
55
+ )
56
+ assert (
57
+ AxisCalculationInput.from_value("transmission")
58
+ is AxisCalculationInput.transmission
59
+ )