Skip to content

BUG: fix ROQ likelihood incompatibility with numpy 2.4#1106

Merged
mj-will merged 4 commits into
bilby-dev:mainfrom
mj-will:numpy2p4-support
Jun 30, 2026
Merged

BUG: fix ROQ likelihood incompatibility with numpy 2.4#1106
mj-will merged 4 commits into
bilby-dev:mainfrom
mj-will:numpy2p4-support

Conversation

@mj-will

@mj-will mj-will commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

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_params a property so it's shape is checked.

@ColmTalbot ColmTalbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm happy with this change as long as the tests pass, just one question.

Comment thread bilby/gw/likelihood/roq.py Outdated
@roq_params.setter
def roq_params(self, roq_params):
if (
isinstance(roq_params, np.ndarray)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this leaving space for some other input type?
Will this work with a dictionary or dataframe?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've made the check more explicit.

Also, it seems the the test failure is unrelated.

@mj-will mj-will added this to the 3.0.0 milestone Jun 30, 2026
@mj-will mj-will added the bug Something isn't working label Jun 30, 2026
@mj-will mj-will requested review from a team and ColmTalbot June 30, 2026 10:20

@GregoryAshton GregoryAshton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mj-will mj-will enabled auto-merge June 30, 2026 13:27
@mj-will mj-will added this pull request to the merge queue Jun 30, 2026
Merged via the queue into bilby-dev:main with commit 1ed73af Jun 30, 2026
18 of 19 checks passed
@mj-will mj-will deleted the numpy2p4-support branch June 30, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants