Describe the bug
When sampling from a PriorDict that contains Constraints, if that PriorDict does not have a conversion function, the Constraints will silently be ignored. The problem is not the ignoring, but the fact that it is silent.
To Reproduce
In the context of a GW231123 analysis with NRSur7dq4, you might have:
priors = bilby.core.prior.PriorDict({"total_mass": bilby.core.prior.Constraint(name='total_mass', minimum=60, maximum=400), "chirp_mass": bilby.gw.prior.UniformInComponentsChirpMass(minimum=85, maximum=194.62, name='chirp_mass'), "mass_ratio": bilby.gw.prior.UniformInComponentsMassRatio(minimum=0.166666667, maximum=1.0, name='mass_ratio')})
priors.sample() # ---> will contain invalid samples
Error message
N/A
Expected behavior / Suggested solution (optional)
I would suggest adding a simple warning in case a constraint is being ignored.
Environment (please complete the following information):
- Bilby version: 2.6.0
- Installation method [e.g. conda, pip, source]: conda
Describe the bug
When sampling from a PriorDict that contains Constraints, if that PriorDict does not have a conversion function, the Constraints will silently be ignored. The problem is not the ignoring, but the fact that it is silent.
To Reproduce
In the context of a GW231123 analysis with NRSur7dq4, you might have:
Error message
N/A
Expected behavior / Suggested solution (optional)
I would suggest adding a simple warning in case a constraint is being ignored.
Environment (please complete the following information):