-
Notifications
You must be signed in to change notification settings - Fork 356
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
add plugin handling for waveforms #3319
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.
This is great! Some documentation on how to use this would be good (e.g., what functions are required? Does the approximant name need to be unique and distinct from one currently in the waveform module? What happens if you use the same approximant name?), but I take it you plan to do that in a separate PR? Anyway, looks fine to me.
@cdcapano @spxiwh I've updated this PR with docs. Please see https://www.atlas.aei.uni-hannover.de/work/ahnitz/projects/prs/_gh-pages/latest/html/waveform_plugin.html for an example. |
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.
Thanks for adding docs @ahnitz. I've highlighted a few formatting things to change in the docs; see below. Feel free to merge once you've addressed them.
* add plugin handling for waveforms * cc * cc * add debugging, don't require m1/m2 for all waveforms * add waveform plugin docs * ws * forgot to commit this * Collin's comments * test
* add plugin handling for waveforms * cc * cc * add debugging, don't require m1/m2 for all waveforms * add waveform plugin docs * ws * forgot to commit this * Collin's comments * test
If the plugin is simply installed, pycbc will automatically pick it up and its waveform models will be available from PyCBC. I think this is the behavior we would like for external packages. The hook is the standard Python mechanism using the 'entrypoint' system of 'pkg_resources', which was explicitly designed for this purpose.
It would be good if you all could sign off on the generic interface and merge this first. In the next PR, I'll add documentation to main pages on how to use this both from the package level and how to add a waveform within a single script (by calling pycbc.waveform.add_custom_waveform). That will be followed up by the corresponding tutorial example (which we want for the workshop next week).