bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python.
https://bilby-dev.github.io/bilby/
MIT License
66 stars 75 forks source link

DEV: make sure all priors return float when needed #848

Open ColmTalbot opened 3 weeks ago

ColmTalbot commented 3 weeks ago

For a long time, some prior classes have cast inputs to numpy arrays this MR removes that behaviour and adds a test to make sure that sampling and evaluating the CDF do not cast to array.

This caused an error when evaluating the CDF many times and then combining the results.

I also streamlined some other behaviour in applying prior constraints that were originally flagged by @cjhaster.

I noticed that the Fermi-Dirac CDF hadn't been implemented for some reason so I added that and added to the CI test suite. Finally, there was an issue with sampling from joint distributions where the results could be returned out of order.

Copied from https://git.ligo.org/lscsoft/bilby/-/merge_requests/1285