Repository navigation
Conversation
GregoryAshton
left a comment
There was a problem hiding this comment.
Overall looks good thanks @akjm99. Just need to revert the cases where it is using an ROQ.
|
|
||
| trial_roq_paths = [ | ||
| "/roq_basis", | ||
| os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"), |
There was a problem hiding this comment.
Here, I don't think we have ROQ data for XPHM yet, so this will need to be reverted (and may be why the CI is failing).
There was a problem hiding this comment.
Yes, I think that's fine.
I'll note there is definitely ROQ data for XPHM on CIT but I don't think it's public (and is also huge).
| # Possible locations for the ROQ: in the docker image, local, or on CIT | ||
| trial_roq_paths = [ | ||
| "/roq_basis", | ||
| os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"), |
There was a problem hiding this comment.
Same as the case above
There was a problem hiding this comment.
And applied to the comments as well
| # Possible locations for the ROQ: in the docker image, local, or on CIT | ||
| trial_roq_paths = [ | ||
| "/roq_basis", | ||
| os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"), |
| # Possible locations for the ROQ: in the docker image, local, or on CIT | ||
| trial_roq_paths = [ | ||
| "/roq_basis", | ||
| os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"), |
|
@akjm99 it looks like a commit from |
|
Hi @mj-will. I am not sure how that happened sorry! I followed the contributing guidelines which said to pull upstream, make edits, and then push to fork (?). When I tried to push my changes to my fork, it said there were conflicts and that I had to merge my new changes and merge/rebase my branch to my main (?) (which I think I managed to do, at least I was able to push to my fork after that...) |
Hmm, I think the upstream changed between you initially making the branch and now (the commit is from another recent PR). I think you've followed the contributing guidelines correctly but we're missing a section on updating a PR with changes from main after it has been made. I've opened an issue to track this: #901. Given we'll squash, this probably doesn't matter in this case, and it's probably more work to fix than it's worth. |
|
@akjm99 do you have time to have another look at this? I think ROQ tests just need switch to IMRPhenomPv2. |
| frequency_nodes_linear=fnodes_linear, | ||
| frequency_nodes_quadratic=fnodes_quadratic, | ||
| reference_frequency=50.0, | ||
| waveform_approximant="IMRPhenomPv2", |
There was a problem hiding this comment.
I think this line should be using IMRPhenomPv2 since we are passing in the ROQ terms just above
|
Hi @akjm99 do you have capacity to have another look at this? Unfortunately, I can't see what the test failures are but hopefully it's an easy fix. |
|
Hi @mj-will, apologies; I thought I had managed to fix this already! I think you should be able to see the tests again now. Some of the unit tests are failing, but I am unsure why. I have a lot of work at the moment, but I will have another go at trying to debug this after I am back from the LVK. |
Switching the test suite to IMRPhenomXPHM (PR bilby-dev#897) exposed two issues: - catch_waveform_errors only matched the exact IMRPhenomPv2 EDOM string, so out-of-domain errors from XPHM (XLAL_EFUNC) and XAS/D (XLAL_EINVAL) leaked out instead of returning None. Add a shared _is_waveform_domain_error helper recognising all three LAL domain-error codes, applied at all three catch_waveform_errors sites. - test_lalsim_SimInspiralChooseFDWaveform passed raw SI numbers as masses (~35 kg). Pv2 tolerated this but XPHM aborts the process. Scale the masses by lal.MSUN_SI so the inputs are physical. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@akjm99 and @mj-will, I got my French friend to look at this, and it turns out it is more interesting than just a CI failure. In short, it surfaced that we are not handling LALSimulation waveform errors well. Root cause of the failing tests on #897Switching the test suite from 1.
|
| Approximant | Exception message | LAL code | Caught before? |
|---|---|---|---|
IMRPhenomPv2 / XP |
Internal function call failed: Input domain error |
XLAL_EDOM |
✅ |
IMRPhenomXPHM (freq. sequence) |
Internal function call failed |
XLAL_EFUNC |
❌ |
IMRPhenomXAS / D |
Invalid argument |
XLAL_EINVAL |
❌ |
So with XPHM the error propagated instead of being converted to a -inf likelihood, and the test failed.
Fix: a shared _is_waveform_domain_error() helper that recognises all three LAL domain-error messages, applied at all three catch_waveform_errors sites (standard FD path, frequency-sequence/relative-binning path, and the gwsignal path). This also closes a latent gap where XAS/D (Invalid argument) errors were never caught on the standard path.
2. Unit test fed unphysical masses (test bug)
test/gw/utils_test.py::test_lalsim_SimInspiralChooseFDWaveform passed raw SI numbers as the masses, so mass_1=35.2 meant 35.2 kg (~3×10⁻²⁹ M☉). IMRPhenomPv2 tolerated these nonsense values, but IMRPhenomXPHM aborts the process (SIGKILL) on them — which is why the run died mid-test with no traceback.
Fix: scale the masses by lal.MSUN_SI so the test passes physically valid inputs.
The XLAL_EFUNC message ("Internal function call failed") is fairly generic, so catch_waveform_errors=True now swallows a slightly broader class of nested LAL failures as -inf. This is consistent with the feature's intent (opt-in robustness during sampling),
The pre-commit pretty-format-toml hook (v2.14.0) now adds spaces inside inline-table braces. These files predated that style, causing the pre-commit CI job to fail. Purely cosmetic; no semantic changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
We now have one failure in the CI FAILED test/gw/likelihood/roq_test.py::TestROQLikelihood::test_create_roq_weights_with_params - AssertionError: np.float64(407.93544108302456) != np.float64(407.93544108302467) Tagging @ColmTalbot and @mj-will - can we just found these numbers as it looks like floating point precession rounding? |
Yeah, happy to make these almost equal at some sensible level. |
|
I think we had deliberately not caught all of these previously, for example, is the error for the aligned waveforms due to passing precessing spins? I think we should not catch this error. |
The two log-likelihood ratios can differ at the level of floating-point round-off, causing the exact equality check to fail on CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Good point @ColmTalbot I've now pushed a change which reverts the catching of "Invalid argument". There is a comment blocki above it which describes the behaviour - let me know if you prefer that to be removed. I then decided to add a test checking the behaviour across the different possible errors to check we are understand how the likelihood is behaving. I can update the PR accordingly if people are happy with this. Or I can remove it. |
No description provided.