ColmTalbot / gwpopulation

CPU/GPU agnostic gravitational-wave population inference
https://colmtalbot.github.io/gwpopulation/
MIT License
39 stars 48 forks source link

Draft: Add Power Law + Dip + Break model #78

Closed afarah18 closed 2 weeks ago

afarah18 commented 9 months ago

This merge request adds a 2-dimensional mass model to mass.py, as well as two helper functions: a 1D mass model and a pairing function. These are meant to span the whole spectrum of CBCs rather than just the BBHs.

afarah18 commented 9 months ago

Hi Colm,

Thanks for your reply and for the tip about pre-commit. I just addressed your comments by editing my fork, but I'm still marking this as a draft until I can test everything thoroughly. I see the backend compatibility with gwpopulation_pipe is fixed so I can run my tests now and I'll let you know when they finish/ I can confirm things work as expected. Nevermind, they are not yet fixed, I was looking at the wrong PR. I will wait until I can pull those changes and then run my tests

Regardless, though, I'm happy to implement PDB as a separate module or package. I didn't realize that was an option with GWPopulation, but it definitely seems reasonable! Whichever is better for you is fine by me. I'm happy to help with documentation of that as well.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (2d43f7c) 94.93% compared to head (41e0f1f) 93.88%.

Files Patch % Lines
gwpopulation/models/mass.py 25.00% 9 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #78 +/- ## ========================================== - Coverage 94.93% 93.88% -1.05% ========================================== Files 11 11 Lines 789 801 +12 ========================================== + Hits 749 752 +3 - Misses 40 49 +9 ``` | [Flag](https://app.codecov.io/gh/ColmTalbot/gwpopulation/pull/78/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colm+Talbot) | Coverage Δ | | |---|---|---| | [python3.10](https://app.codecov.io/gh/ColmTalbot/gwpopulation/pull/78/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colm+Talbot) | `93.76% <25.00%> (-1.05%)` | :arrow_down: | | [python3.11](https://app.codecov.io/gh/ColmTalbot/gwpopulation/pull/78/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colm+Talbot) | `93.76% <25.00%> (-1.05%)` | :arrow_down: | | [python3.9](https://app.codecov.io/gh/ColmTalbot/gwpopulation/pull/78/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colm+Talbot) | `93.75% <25.00%> (-1.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colm+Talbot#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ColmTalbot commented 9 months ago

I just created a (filled-in) template repository for how to package up custom models, https://github.com/ColmTalbot/gwpopulation-additional-models.

This is still very much a WIP and will need documentation for some of the features, especially setting up the backend as a plugin.

This also currently needs a pre-release of GWPopulation.

afarah18 commented 9 months ago

Sounds good, I'll take a look soon!

ColmTalbot commented 2 weeks ago

Closing this in favour of it living in a standalone package.