nanograv / enterprise_extensions

A set of extension codes, utilities, and scripts for the enterprise PTA analysis framework.
MIT License
27 stars 60 forks source link

Sampler utils #217

Open astrolamb opened 11 months ago

astrolamb commented 11 months ago

I removed the additional module I added from this PR that contained @paulthebaker's sampler utility functions.

I've added these utilities to sampler.py. This has allowed me to remove all of the various draw_from_x functions, and instead create a loop that create jump proposals if a given signal type is found in PTA model, based on the signal types created by enterprise.

I also added automatic pulsar grouping for better sampling of pulsar-dependent parameters.

Tests have been updated to reflect these changes.

TO DO: JumpProposal should probably be cleaned up

codecov-commenter commented 11 months ago

Codecov Report

Merging #217 (537efe1) into master (541dd1f) will increase coverage by 2.85%. The diff coverage is 66.97%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217/graphs/tree.svg?width=650&height=150&src=pr&token=HTKG5WS0VZ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv)](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) ```diff @@ Coverage Diff @@ ## master #217 +/- ## ========================================== + Coverage 37.23% 40.09% +2.85% ========================================== Files 20 20 Lines 3969 3614 -355 ========================================== - Hits 1478 1449 -29 + Misses 2491 2165 -326 ``` | [Files](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) | Coverage Δ | | |---|---|---| | [enterprise\_extensions/hypermodel.py](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv#diff-ZW50ZXJwcmlzZV9leHRlbnNpb25zL2h5cGVybW9kZWwucHk=) | `50.52% <75.00%> (+2.22%)` | :arrow_up: | | [enterprise\_extensions/sampler.py](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv#diff-ZW50ZXJwcmlzZV9leHRlbnNpb25zL3NhbXBsZXIucHk=) | `61.65% <65.59%> (+23.64%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). Last update [541dd1f...537efe1](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv).