-
Notifications
You must be signed in to change notification settings - Fork 80
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
[BUG] Fix passing mode_array in injection-waveform-arguments #820
[BUG] Fix passing mode_array in injection-waveform-arguments #820
Conversation
bilby/gw/source.py
Outdated
@@ -174,6 +174,7 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista | |||
} | |||
|
|||
if mode_array is not None: | |||
mode_array = [tuple(map(int, mode)) for mode in mode_array] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should wrap these changes in a try/except like here so that we get an informative error if/when this fails for any reason. We can also have a more specific message here as it is a more specific case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just had one comment about making the error message more informative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming the CI passes.
There was a problem hiding this comment.
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 as is.
@ColmTalbot I think it's worth having a second look at this following the change Lorenzo made based on the discussion above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty slick now, thanks @lorenzopompili00!
It looks like there is a conflict that stops me from rebasing, can you update Lorenzo? and then we'll merge. |
Just updated @ColmTalbot ! |
When doing injections with
bilby_pipe
, passing amode_array
for the injected waveform viainjection-waveform-arguments
does not currently work, because of a missing conversion from string to int. See issue for details. Doing this conversion inbilby_pipe
breaks some unit tests (see MR), so I have implemented the conversion inbilby
only whenmode_array
is called.Note that
pyseobnr
currently wantsmode_array
to be a list of tuples, but I don't think a standard convention has been decided for future models ingwsignal
.I have tested this by adding
to the example bbh_injection.ini, as well as for
(I also had to include the fix for #41).