Skip to content

Conversation

@adivijaykumar
Copy link
Collaborator

@adivijaykumar adivijaykumar commented Jan 19, 2026

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.

@adivijaykumar adivijaykumar changed the title Subclass of GWSignalWaveformGenerator for eccentric waveforms FEAT: Subclass of GWSignalWaveformGenerator for eccentric waveforms Jan 20, 2026
@adivijaykumar adivijaykumar added enhancement New feature or request 10-100 lines labels Jan 20, 2026
@adivijaykumar adivijaykumar requested review from ColmTalbot, asb5468, Copilot and mj-will and removed request for asb5468 January 20, 2026 16:21
Copy link

Copilot AI left a 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 EccentricGWSignalWaveformGenerator class that inherits from GWSignalWaveformGenerator and sets eccentric=True by default

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +582 to +590
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)
Copy link

Copilot AI Jan 20, 2026

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, ...).

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@ColmTalbot ColmTalbot left a 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.
Copy link
Collaborator

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.

@adivijaykumar
Copy link
Collaborator Author

adivijaykumar commented Jan 20, 2026

Also adding @IsobelMarguarethe and @lorenzopompili00 to the discussion.

@IsobelMarguarethe
Copy link
Contributor

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.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10-100 lines enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants