Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ColmTalbot
Copy link
Collaborator

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

@ColmTalbot ColmTalbot added bug Something isn't working 10-100 lines priors labels Nov 1, 2024
@ColmTalbot ColmTalbot changed the title Fix symmetric log uniform DEV: make sure all priors return float when needed Nov 1, 2024
@mj-will mj-will added this to the 2.5.0 milestone Nov 14, 2024
* (val <= -self.minimum) * (val >= -self.maximum)
+ (0.5 + norm * np.log(abs(val) / self.minimum))
* (val >= self.minimum) * (val <= self.maximum)
+ 0.5 * (val >= -self.minimum) * (val <= self.minimum)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both statements here have changed from > to >=, is that intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10-100 lines bug Something isn't working priors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants