From 530fa42a9a8875a7a514eaabb38e049999ebbbdc Mon Sep 17 00:00:00 2001 From: Colm Talbot Date: Tue, 29 Sep 2026 16:28:55 -0400 Subject: [PATCH] BUG: make conditional delta function available for condition Currently, we can't sample using a prior like the one below. There's always a way around this, but it feels more natural to not have to. As a concrete example I'm working with $p(\chi_{\rm eff} | q)$, $p(\chi_2 | \chi_{\rm eff}, q)$, $p(\chi_1 | \chi_{\rm eff}, \chi_2, q) = \delta(...)$, $p(\chi_{1, \perp} | \chi_1)$. To work around it, I would need to add some new conversions. ```python a = Uniform(0, 1) b = ConditionalDeltaFunction(... some condition that depends on a...) c = ConditionalUniform(... some condition that depends on b...) ``` --- bilby/core/prior/dict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bilby/core/prior/dict.py b/bilby/core/prior/dict.py index 2e4069048..b5986d3d4 100644 --- a/bilby/core/prior/dict.py +++ b/bilby/core/prior/dict.py @@ -973,7 +973,7 @@ def sorted_keys_without_fixed_parameters(self): return [ key for key in self.sorted_keys - if not isinstance(self[key], (DeltaFunction, Constraint)) + if not (self[key].is_fixed or isinstance(self[key], Constraint)) ] def __setitem__(self, key, value):