From a46ce88ca22cb7a7967863a9caf73ccfd90be169 Mon Sep 17 00:00:00 2001 From: Bruce Edelman <bruce.edelman@ligo.org> Date: Wed, 25 Mar 2020 12:39:38 -0700 Subject: [PATCH] Revert "remove unnecessary constraint checking:" This reverts commit ed0614245b8cbe15f6422dbdc003a438868c0517. --- bilby/core/prior/dict.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bilby/core/prior/dict.py b/bilby/core/prior/dict.py index c2aa96650..ca2eed960 100644 --- a/bilby/core/prior/dict.py +++ b/bilby/core/prior/dict.py @@ -364,6 +364,12 @@ class PriorDict(dict): return sample else: needed = np.prod(size) + constraint_keys = list() + for ii, key in enumerate(keys[-1::-1]): + if isinstance(self[key], Constraint): + constraint_keys.append(-ii - 1) + for ii in constraint_keys[-1::-1]: + del keys[ii] all_samples = {key: np.array([]) for key in keys} _first_key = list(all_samples.keys())[0] while len(all_samples[_first_key]) < needed: -- GitLab