Skip to content

MAINT: tweaks to prior constraints#1096

Open
mj-will wants to merge 4 commits into
bilby-dev:mainfrom
mj-will:improve-prior-constraints
Open

MAINT: tweaks to prior constraints#1096
mj-will wants to merge 4 commits into
bilby-dev:mainfrom
mj-will:improve-prior-constraints

Conversation

@mj-will

@mj-will mj-will commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Some tweaks to prior contraints

  • Raise an error if a constraint is present but the parameter key is missing. Currently, it's possible to have constraints that are silently ignored, e.g. because the conversion function doesn't generate them.
  • Remove an unreachable if statement. Prior to Change probability initialization to use np.ones_like #1028, evaluate_constraints returned 1.0 if there were no valid constraints and there was a check for this where the normalization was set to 1. I've removed this for now. Alternatively we could return 1.0 if all values are true but the while should do this anyway.

@mj-will mj-will added the priors label May 20, 2026
@mj-will mj-will added this to the 3.0.0 milestone May 20, 2026
@mj-will

mj-will commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

I think we may need to have an option where this doesn't raise an error since it is called in sample_subset_constrained and there are cases there where it shouldn't fail. E.g. if evaluating the usual GW prior and the masses aren't present.

@ColmTalbot

Copy link
Copy Markdown
Collaborator

I think we may need to have an option where this doesn't raise an error since it is called in sample_subset_constrained and there are cases there where it shouldn't fail. E.g. if evaluating the usual GW prior and the masses aren't present.

We could add this to the CBCPriorDict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants