BUG: fix ROQ likelihood incompatibility with numpy 2.4#1106
Merged
Conversation
ColmTalbot
reviewed
Jun 29, 2026
ColmTalbot
left a comment
Collaborator
There was a problem hiding this comment.
I'm happy with this change as long as the tests pass, just one question.
| @roq_params.setter | ||
| def roq_params(self, roq_params): | ||
| if ( | ||
| isinstance(roq_params, np.ndarray) |
Collaborator
There was a problem hiding this comment.
Is this leaving space for some other input type?
Will this work with a dictionary or dataframe?
Collaborator
Author
There was a problem hiding this comment.
We have to also support the roq_params = None case, see https://github.com/mj-will/bilby/blob/numpy2p4-support/bilby/gw/likelihood/roq.py#L132.
I could remove the clause after the and statement. It might make sense to replace it with a check for the three mandatory keys.
L131 would suggest we don't support dictionaries or dataframes.
Collaborator
Author
There was a problem hiding this comment.
I've made the check more explicit.
Also, it seems the the test failure is unrelated.
adivijaykumar
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ROQ likelihood had a small bug related to how the HDF5 bases were being loaded that caused an error with numpy 2.4.
I've put in a small fix and make
roq_paramsa property so it's shape is checked.