-
Notifications
You must be signed in to change notification settings - Fork 122
FEAT: Subclass of GWSignalWaveformGenerator for eccentric waveforms #1034
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds a convenience subclass EccentricGWSignalWaveformGenerator that simplifies the creation of eccentric waveform generators by automatically setting eccentric=True.
Changes:
- Added new
EccentricGWSignalWaveformGeneratorclass that inherits fromGWSignalWaveformGeneratorand setseccentric=Trueby default
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| class EccentricGWSignalWaveformGenerator(GWSignalWaveformGenerator): | ||
| """ | ||
| Subclass that initializes an eccentric GWSignal Waveform Generator. | ||
| Equivalent to `GWSignalWaveformGenerator` with `eccentric=True`. | ||
| See documentation of `GWSignalWaveformGenerator` for more information. | ||
| """ | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super().__init__(eccentric=True, **kwargs) |
Copilot
AI
Jan 20, 2026
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.
Consider adding test coverage for the new EccentricGWSignalWaveformGenerator class. While the implementation is straightforward, tests would ensure that the class properly initializes with eccentric=True and that the eccentric parameters are correctly included in the parameters (not in defaults). A simple test could verify that instantiating this class is equivalent to GWSignalWaveformGenerator(eccentric=True, ...).
ColmTalbot
left a comment
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 to add this as there seems to be a desire for it, although I don't really see how it is preferable to passing an argument.
| """ | ||
| Subclass that initializes an eccentric GWSignal Waveform Generator. | ||
| Equivalent to `GWSignalWaveformGenerator` with `eccentric=True`. | ||
| See documentation of `GWSignalWaveformGenerator` for more information. |
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 it's worth specifying that this doesn't do any kind of checking that the requested model actually supports eccentricity.
|
Also adding @IsobelMarguarethe and @lorenzopompili00 to the discussion. |
@ColmTalbot it reduces the number of extra arguments that have to be included in a bilby_pipe ini file. An alternative that we discussed on Monday could be moving the eccentric=True argument to the waveform_arguments, to avoid having to pass a separate dict of arguments to the waveform generator. |
5f3273a to
b3a3075
Compare
Adds a subclass of GWSignalWaveformGenerator for eccentric waveforms.
I realize that avoiding subclassing/writing source models was one of the reasons we moved away from the old way of calling waveforms. I see these subclasses as "convenience functions", and since it doesn't duplicate a lot of code I am in favour of adding them. But I can also see arguments to the contrary.