Skip to content
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

Scaled and Shifted #16

Merged
merged 62 commits into from
Mar 21, 2025
Merged

Scaled and Shifted #16

merged 62 commits into from
Mar 21, 2025

Conversation

cscherrer
Copy link
Contributor

@cscherrer cscherrer commented Mar 12, 2025

Generally the idea is

  • Have a Shiftable trait
  • For some distributions like Gaussian , some_dist.shifted(dx) gets absorbed and just gives another instance of the distribution
  • When that's not an option, we wrap with Shifted
  • There's also a ShiftedSuffStat that shifts the data before feeding into the suffstat of the parent

It will be similar for Scaled

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 49.11111% with 229 lines in your changes missing coverage. Please review.

Project coverage is 80.82%. Comparing base (f6b3d9b) to head (f5aa147).
Report is 1 commits behind head on release/v0.19.0.

Files with missing lines Patch % Lines
src/data/stat/scaled.rs 0.00% 32 Missing ⚠️
src/dist/shifted.rs 59.72% 29 Missing ⚠️
src/dist/scaled.rs 69.66% 27 Missing ⚠️
src/data/stat/shifted.rs 0.00% 25 Missing ⚠️
src/traits.rs 4.00% 24 Missing ⚠️
src/dist/gaussian.rs 48.00% 12 Missing and 1 partial ⚠️
src/dist/cauchy.rs 50.00% 12 Missing ⚠️
src/dist/gev.rs 57.14% 12 Missing ⚠️
src/dist/laplace.rs 50.00% 12 Missing ⚠️
src/dist/uniform.rs 50.00% 9 Missing ⚠️
... and 7 more
Additional details and impacted files
@@                 Coverage Diff                 @@
##           release/v0.19.0      #16      +/-   ##
===================================================
- Coverage            81.49%   80.82%   -0.68%     
===================================================
  Files                   93       97       +4     
  Lines                18810    19241     +431     
  Branches             18810    19241     +431     
===================================================
+ Hits                 15329    15551     +222     
- Misses                3382     3591     +209     
  Partials                99       99              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cscherrer cscherrer marked this pull request as ready for review March 19, 2025 21:24
@cscherrer
Copy link
Contributor Author

Some things to confirm, if you could:

  1. Every continuous univariate distribution should implement both Scalable and Shiftable
  2. Distributions that implement either of these manually should have the corresponding test macros included

I checked these but it's manual so a second look would help 🙏

Copy link
Contributor

@schmidmt schmidmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions, but overall, this looks great! I love all the tests!

@cscherrer cscherrer merged commit 0e83109 into release/v0.19.0 Mar 21, 2025
8 of 10 checks passed
@cscherrer cscherrer deleted the cs-scaled-shifted branch March 21, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants