From 4e1a3d2d50f5abc97a3cb95153b7dac1eefa410b Mon Sep 17 00:00:00 2001 From: Michael Jasper Martins Date: Mon, 25 Nov 2024 16:50:02 +0100 Subject: [PATCH] For jointprior rescale, only cast to list once its save to loose mutability --- bilby/core/prior/dict.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bilby/core/prior/dict.py b/bilby/core/prior/dict.py index 2908bd08..0490d194 100644 --- a/bilby/core/prior/dict.py +++ b/bilby/core/prior/dict.py @@ -613,8 +613,10 @@ def rescale(self, keys, theta): samples = [] for key, units in zip(keys, theta): samps = self[key].rescale(units) + samples.append(samps) + for i, samps in enumerate(samples): # turns 0d-arrays into scalars - samples.append(np.squeeze(samps).tolist()) + samples[i] = np.squeeze(samps).tolist() return samples def test_redundancy(self, key, disable_logging=False):