From 81ece5edaa64d7fe5bb6c172868376fa336c29d9 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Mon, 4 Mar 2024 14:32:18 -0500 Subject: [PATCH] Simplify --- proseco/acq.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/proseco/acq.py b/proseco/acq.py index 9d4387ed..a89e4e0f 100644 --- a/proseco/acq.py +++ b/proseco/acq.py @@ -692,8 +692,7 @@ def select_best_p_acqs(self, cand_acqs, min_p_acq, acq_indices, box_sizes): # If this box size could overlap with the box of an already selected star # then skip it. - if (("PROSECO_ACQ_OVERLAP_PENALTY" in os.environ) - & (os.environ["PROSECO_ACQ_OVERLAP_PENALTY"] == "True")): + if (os.environ.get("PROSECO_ACQ_OVERLAP_PENALTY") == "True"): has_overlap = False for other_idx, halfw2 in zip(acq_indices, box_sizes): other_acq = cand_acqs[other_idx] @@ -929,8 +928,7 @@ def calc_p_safe(self, verbose=False): # Check for overlapping boxes and if so, reduce the probability of # acquiring the star. - if (("PROSECO_ACQ_OVERLAP_PENALTY" in os.environ) - & (os.environ["PROSECO_ACQ_OVERLAP_PENALTY"] == "True")): + if (os.environ.get("PROSECO_ACQ_OVERLAP_PENALTY") == "True"): penalties = self.get_overlap_penalties() if np.count_nonzero(penalties): self.log("Overlapping boxes detected, applying penalty", level=1)