diff --git a/pycbc/events/coinc.py b/pycbc/events/coinc.py index e40381ce3b9..1af6416d60a 100644 --- a/pycbc/events/coinc.py +++ b/pycbc/events/coinc.py @@ -880,7 +880,7 @@ class (in seconds), default not do do this ) self.time_stat_refreshed = dt.now() - self.lock = threading.Lock() + self.stat_calculator_lock = threading.Lock() self.statistic_refresh_rate = statistic_refresh_rate self.timeslide_interval = timeslide_interval @@ -1381,7 +1381,7 @@ def add_singles(self, results): valid_ifos = [k for k in results.keys() if results[k] and k in self.ifos] if len(valid_ifos) == 0: return {} - with self.lock: + with self.stat_calculator_lock: # Add single triggers to the internal buffer self._add_singles_to_buffer(results, ifos=valid_ifos) @@ -1422,7 +1422,7 @@ def refresh_statistic(self): "Checking %s statistic for updated files", ''.join(self.ifos), ) - with self.lock: + with self.stat_calculator_lock: self.stat_calculator.check_update_files() # Sleep one second for safety time.sleep(1) diff --git a/pycbc/events/single.py b/pycbc/events/single.py index 3512362ef53..4ff3112dec2 100644 --- a/pycbc/events/single.py +++ b/pycbc/events/single.py @@ -77,7 +77,7 @@ class (in seconds), default not do do this self.maximum_ifar = maximum_ifar self.time_stat_refreshed = dt.now() - self.lock = threading.Lock() + self.stat_calculator_lock = threading.Lock() self.statistic_refresh_rate = statistic_refresh_rate stat_class = stat.get_statistic(statistic) @@ -275,7 +275,7 @@ def check(self, trigs, data_reader): trigsc['chisq_dof'] = (cut_trigs['chisq_dof'] + 2) / 2 # Calculate the ranking reweighted SNR for cutting - with self.lock: + with self.stat_calculator_lock: single_rank = self.stat_calculator.get_sngl_ranking(trigsc) sngl_idx = single_rank > self.thresholds['newsnr'] @@ -286,7 +286,7 @@ def check(self, trigs, data_reader): for k in trigs} # Calculate the ranking statistic - with self.lock: + with self.stat_calculator_lock: sngl_stat = self.stat_calculator.single(cutall_trigs) rank = self.stat_calculator.rank_stat_single((self.ifo, sngl_stat)) @@ -380,7 +380,7 @@ def refresh_statistic(self): "Checking %s statistic for updated files", self.ifo, ) - with self.lock: + with self.stat_calculator_lock: self.stat_calculator.check_update_files() # Sleep one second for safety time.sleep(1)