httomo-backends 0.5__tar.gz → 0.5.2__tar.gz

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 (155) hide show
  1. {httomo_backends-0.5 → httomo_backends-0.5.2}/PKG-INFO +1 -1
  2. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/recon/algorithm.py +133 -53
  3. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/recon/peak_memory_line_profile_hook.py +44 -21
  4. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/json_pipelines_generator.py +104 -53
  5. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_pipelines_generator.py +0 -4
  6. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_templates_generator.py +7 -2
  7. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.morph/sino_360_to_180.yaml +1 -1
  8. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/PKG-INFO +1 -1
  9. {httomo_backends-0.5 → httomo_backends-0.5.2}/pyproject.toml +1 -1
  10. {httomo_backends-0.5 → httomo_backends-0.5.2}/tests/test_httomolibgpu.py +64 -21
  11. {httomo_backends-0.5 → httomo_backends-0.5.2}/LICENSE +0 -0
  12. {httomo_backends-0.5 → httomo_backends-0.5.2}/README.rst +0 -0
  13. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/__init__.py +0 -0
  14. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/cufft.py +0 -0
  15. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/__init__.py +0 -0
  16. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/__init__.py +0 -0
  17. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolib/httomolib.yaml +0 -0
  18. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolib/httomolib_modules.yaml +0 -0
  19. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/__init__.py +0 -0
  20. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/httomolibgpu.yaml +0 -0
  21. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/httomolibgpu_modules.yaml +0 -0
  22. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/__init__.py +0 -0
  23. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/__init__.py +0 -0
  24. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/corr.py +0 -0
  25. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/denoise.py +0 -0
  26. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/morph.py +0 -0
  27. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/rescale.py +0 -0
  28. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/__init__.py +0 -0
  29. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/normalize.py +0 -0
  30. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/phase.py +0 -0
  31. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/stripe.py +0 -0
  32. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/recon/__init__.py +0 -0
  33. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/__init__.py +0 -0
  34. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/__init__.py +0 -0
  35. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/misc/__init__.py +0 -0
  36. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/misc/corr.py +0 -0
  37. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/prep/__init__.py +0 -0
  38. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/prep/stripe.py +0 -0
  39. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/recon/__init__.py +0 -0
  40. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/recon/algorithm.py +0 -0
  41. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/tomopy.yaml +0 -0
  42. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/tomopy_modules.yaml +0 -0
  43. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/httomo.yaml +0 -0
  44. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/query.py +0 -0
  45. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP2d_astra_directive.yaml +0 -0
  46. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_denoising_directive.yaml +0 -0
  47. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_directive.yaml +0 -0
  48. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_noimagesaving_directive.yaml +0 -0
  49. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/LPRec3d_tomobar_directive.yaml +0 -0
  50. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/__init__.py +0 -0
  51. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/deg360_distortion_FBP3d_tomobar_directive.yaml +0 -0
  52. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/deg360_paganin_FBP3d_tomobar_directive.yaml +0 -0
  53. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/sweep_center_FBP3d_tomobar_directive.yaml +0 -0
  54. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/tomopy_gridrec_directive.yaml +0 -0
  55. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/__init__.py +0 -0
  56. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_unsupported_tomopy_remove.py +0 -0
  57. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/__init__.py +0 -0
  58. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.data.hdf.loaders/standard_tomo.yaml +0 -0
  59. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.methods/calculate_stats.yaml +0 -0
  60. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.methods/save_intermediate_data.yaml +0 -0
  61. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/__init__.py +0 -0
  62. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.images/save_to_images.yaml +0 -0
  63. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.morph/data_reducer.yaml +0 -0
  64. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.segm/binary_thresholding.yaml +0 -0
  65. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.prep.phase/paganin_filter.yaml +0 -0
  66. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/__init__.py +0 -0
  67. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.corr/median_filter.yaml +0 -0
  68. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.corr/remove_outlier.yaml +0 -0
  69. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.denoise/total_variation_PD.yaml +0 -0
  70. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.denoise/total_variation_ROF.yaml +0 -0
  71. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.morph/data_resampler.yaml +0 -0
  72. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.rescale/rescale_to_int.yaml +0 -0
  73. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.alignment/distortion_correction_proj_discorpy.yaml +0 -0
  74. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.normalize/normalize.yaml +0 -0
  75. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.phase/paganin_filter_savu.yaml +0 -0
  76. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.phase/paganin_filter_tomopy.yaml +0 -0
  77. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/raven_filter.yaml +0 -0
  78. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_all_stripe.yaml +0 -0
  79. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_stripe_based_sorting.yaml +0 -0
  80. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_stripe_ti.yaml +0 -0
  81. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/CGLS3d_tomobar.yaml +0 -0
  82. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/FBP2d_astra.yaml +0 -0
  83. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/FBP3d_tomobar.yaml +0 -0
  84. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/LPRec3d_tomobar.yaml +0 -0
  85. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/SIRT3d_tomobar.yaml +0 -0
  86. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_360.yaml +0 -0
  87. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_pc.yaml +0 -0
  88. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_vo.yaml +0 -0
  89. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/__init__.py +0 -0
  90. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/adjust_range.yaml +0 -0
  91. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/circ_mask.yaml +0 -0
  92. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/gaussian_filter.yaml +0 -0
  93. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter.yaml +0 -0
  94. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter3d.yaml +0 -0
  95. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter_nonfinite.yaml +0 -0
  96. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_nan.yaml +0 -0
  97. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_neg.yaml +0 -0
  98. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier.yaml +0 -0
  99. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier1d.yaml +0 -0
  100. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier3d.yaml +0 -0
  101. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_ring.yaml +0 -0
  102. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/sobel_filter.yaml +0 -0
  103. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/downsample.yaml +0 -0
  104. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/pad.yaml +0 -0
  105. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/sino_360_to_180.yaml +0 -0
  106. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/trim_sinogram.yaml +0 -0
  107. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/upsample.yaml +0 -0
  108. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/add_jitter.yaml +0 -0
  109. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/add_noise.yaml +0 -0
  110. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/align_joint.yaml +0 -0
  111. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/align_seq.yaml +0 -0
  112. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/blur_edges.yaml +0 -0
  113. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/distortion_correction_proj.yaml +0 -0
  114. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/distortion_correction_sino.yaml +0 -0
  115. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/scale.yaml +0 -0
  116. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/shift_images.yaml +0 -0
  117. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/minus_log.yaml +0 -0
  118. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize.yaml +0 -0
  119. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_bg.yaml +0 -0
  120. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_nf.yaml +0 -0
  121. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_roi.yaml +0 -0
  122. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.phase/retrieve_phase.yaml +0 -0
  123. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_all_stripe.yaml +0 -0
  124. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_dead_stripe.yaml +0 -0
  125. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_large_stripe.yaml +0 -0
  126. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_filtering.yaml +0 -0
  127. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_fitting.yaml +0 -0
  128. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_interpolation.yaml +0 -0
  129. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_sorting.yaml +0 -0
  130. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_fw.yaml +0 -0
  131. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_sf.yaml +0 -0
  132. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_ti.yaml +0 -0
  133. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/stripes_detect3d.yaml +0 -0
  134. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/stripes_mask3d.yaml +0 -0
  135. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.algorithm/recon.yaml +0 -0
  136. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center.yaml +0 -0
  137. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center_pc.yaml +0 -0
  138. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center_vo.yaml +0 -0
  139. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_drift.yaml +0 -0
  140. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_focal_spot_blur.yaml +0 -0
  141. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_gaussian.yaml +0 -0
  142. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_poisson.yaml +0 -0
  143. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_rings.yaml +0 -0
  144. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_salt_pepper.yaml +0 -0
  145. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_zingers.yaml +0 -0
  146. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project.yaml +0 -0
  147. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project2.yaml +0 -0
  148. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project3.yaml +0 -0
  149. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/SOURCES.txt +0 -0
  150. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/dependency_links.txt +0 -0
  151. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/requires.txt +0 -0
  152. {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/top_level.txt +0 -0
  153. {httomo_backends-0.5 → httomo_backends-0.5.2}/setup.cfg +0 -0
  154. {httomo_backends-0.5 → httomo_backends-0.5.2}/tests/test_method_query.py +0 -0
  155. {httomo_backends-0.5 → httomo_backends-0.5.2}/tests/test_tomopy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httomo-backends
3
- Version: 0.5
3
+ Version: 0.5.2
4
4
  Summary: Supplementary files for HTTomo backends.
5
5
  Author: Garry ODonnell, Jacob Williamson
6
6
  Author-email: Daniil Kazantsev <daniil.kazantsev@diamond.ac.uk>, Yousef Moazzam <yousef.moazzam@diamond.ac.uk>, Jessica Verschoyle <jessica.verschoyle@diamond.ac.uk>, Naman Gera <naman.gera@diamond.ac.uk>, scientificsoftware@diamond.ac.uk
@@ -159,7 +159,6 @@ def _calc_memory_bytes_FBP3d_tomobar(
159
159
  return (tot_memory_bytes, fixed_amount)
160
160
 
161
161
 
162
-
163
162
  def _calc_memory_bytes_LPRec3d_tomobar(
164
163
  non_slice_dims_shape: Tuple[int, int],
165
164
  dtype: np.dtype,
@@ -170,6 +169,7 @@ def _calc_memory_bytes_LPRec3d_tomobar(
170
169
  angles_tot = non_slice_dims_shape[0]
171
170
  DetectorsLengthH = non_slice_dims_shape[1]
172
171
  SLICES = 200 # dummy multiplier+divisor to pass large batch size threshold
172
+ _CENTER_SIZE_MIN = 192 # must be divisible by 8
173
173
 
174
174
  n = DetectorsLengthH
175
175
 
@@ -180,7 +180,11 @@ def _calc_memory_bytes_LPRec3d_tomobar(
180
180
 
181
181
  eps = 1e-4 # accuracy of usfft
182
182
  mu = -np.log(eps) / (2 * n * n)
183
- m = int(np.ceil(2 * n * 1 / np.pi * np.sqrt(-mu * np.log(eps) + (mu * n) * (mu * n) / 4)))
183
+ m = int(
184
+ np.ceil(
185
+ 2 * n * 1 / np.pi * np.sqrt(-mu * np.log(eps) + (mu * n) * (mu * n) / 4)
186
+ )
187
+ )
184
188
 
185
189
  center_size = 6144
186
190
  center_size = min(center_size, n * 2 + m * 2)
@@ -192,77 +196,153 @@ def _calc_memory_bytes_LPRec3d_tomobar(
192
196
  if "angles" in kwargs:
193
197
  angles = kwargs["angles"]
194
198
  sorted_theta_cpu = np.sort(angles)
195
- theta_full_range = abs(sorted_theta_cpu[angles_tot-1] - sorted_theta_cpu[0])
199
+ theta_full_range = abs(sorted_theta_cpu[angles_tot - 1] - sorted_theta_cpu[0])
196
200
  angle_range_pi_count = 1 + int(np.ceil(theta_full_range / math.pi))
201
+ angle_range_pi_count += 1 # account for difference from actual algorithm
197
202
  else:
198
- angle_range_pi_count = 1 + int(np.ceil(2)) # assume a 2 * PI projection angle range
203
+ angle_range_pi_count = 1 + int(
204
+ np.ceil(2)
205
+ ) # assume a 2 * PI projection angle range
206
+
207
+ chunk_count = 4
199
208
 
200
209
  output_dims = __calc_output_dim_recon(non_slice_dims_shape, **kwargs)
201
210
  if odd_horiz:
202
211
  output_dims = tuple(x + 1 for x in output_dims)
203
212
 
204
213
  in_slice_size = np.prod(non_slice_dims_shape) * dtype.itemsize
205
- padded_in_slice_size = np.prod(non_slice_dims_shape) * np.float32().itemsize
214
+ padded_in_slice_size = angles_tot * n * np.float32().itemsize
215
+
206
216
  theta_size = angles_tot * np.float32().itemsize
207
- sorted_theta_indices_size = angles_tot * np.int64().itemsize
208
- sorted_theta_size = angles_tot * np.float32().itemsize
209
- recon_output_size = (n + 1) * (n + 1) * np.float32().itemsize if odd_horiz else n * n * np.float32().itemsize # 264
210
- linspace_size = n * np.float32().itemsize
211
- meshgrid_size = 2 * n * n * np.float32().itemsize
212
- phi_size = 6 * n * n * np.float32().itemsize
213
- angle_range_size = center_size * center_size * 1 + angle_range_pi_count * 2 * np.int32().itemsize
214
- c1dfftshift_size = n * np.int8().itemsize
215
- c2dfftshift_slice_size = 4 * n * n * np.int8().itemsize
216
217
  filter_size = (n // 2 + 1) * np.float32().itemsize
217
218
  rfftfreq_size = filter_size
218
219
  scaled_filter_size = filter_size
219
- tmp_p_input_slice = np.prod(non_slice_dims_shape) * np.float32().itemsize
220
- padded_tmp_p_input_slice = angles_tot * (n + padding_m * 2) * dtype.itemsize
221
- rfft_result_size = padded_tmp_p_input_slice
222
- filtered_rfft_result_size = rfft_result_size
223
- rfft_plan_slice_size = cufft_estimate_1d(nx=(n + padding_m * 2),fft_type=CufftType.CUFFT_R2C,batch=angles_tot * SLICES) / SLICES
224
- irfft_result_size = filtered_rfft_result_size
225
- irfft_scratch_memory_size = filtered_rfft_result_size
226
- irfft_plan_slice_size = cufft_estimate_1d(nx=(n + padding_m * 2),fft_type=CufftType.CUFFT_C2R,batch=angles_tot * SLICES) / SLICES
227
- conversion_to_complex_size = np.prod(non_slice_dims_shape) * np.complex64().itemsize / 2
228
- datac_size = np.prod(non_slice_dims_shape) * np.complex64().itemsize / 2
229
- fde_size = (2 * m + 2 * n) * (2 * m + 2 * n) * np.complex64().itemsize / 2
230
- shifted_datac_size = datac_size
231
- fft_result_size = datac_size
232
- backshifted_datac_size = datac_size
233
- scaled_backshifted_datac_size = datac_size
234
- fft_plan_slice_size = cufft_estimate_1d(nx=n,fft_type=CufftType.CUFFT_C2C,batch=angles_tot * SLICES) / SLICES
235
- fde_view_size = 4 * n * n * np.complex64().itemsize / 2
236
- shifted_fde_view_size = fde_view_size
237
- ifft2_scratch_memory_size = fde_view_size
238
- ifft2_plan_slice_size = cufft_estimate_2d(nx=(2 * n),ny=(2 * n),fft_type=CufftType.CUFFT_C2C) / 2
239
- fde2_size = n * n * np.complex64().itemsize / 2
240
- concatenate_size = fde2_size
241
- circular_mask_size = np.prod(output_dims) / 2 * np.int64().itemsize * 4
242
220
 
243
- after_recon_swapaxis_slice = np.prod(non_slice_dims_shape) * np.float32().itemsize
221
+ tmp_p_input_slice = angles_tot * n * np.float32().itemsize
244
222
 
245
- tot_memory_bytes = int(
246
- max(
247
- in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + tmp_p_input_slice + padded_tmp_p_input_slice + rfft_result_size + filtered_rfft_result_size + irfft_result_size + irfft_scratch_memory_size
248
- , in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + tmp_p_input_slice + datac_size + conversion_to_complex_size
249
- , in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + fft_plan_slice_size + fde_size + datac_size + shifted_datac_size + fft_result_size + backshifted_datac_size + scaled_backshifted_datac_size
250
- , in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + fft_plan_slice_size + ifft2_plan_slice_size + shifted_fde_view_size + ifft2_scratch_memory_size
251
- , in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + fft_plan_slice_size + ifft2_plan_slice_size + fde2_size + concatenate_size
252
- , in_slice_size + padded_in_slice_size + recon_output_size + rfft_plan_slice_size + irfft_plan_slice_size + fft_plan_slice_size + ifft2_plan_slice_size + after_recon_swapaxis_slice
223
+ padded_tmp_p_input_slice = angles_tot * (n + padding_m * 2) * np.float32().itemsize
224
+ rfft_plan_slice_size = (
225
+ cufft_estimate_1d(
226
+ nx=n + padding_m * 2,
227
+ fft_type=CufftType.CUFFT_R2C,
228
+ batch=angles_tot * SLICES,
253
229
  )
230
+ / SLICES
254
231
  )
255
-
256
- fixed_amount = int(
257
- max(
258
- theta_size + phi_size + linspace_size + meshgrid_size
259
- , theta_size + sorted_theta_indices_size + sorted_theta_size + phi_size + angle_range_size + c1dfftshift_size + c2dfftshift_slice_size + filter_size + rfftfreq_size + scaled_filter_size
260
- , theta_size + sorted_theta_indices_size + sorted_theta_size + phi_size + circular_mask_size
232
+ rfft_result_size = angles_tot * (n + padding_m * 2) * np.complex64().itemsize
233
+ filtered_rfft_result_size = rfft_result_size
234
+ irfft_plan_slice_size = (
235
+ cufft_estimate_1d(
236
+ nx=(n + padding_m * 2),
237
+ fft_type=CufftType.CUFFT_C2R,
238
+ batch=angles_tot * SLICES,
261
239
  )
240
+ / SLICES
262
241
  )
242
+ irfft_scratch_memory_size = filtered_rfft_result_size * 2
243
+ irfft_result_size = angles_tot * (n + padding_m * 2) * np.float32().itemsize
263
244
 
264
- return (tot_memory_bytes * 1.1, fixed_amount)
245
+ datac_size = angles_tot * n * np.complex64().itemsize / 2
246
+ fde_size = (2 * m + 2 * n) * (2 * m + 2 * n) * np.complex64().itemsize / 2
247
+ fft_plan_slice_size = (
248
+ cufft_estimate_1d(nx=n, fft_type=CufftType.CUFFT_C2C, batch=angles_tot * SLICES)
249
+ / SLICES
250
+ )
251
+ fft_result_size = datac_size
265
252
 
253
+ sorted_theta_indices_size = angles_tot * np.int64().itemsize
254
+ sorted_theta_size = angles_tot * np.float32().itemsize
255
+ angle_range_size = (
256
+ center_size * center_size * (1 + angle_range_pi_count * 2) * np.int16().itemsize
257
+ )
258
+
259
+ recon_output_size = DetectorsLengthH * DetectorsLengthH * np.float32().itemsize
260
+ ifft2_plan_slice_size = (
261
+ cufft_estimate_2d(
262
+ nx=(2 * m + 2 * n), ny=(2 * m + 2 * n), fft_type=CufftType.CUFFT_C2C
263
+ )
264
+ / 2
265
+ )
266
+ circular_mask_size = np.prod(output_dims) / 2 * np.int64().itemsize * 4
267
+ after_recon_swapaxis_slice = recon_output_size
268
+
269
+ tot_memory_bytes = 0
270
+ current_tot_memory_bytes = 0
271
+
272
+ fixed_amount = 0
273
+ current_fixed_amount = 0
274
+
275
+ def add_to_memory_counters(amount, per_slice: bool):
276
+ nonlocal tot_memory_bytes
277
+ nonlocal current_tot_memory_bytes
278
+ nonlocal fixed_amount
279
+ nonlocal current_fixed_amount
280
+
281
+ if per_slice:
282
+ current_tot_memory_bytes += amount
283
+ tot_memory_bytes = max(tot_memory_bytes, current_tot_memory_bytes)
284
+ else:
285
+ current_fixed_amount += amount
286
+ fixed_amount = max(fixed_amount, current_fixed_amount)
287
+
288
+ add_to_memory_counters(in_slice_size, True)
289
+ add_to_memory_counters(padded_in_slice_size, True)
290
+
291
+ add_to_memory_counters(theta_size, False)
292
+ if center_size >= _CENTER_SIZE_MIN:
293
+ add_to_memory_counters(sorted_theta_indices_size, False)
294
+ add_to_memory_counters(sorted_theta_size, False)
295
+ add_to_memory_counters(angle_range_size, False)
296
+ add_to_memory_counters(filter_size, False)
297
+ add_to_memory_counters(rfftfreq_size, False)
298
+ add_to_memory_counters(scaled_filter_size, False)
299
+
300
+ add_to_memory_counters(tmp_p_input_slice, True)
301
+
302
+ add_to_memory_counters(rfft_plan_slice_size / chunk_count * 2, True)
303
+ add_to_memory_counters(irfft_plan_slice_size / chunk_count * 2, True)
304
+ # add_to_memory_counters(irfft_scratch_memory_size / chunk_count, True)
305
+ for _ in range(0, chunk_count):
306
+ add_to_memory_counters(padded_tmp_p_input_slice / chunk_count, True)
307
+
308
+ add_to_memory_counters(rfft_result_size / chunk_count, True)
309
+ add_to_memory_counters(filtered_rfft_result_size / chunk_count, True)
310
+ add_to_memory_counters(-rfft_result_size / chunk_count, True)
311
+ add_to_memory_counters(-padded_tmp_p_input_slice / chunk_count, True)
312
+
313
+ add_to_memory_counters(irfft_scratch_memory_size / chunk_count, True)
314
+ add_to_memory_counters(-irfft_scratch_memory_size / chunk_count, True)
315
+ add_to_memory_counters(irfft_result_size / chunk_count, True)
316
+ add_to_memory_counters(-filtered_rfft_result_size / chunk_count, True)
317
+
318
+ add_to_memory_counters(-irfft_result_size / chunk_count, True)
319
+
320
+ add_to_memory_counters(-padded_in_slice_size, True)
321
+ add_to_memory_counters(-filter_size, False)
322
+ add_to_memory_counters(-rfftfreq_size, False)
323
+ add_to_memory_counters(-scaled_filter_size, False)
324
+
325
+ add_to_memory_counters(datac_size, True)
326
+ add_to_memory_counters(fde_size, True)
327
+ add_to_memory_counters(-tmp_p_input_slice, True)
328
+ add_to_memory_counters(fft_plan_slice_size, True)
329
+ add_to_memory_counters(fft_result_size, True)
330
+ add_to_memory_counters(-datac_size, True)
331
+
332
+ add_to_memory_counters(-fft_result_size, True)
333
+
334
+ add_to_memory_counters(ifft2_plan_slice_size / chunk_count * 2, True)
335
+ for _ in range(0, chunk_count):
336
+ add_to_memory_counters(fde_size / chunk_count, True)
337
+ add_to_memory_counters(-fde_size / chunk_count, True)
338
+
339
+ add_to_memory_counters(recon_output_size, True)
340
+ add_to_memory_counters(-fde_size, True)
341
+ add_to_memory_counters(circular_mask_size, False)
342
+ add_to_memory_counters(after_recon_swapaxis_slice, True)
343
+
344
+ return (tot_memory_bytes * 1.05, fixed_amount + 250 * 1024 * 1024)
345
+ # return (tot_memory_bytes, fixed_amount)
266
346
 
267
347
 
268
348
  def _calc_memory_bytes_SIRT3d_tomobar(
@@ -6,7 +6,7 @@ from cupy.cuda import memory_hook
6
6
 
7
7
 
8
8
  class PeakMemoryLineProfileHook(memory_hook.MemoryHook):
9
- name = 'LineProfileHook'
9
+ name = "LineProfileHook"
10
10
 
11
11
  def __init__(self, running_peak_root_file_names, max_depth=0):
12
12
  self._memory_frames = {}
@@ -45,15 +45,11 @@ class PeakMemoryLineProfileHook(memory_hook.MemoryHook):
45
45
  def _extract_stackframes(self):
46
46
  stackframes = traceback.extract_stack()
47
47
  stackframes = [StackFrame(st) for st in stackframes]
48
- stackframes = [
49
- st for st in stackframes if st.filename != self._filename]
48
+ stackframes = [st for st in stackframes if st.filename != self._filename]
50
49
  return stackframes
51
50
 
52
51
  def _key_frame(self, parent, stackframe):
53
- return (parent,
54
- stackframe.filename,
55
- stackframe.lineno,
56
- stackframe.name)
52
+ return (parent, stackframe.filename, stackframe.lineno, stackframe.name)
57
53
 
58
54
  def _add_frame(self, parent, stackframe):
59
55
  key = self._key_frame(parent, stackframe)
@@ -66,17 +62,26 @@ class PeakMemoryLineProfileHook(memory_hook.MemoryHook):
66
62
 
67
63
  def print_report(self, file=sys.stdout):
68
64
  """Prints a report of line memory profiling."""
69
- line = '_root (%s, %s, %s)\n' % self._root.humanized_bytes()
65
+ line = "_root (%s, %s, %s)\n" % self._root.humanized_bytes()
70
66
  file.write(line)
71
67
 
72
68
  running_peak_bytes = [0]
73
69
  running_used_bytes = [0]
74
70
  for child in self._root.children:
75
- self._print_frame(child, running_peak_bytes, running_used_bytes, depth=1, file=file)
71
+ self._print_frame(
72
+ child, running_peak_bytes, running_used_bytes, depth=1, file=file
73
+ )
76
74
  file.flush()
77
75
 
78
- def _print_frame(self, memory_frame, running_peak_bytes, running_used_bytes, depth=0, file=sys.stdout):
79
- indent = ' ' * (depth * 2)
76
+ def _print_frame(
77
+ self,
78
+ memory_frame,
79
+ running_peak_bytes,
80
+ running_used_bytes,
81
+ depth=0,
82
+ file=sys.stdout,
83
+ ):
84
+ indent = " " * (depth * 2)
80
85
  st = memory_frame.stackframe
81
86
  used_bytes, acquired_bytes, freed_bytes = memory_frame.humanized_bytes()
82
87
 
@@ -87,15 +92,33 @@ class PeakMemoryLineProfileHook(memory_hook.MemoryHook):
87
92
  running_peak_bytes[0] = max(running_peak_bytes[0], running_used_bytes[0])
88
93
  running_used_bytes[0] -= memory_frame.freed_bytes
89
94
 
90
- humanized_running_peak_bytes = MemoryFrame.humanized_size(running_peak_bytes[0])
91
- humanized_running_used_bytes = MemoryFrame.humanized_size(running_used_bytes[0])
92
-
93
- line = '%s%s:%s:%s (%s, %s, %s, %s, %s)\n' % (
94
- indent, st.filename, st.lineno, st.name,
95
- used_bytes, acquired_bytes, freed_bytes, humanized_running_peak_bytes, humanized_running_used_bytes)
95
+ humanized_running_peak_bytes = MemoryFrame.humanized_size(
96
+ running_peak_bytes[0]
97
+ )
98
+ humanized_running_used_bytes = MemoryFrame.humanized_size(
99
+ running_used_bytes[0]
100
+ )
101
+
102
+ line = "%s%s:%s:%s (%s, %s, %s, %s, %s)\n" % (
103
+ indent,
104
+ st.filename,
105
+ st.lineno,
106
+ st.name,
107
+ used_bytes,
108
+ acquired_bytes,
109
+ freed_bytes,
110
+ humanized_running_peak_bytes,
111
+ humanized_running_used_bytes,
112
+ )
96
113
  file.write(line)
97
114
  for child in memory_frame.children:
98
- self._print_frame(child, running_peak_bytes, running_used_bytes, depth=depth + 1, file=file)
115
+ self._print_frame(
116
+ child,
117
+ running_peak_bytes,
118
+ running_used_bytes,
119
+ depth=depth + 1,
120
+ file=file,
121
+ )
99
122
 
100
123
 
101
124
  class StackFrame(object):
@@ -147,11 +170,11 @@ class MemoryFrame(object):
147
170
 
148
171
  @staticmethod
149
172
  def humanized_size(size):
150
- for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E']:
173
+ for unit in ["", "K", "M", "G", "T", "P", "E"]:
151
174
  if size < 1024.0:
152
- return '%3.2f%sB' % (size, unit)
175
+ return "%3.2f%sB" % (size, unit)
153
176
  size /= 1024.0
154
- return '%.2f%sB' % (size, 'Z')
177
+ return "%.2f%sB" % (size, "Z")
155
178
 
156
179
  def _set_parent(self, parent):
157
180
  if parent and parent not in parent.children:
@@ -20,29 +20,33 @@ result = process_all_yaml_files()
20
20
  """
21
21
 
22
22
  # Directory containing YAML files relative to this script
23
- PIPELINES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "pipelines_full")
23
+ PIPELINES_DIR = os.path.join(
24
+ os.path.dirname(os.path.abspath(__file__)), "..", "pipelines_full"
25
+ )
26
+
27
+ ignored_methods = ["standard_tomo", "calculate_stats"]
24
28
 
25
- ignored_methods = ["standard_tomo","calculate_stats"]
26
29
 
27
30
  def get_yaml_path(yaml_filename: str) -> str:
28
31
  """
29
32
  Get the full path to a YAML file in the pipelines_full directory.
30
-
33
+
31
34
  Args:
32
35
  yaml_filename: Name of the YAML file (e.g., "example.yaml")
33
-
36
+
34
37
  Returns:
35
38
  Full path to the YAML file
36
39
  """
37
40
  return os.path.join(PIPELINES_DIR, yaml_filename)
38
41
 
42
+
39
43
  def import_module_safely(module_name: str):
40
44
  """
41
45
  Safely import a module handling potential import errors
42
-
46
+
43
47
  Args:
44
48
  module_name: The name of the module to import
45
-
49
+
46
50
  Returns:
47
51
  The imported module or None if import fails
48
52
  """
@@ -50,21 +54,24 @@ def import_module_safely(module_name: str):
50
54
  return importlib.import_module(module_name)
51
55
  except ImportError as e:
52
56
  missing_module = str(e).split("'")[1] if "'" in str(e) else str(e)
53
- print(f"Warning: Could not import dependency '{missing_module}' for module '{module_name}'")
57
+ print(
58
+ f"Warning: Could not import dependency '{missing_module}' for module '{module_name}'"
59
+ )
54
60
  print(f"You may need to install it using: pip install {missing_module}")
55
61
  return None
56
62
  except Exception as e:
57
63
  print(f"Warning: Error importing module '{module_name}': {str(e)}")
58
64
  return None
59
65
 
66
+
60
67
  def inspect_method_parameters(module_name: str, method_name: str) -> Dict[str, Any]:
61
68
  """
62
69
  Inspect a method's parameters from a given module
63
-
70
+
64
71
  Args:
65
72
  module_name: The full path to the module
66
73
  method_name: Name of the method to inspect
67
-
74
+
68
75
  Returns:
69
76
  Dictionary of parameter names and their default values
70
77
  """
@@ -72,26 +79,46 @@ def inspect_method_parameters(module_name: str, method_name: str) -> Dict[str, A
72
79
  module = import_module_safely(module_name)
73
80
  if module is None:
74
81
  # Return empty parameters if module import failed
75
- return {}
82
+ return {}
76
83
  try:
77
84
  # Get the method
78
85
  method = getattr(module, method_name)
79
-
86
+
80
87
  # Get method signature
81
88
  signature = inspect.signature(method)
82
-
89
+
83
90
  # Create parameters dictionary
84
91
  parameters = {}
85
-
92
+
86
93
  # List of parameters to skip
87
94
  skip_params = [
88
- "in_file", "data_in", "tomo", "arr", "prj", "data",
89
- "ncore", "nchunk", "flats", "flat", "dark", "darks",
90
- "theta", "out", "ang", "comm_rank", "out_dir", "angles",
91
- "gpu_id", "comm", "offset", "shift_xy", "step_xy",
92
- "jpeg_quality", "watermark_vals"
95
+ "in_file",
96
+ "data_in",
97
+ "tomo",
98
+ "arr",
99
+ "prj",
100
+ "data",
101
+ "ncore",
102
+ "nchunk",
103
+ "flats",
104
+ "flat",
105
+ "dark",
106
+ "darks",
107
+ "theta",
108
+ "out",
109
+ "ang",
110
+ "comm_rank",
111
+ "out_dir",
112
+ "angles",
113
+ "gpu_id",
114
+ "comm",
115
+ "offset",
116
+ "shift_xy",
117
+ "step_xy",
118
+ "jpeg_quality",
119
+ "watermark_vals",
93
120
  ]
94
-
121
+
95
122
  # Process parameters
96
123
  for param_name, param in signature.parameters.items():
97
124
  if param_name not in skip_params:
@@ -100,120 +127,144 @@ def inspect_method_parameters(module_name: str, method_name: str) -> Dict[str, A
100
127
  elif param_name == "asynchronous":
101
128
  parameters[param_name] = True
102
129
  elif param_name == "center":
103
- parameters[param_name] = "${centering.side_outputs.centre_of_rotation}"
130
+ parameters[param_name] = (
131
+ "${centering.side_outputs.centre_of_rotation}"
132
+ )
104
133
  elif param_name == "glob_stats":
105
134
  parameters[param_name] = "${statistics.side_outputs.glob_stats}"
106
135
  elif param_name == "overlap":
107
136
  parameters[param_name] = "${centering.side_outputs.overlap}"
108
137
  else:
109
138
  # Get default value if it exists, otherwise mark as REQUIRED
110
- default = param.default if param.default != inspect.Parameter.empty else "REQUIRED"
139
+ default = (
140
+ param.default
141
+ if param.default != inspect.Parameter.empty
142
+ else "REQUIRED"
143
+ )
111
144
  parameters[param_name] = default
112
-
145
+
113
146
  return parameters
114
-
147
+
115
148
  except Exception as e:
116
- print(f"Warning: Error inspecting method '{method_name}' in module '{module_name}': {str(e)}")
149
+ print(
150
+ f"Warning: Error inspecting method '{method_name}' in module '{module_name}': {str(e)}"
151
+ )
117
152
  return {}
118
153
 
154
+
119
155
  def json_pipeline_generator(input_yaml: str) -> Dict[str, Any]:
120
156
  """
121
157
  Generate JSON pipeline from YAML directive
122
-
158
+
123
159
  Args:
124
160
  input_yaml: Path to input YAML directive file
125
-
161
+
126
162
  Returns:
127
163
  Dictionary with methods information if successful, or empty dictionary if error occurred
128
164
  """
129
165
  try:
130
166
  # Read input YAML
131
- with open(input_yaml, 'r') as file:
167
+ with open(input_yaml, "r") as file:
132
168
  pipeline = yaml.safe_load(file)
133
-
169
+
134
170
  # Dictionary to store methods information
135
171
  methods_info = {}
136
-
172
+
137
173
  # Process each method in pipeline
138
174
  for item in pipeline:
139
- method_name = item['method']
140
- module_path = item['module_path']
175
+ method_name = item["method"]
176
+ module_path = item["module_path"]
141
177
  # Skip ignored methods
142
- if method_name not in ignored_methods:
178
+ if method_name not in ignored_methods:
143
179
  print(f"Processing method: {method_name} from module: {module_path}")
144
180
  # Get method parameters
145
181
  parameters = inspect_method_parameters(module_path, method_name)
146
182
  # Add to methods info even if parameters are empty
147
183
  methods_info[method_name] = {
148
- 'module_path': module_path,
149
- 'parameters': parameters
184
+ "module_path": module_path,
185
+ "parameters": parameters,
150
186
  }
151
187
  return methods_info
152
-
188
+
153
189
  except Exception as e:
154
190
  print(f"Error occurred: {str(e)}")
155
191
  return {}
156
192
 
193
+
157
194
  import json
158
195
  import os
159
196
 
160
197
  # Path to the priority configuration file
161
198
  PRIORITY_FILE = os.path.join(PIPELINES_DIR, "pipeline_priority.json")
162
199
 
200
+
163
201
  def load_priority_order() -> list:
164
202
  """
165
203
  Load the pipeline priority order from the JSON configuration file in the pipelines_full directory.
166
-
204
+
167
205
  Returns:
168
206
  List of pipeline titles in priority order.
169
207
  """
170
208
  try:
171
- with open(PRIORITY_FILE, 'r') as file:
209
+ with open(PRIORITY_FILE, "r") as file:
172
210
  config = json.load(file)
173
211
  return config.get("pipeline_order", [])
174
212
  except FileNotFoundError:
175
- print(f"Warning: Priority file '{PRIORITY_FILE}' not found. Using default order.")
213
+ print(
214
+ f"Warning: Priority file '{PRIORITY_FILE}' not found. Using default order."
215
+ )
176
216
  return []
177
217
  except Exception as e:
178
- print(f"Warning: Could not load priority file '{PRIORITY_FILE}'. Using default order. Error: {str(e)}")
218
+ print(
219
+ f"Warning: Could not load priority file '{PRIORITY_FILE}'. Using default order. Error: {str(e)}"
220
+ )
179
221
  return []
180
222
 
223
+
181
224
  def process_all_yaml_files() -> Dict[str, Any]:
182
225
  """
183
226
  Process all YAML files in the pipelines_full directory in the order of priority.
184
-
227
+
185
228
  Returns:
186
229
  Dictionary where keys are YAML file names and values are the JSON outputs
187
230
  from the json_pipeline_generator function.
188
231
  """
189
232
  # Load the priority order
190
233
  priority_order = load_priority_order()
191
-
234
+
192
235
  # Dictionary to store results
193
236
  results = {}
194
-
237
+
195
238
  # List all YAML files in the pipelines_full directory
196
- yaml_files = [f for f in os.listdir(PIPELINES_DIR) if f.endswith(".yaml") or f.endswith(".yml")]
197
-
198
- # Exclude the priority file from processing
239
+ yaml_files = [
240
+ f
241
+ for f in os.listdir(PIPELINES_DIR)
242
+ if f.endswith(".yaml") or f.endswith(".yml")
243
+ ]
244
+
245
+ # Exclude the priority file from processing
199
246
  yaml_files = [f for f in yaml_files if f != "pipeline_priority.yaml"]
200
247
 
201
248
  # Sort YAML files based on priority order
202
249
  if priority_order:
203
250
  # Remove the "_directive.yaml" suffix for matching
204
- yaml_files.sort(key=lambda x: priority_order.index(x.removesuffix("_directive.yaml"))
205
- if x.removesuffix("_directive.yaml") in priority_order
206
- else len(priority_order))
207
-
251
+ yaml_files.sort(
252
+ key=lambda x: (
253
+ priority_order.index(x.removesuffix("_directive.yaml"))
254
+ if x.removesuffix("_directive.yaml") in priority_order
255
+ else len(priority_order)
256
+ )
257
+ )
258
+
208
259
  # Process the YAML files in the sorted order
209
260
  for yaml_file in yaml_files:
210
261
  # Get the full path to the YAML file
211
262
  yaml_path = get_yaml_path(yaml_file)
212
-
263
+
213
264
  # Process the YAML file
214
265
  json_output = json_pipeline_generator(yaml_path)
215
-
266
+
216
267
  # Add to results (remove the "_directive.yaml" suffix for the key)
217
268
  results[yaml_file.removesuffix("_directive.yaml")] = json_output
218
-
219
- return results
269
+
270
+ return results
@@ -187,10 +187,6 @@ def yaml_pipelines_generator(
187
187
  indent=0,
188
188
  )
189
189
  pipeline_full += yaml_template_method
190
- pipeline_full[i]["parameters"].yaml_add_eol_comment(
191
- key="rotation",
192
- comment="'left' if rotation center is close to the left of the field-of-view, 'right' otherwise.",
193
- )
194
190
  elif "normalize" in module_name:
195
191
  pipeline_full.yaml_set_comment_before_after_key(
196
192
  i,