From 2d2d917c1d3ddd3204c4c39265a812f1e58f2c1b Mon Sep 17 00:00:00 2001 From: Calum Chamberlain Date: Mon, 16 Dec 2024 09:37:47 +1300 Subject: [PATCH 1/2] Always get new catalog from detections #598 --- eqcorrscan/core/match_filter/family.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eqcorrscan/core/match_filter/family.py b/eqcorrscan/core/match_filter/family.py index 24874663..d0db0c05 100644 --- a/eqcorrscan/core/match_filter/family.py +++ b/eqcorrscan/core/match_filter/family.py @@ -45,16 +45,13 @@ def __init__(self, template, detections=None, catalog=None): if isinstance(detections, Detection): detections = [detections] self.detections = detections or [] - self.__catalog = get_catalog(self.detections) if catalog: Logger.warning("Setting catalog directly is no-longer supported, " "now generated from detections.") @property def catalog(self): - if len(self.__catalog) != len(self.detections): - self.__catalog = get_catalog(self.detections) - return self.__catalog + return get_catalog(self.detections) @catalog.setter def catalog(self, catalog): From 209bb0ffc9186815797c9541484557a87c520a4d Mon Sep 17 00:00:00 2001 From: Calum Chamberlain Date: Mon, 16 Dec 2024 10:16:34 +1300 Subject: [PATCH 2/2] Remove reference to __catalog --- eqcorrscan/core/match_filter/family.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/eqcorrscan/core/match_filter/family.py b/eqcorrscan/core/match_filter/family.py index d0db0c05..2cc2bcbd 100644 --- a/eqcorrscan/core/match_filter/family.py +++ b/eqcorrscan/core/match_filter/family.py @@ -148,13 +148,11 @@ def __iadd__(self, other): if isinstance(other, Family): if other.template == self.template: self.detections.extend(other.detections) - self.__catalog.events.extend(get_catalog(other.detections)) else: raise NotImplementedError('Templates do not match') elif isinstance(other, Detection) and other.template_name \ == self.template.name: self.detections.append(other) - self.__catalog.events.extend(get_catalog([other])) elif isinstance(other, Detection): raise NotImplementedError('Templates do not match') else: