From b6c07baf0c2cb90a54f854925fd3839e0a4eee33 Mon Sep 17 00:00:00 2001 From: Tekin Date: Fri, 19 Dec 2025 12:36:56 -0600 Subject: [PATCH 1/2] Fix print_mode argument in verbose_print function --- src/ptychi/pear/pear_init_recon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ptychi/pear/pear_init_recon.py b/src/ptychi/pear/pear_init_recon.py index 87bcc41..83d4f93 100644 --- a/src/ptychi/pear/pear_init_recon.py +++ b/src/ptychi/pear/pear_init_recon.py @@ -197,7 +197,7 @@ def initialize_recon(params): # print(f" Cluster {label}: Averaged {len(cluster_indices)} diffraction patterns") - verbose_print(f"Original dp shape: {dp.shape}, Clustered dp shape: {dp_clustered.shape}", print_mode) + verbose_print(f"Original dp shape: {dp.shape}, Clustered dp shape: {dp_clustered.shape}", print_mode=print_mode) # Replace the original diffraction patterns with the clustered ones dp = dp_clustered From 394816299b0aed2950e11933848fc0f22707f8d0 Mon Sep 17 00:00:00 2001 From: Tekin Date: Sat, 20 Dec 2025 05:39:34 -0600 Subject: [PATCH 2/2] Fix print_mode argument in function calls --- src/ptychi/pear/pear_init_recon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ptychi/pear/pear_init_recon.py b/src/ptychi/pear/pear_init_recon.py index 83d4f93..2edb76e 100644 --- a/src/ptychi/pear/pear_init_recon.py +++ b/src/ptychi/pear/pear_init_recon.py @@ -197,7 +197,7 @@ def initialize_recon(params): # print(f" Cluster {label}: Averaged {len(cluster_indices)} diffraction patterns") - verbose_print(f"Original dp shape: {dp.shape}, Clustered dp shape: {dp_clustered.shape}", print_mode=print_mode) + verbose_print(f"Original dp shape: {dp.shape}, Clustered dp shape: {dp_clustered.shape}", print_mode) # Replace the original diffraction patterns with the clustered ones dp = dp_clustered @@ -250,7 +250,7 @@ def _load_data_raw(instrument, base_path, scan_num, dp_Npix, dp_cen_x, dp_cen_y) if instrument not in instrument_loaders: raise ValueError(f"Unsupported instrument: {instrument}") - dp, positions = instrument_loaders[instrument](base_path, scan_num, dp_Npix, dp_cen_x, dp_cen_y, print_mode) + dp, positions = instrument_loaders[instrument](base_path, scan_num, dp_Npix, dp_cen_x, dp_cen_y, print_mode=print_mode) return dp, positions