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.
- {httomo_backends-0.5 → httomo_backends-0.5.2}/PKG-INFO +1 -1
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/recon/algorithm.py +133 -53
- {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
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/json_pipelines_generator.py +104 -53
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_pipelines_generator.py +0 -4
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_templates_generator.py +7 -2
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.morph/sino_360_to_180.yaml +1 -1
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/PKG-INFO +1 -1
- {httomo_backends-0.5 → httomo_backends-0.5.2}/pyproject.toml +1 -1
- {httomo_backends-0.5 → httomo_backends-0.5.2}/tests/test_httomolibgpu.py +64 -21
- {httomo_backends-0.5 → httomo_backends-0.5.2}/LICENSE +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/README.rst +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/cufft.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolib/httomolib.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolib/httomolib_modules.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/httomolibgpu.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/httomolibgpu_modules.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/corr.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/denoise.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/morph.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/misc/rescale.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/normalize.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/phase.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/stripe.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/recon/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/misc/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/misc/corr.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/prep/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/prep/stripe.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/recon/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/supporting_funcs/recon/algorithm.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/tomopy.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/backends/tomopy/tomopy_modules.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/packages/httomo.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/methods_database/query.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP2d_astra_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_denoising_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/FBP3d_tomobar_noimagesaving_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/LPRec3d_tomobar_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/deg360_distortion_FBP3d_tomobar_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/deg360_paganin_FBP3d_tomobar_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/sweep_center_FBP3d_tomobar_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/pipelines_full/tomopy_gridrec_directive.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_unsupported_tomopy_remove.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.data.hdf.loaders/standard_tomo.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.methods/calculate_stats.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomo/httomo.methods/save_intermediate_data.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.images/save_to_images.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.morph/data_reducer.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.misc.segm/binary_thresholding.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolib/httomolib.prep.phase/paganin_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.corr/median_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.corr/remove_outlier.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.denoise/total_variation_PD.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.denoise/total_variation_ROF.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.morph/data_resampler.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.misc.rescale/rescale_to_int.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.alignment/distortion_correction_proj_discorpy.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.normalize/normalize.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.phase/paganin_filter_savu.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.phase/paganin_filter_tomopy.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/raven_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_all_stripe.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_stripe_based_sorting.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.prep.stripe/remove_stripe_ti.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/CGLS3d_tomobar.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/FBP2d_astra.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/FBP3d_tomobar.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/LPRec3d_tomobar.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.algorithm/SIRT3d_tomobar.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_360.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_pc.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/httomolibgpu/httomolibgpu.recon.rotation/find_center_vo.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/__init__.py +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/adjust_range.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/circ_mask.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/gaussian_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter3d.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/median_filter_nonfinite.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_nan.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_neg.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier1d.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_outlier3d.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/remove_ring.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.corr/sobel_filter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/downsample.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/pad.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/sino_360_to_180.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/trim_sinogram.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.misc.morph/upsample.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/add_jitter.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/add_noise.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/align_joint.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/align_seq.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/blur_edges.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/distortion_correction_proj.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/distortion_correction_sino.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/scale.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.alignment/shift_images.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/minus_log.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_bg.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_nf.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.normalize/normalize_roi.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.phase/retrieve_phase.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_all_stripe.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_dead_stripe.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_large_stripe.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_filtering.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_fitting.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_interpolation.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_based_sorting.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_fw.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_sf.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/remove_stripe_ti.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/stripes_detect3d.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.prep.stripe/stripes_mask3d.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.algorithm/recon.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center_pc.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.recon.rotation/find_center_vo.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_drift.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_focal_spot_blur.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_gaussian.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_poisson.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_rings.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_salt_pepper.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/add_zingers.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project2.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/yaml_templates/tomopy/tomopy.sim.project/project3.yaml +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/SOURCES.txt +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/dependency_links.txt +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/requires.txt +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends.egg-info/top_level.txt +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/setup.cfg +0 -0
- {httomo_backends-0.5 → httomo_backends-0.5.2}/tests/test_method_query.py +0 -0
- {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(
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
221
|
+
tmp_p_input_slice = angles_tot * n * np.float32().itemsize
|
|
244
222
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
,
|
|
250
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
,
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
79
|
-
|
|
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(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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(
|
|
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 [
|
|
173
|
+
for unit in ["", "K", "M", "G", "T", "P", "E"]:
|
|
151
174
|
if size < 1024.0:
|
|
152
|
-
return
|
|
175
|
+
return "%3.2f%sB" % (size, unit)
|
|
153
176
|
size /= 1024.0
|
|
154
|
-
return
|
|
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:
|
{httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/json_pipelines_generator.py
RENAMED
|
@@ -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(
|
|
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(
|
|
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",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
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] =
|
|
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 =
|
|
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(
|
|
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,
|
|
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[
|
|
140
|
-
module_path = item[
|
|
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
|
-
|
|
149
|
-
|
|
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,
|
|
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(
|
|
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(
|
|
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 = [
|
|
197
|
-
|
|
198
|
-
|
|
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(
|
|
205
|
-
|
|
206
|
-
|
|
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
|
{httomo_backends-0.5 → httomo_backends-0.5.2}/httomo_backends/scripts/yaml_pipelines_generator.py
RENAMED
|
@@ -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,
|