From 437f7cec89c4b4075fbb6a7571d577e91c109dce Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 22 Aug 2025 10:08:38 +0200 Subject: [PATCH 1/2] induce the cluster size of ClusterCollector from ClusterFinderMT - handle backwards compatibility --- python/aare/ClusterFinder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/aare/ClusterFinder.py b/python/aare/ClusterFinder.py index 251d938..56e504d 100644 --- a/python/aare/ClusterFinder.py +++ b/python/aare/ClusterFinder.py @@ -46,14 +46,16 @@ def ClusterFinderMT(image_size, cluster_size = (3,3), dtype=np.int32, n_sigma=5, return cls(image_size, n_sigma=n_sigma, capacity=capacity, n_threads=n_threads) - def ClusterCollector(clusterfindermt, cluster_size = (3,3), dtype=np.int32): """ Factory function to create a ClusterCollector object. Provides a cleaner syntax for the templated ClusterCollector in C++. """ - cls = _get_class("ClusterCollector", cluster_size, dtype) + if cluster_size != clusterfindermt.cluster_size: + raise Warning(f"Cluster size mismatch: ClusterCollector size {cluster_size} does not match ClusterFinderMT size {clusterfindermt.cluster_size}, using {clusterfindermt.cluster_size} instead.") + + cls = _get_class("ClusterCollector", clusterfindermt.cluster_size, dtype) return cls(clusterfindermt) def ClusterFileSink(clusterfindermt, cluster_file, dtype=np.int32): From d908ad36367db1580dae390022b9e6a3a6afab8f Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 22 Aug 2025 15:25:15 +0200 Subject: [PATCH 2/2] removed option to give clustersize --- python/aare/ClusterFinder.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/aare/ClusterFinder.py b/python/aare/ClusterFinder.py index 56e504d..cf5f4dd 100644 --- a/python/aare/ClusterFinder.py +++ b/python/aare/ClusterFinder.py @@ -46,14 +46,11 @@ def ClusterFinderMT(image_size, cluster_size = (3,3), dtype=np.int32, n_sigma=5, return cls(image_size, n_sigma=n_sigma, capacity=capacity, n_threads=n_threads) -def ClusterCollector(clusterfindermt, cluster_size = (3,3), dtype=np.int32): +def ClusterCollector(clusterfindermt, dtype=np.int32): """ Factory function to create a ClusterCollector object. Provides a cleaner syntax for the templated ClusterCollector in C++. """ - - if cluster_size != clusterfindermt.cluster_size: - raise Warning(f"Cluster size mismatch: ClusterCollector size {cluster_size} does not match ClusterFinderMT size {clusterfindermt.cluster_size}, using {clusterfindermt.cluster_size} instead.") cls = _get_class("ClusterCollector", clusterfindermt.cluster_size, dtype) return cls(clusterfindermt)