From 6d8335621653ea6df669af2ef23f2fc9b59f5720 Mon Sep 17 00:00:00 2001
From: Rhiannon Udall <rhiannon.udall@ligo.org>
Date: Wed, 8 May 2024 15:43:16 +0000
Subject: [PATCH] BUG: Fix indent error in compute_snrs

---
 bilby/gw/conversion.py     | 4 ++--
 test/gw/conversion_test.py | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bilby/gw/conversion.py b/bilby/gw/conversion.py
index 4be5634eb..85bdf115a 100644
--- a/bilby/gw/conversion.py
+++ b/bilby/gw/conversion.py
@@ -2261,8 +2261,8 @@ def compute_snrs(sample, likelihood, npool=1):
                     snr_update = new_sample[ii].snrs_as_sample
                     for key, val in snr_update.items():
                         snr_updates[f"{ifo.name}_{key}"].append(val)
-            for k, v in snr_updates.items():
-                sample[k] = v
+                for k, v in snr_updates.items():
+                    sample[k] = v
     else:
         logger.debug('Not computing SNRs.')
 
diff --git a/test/gw/conversion_test.py b/test/gw/conversion_test.py
index aef17c822..8ce40e3b8 100644
--- a/test/gw/conversion_test.py
+++ b/test/gw/conversion_test.py
@@ -475,7 +475,7 @@ class TestGenerateAllParameters(unittest.TestCase):
     def test_generate_bbh_parameters_with_likelihood(self):
         priors = bilby.gw.prior.BBHPriorDict()
         priors["geocent_time"] = bilby.core.prior.Uniform(0.4, 0.6)
-        ifos = bilby.gw.detector.InterferometerList(["H1"])
+        ifos = bilby.gw.detector.InterferometerList(["H1", "L1"])
         ifos.set_strain_data_from_power_spectral_densities(duration=1, sampling_frequency=256)
         wfg = bilby.gw.waveform_generator.WaveformGenerator(
             frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole
@@ -501,6 +501,8 @@ class TestGenerateAllParameters(unittest.TestCase):
             "phase",
             "H1_optimal_snr",
             "H1_matched_filter_snr",
+            "L1_optimal_snr",
+            "L1_matched_filter_snr",
             "ra",
             "dec",
         ]
-- 
GitLab