Skip to content

Remove Rmath sampling methods#188

Open
devmotion wants to merge 5 commits intomasterfrom
dmw/rand
Open

Remove Rmath sampling methods#188
devmotion wants to merge 5 commits intomasterfrom
dmw/rand

Conversation

@devmotion
Copy link
Member

@devmotion devmotion commented Oct 20, 2025

The ...rand methods in StatsFuns.RFunctions based on Rmath are not used in StatsFuns and not public API either. IMO if one wants to use these methods, it would be better to use Rmath directly (see JuliaStats/Rmath.jl#91).

The PR requires JuliaStats/Rmath.jl#91 and making use of Rmath in Distributions.


Additionally, to reduce the number of definitions further I removed the StatsFuns.RFunctions submodule and only defined the publicly exposed functions directly in the StatsFuns module.

name = "StatsFuns"
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "1.5.0"
version = "2.0.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

The PR is technically non-breaking (since the removed functions are not public API) but in practice breaks old versions of Distributions that make use of these non-public functions.

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.39%. Comparing base (dee41f6) to head (5bf8720).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
+ Coverage   70.88%   72.39%   +1.51%     
==========================================
  Files          17       22       +5     
  Lines         838     1007     +169     
==========================================
+ Hits          594      729     +135     
- Misses        244      278      +34     

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

@andreasnoack
Copy link
Member

I think this is good. Are there other breaking changes that we can come up with before releasing this?

@devmotion
Copy link
Member Author

Maybe we could even think about removing the RFunctions submodule completely. With #191 interfacing with Rmath will not require complex ccalls anymore but we could instead directly define nbetapdf(...) = ... Rmath.dnbeta(...) etc within StatsFuns (possibly with the convenience matrix, possibly without).

@devmotion devmotion marked this pull request as ready for review January 17, 2026 14:27
@oscardssmith
Copy link
Contributor

Maybe we could even think about removing the RFunctions submodule completely.

I would be very in favor (especially because I am going to try very hard to remove all remaining rmath dependencies over the next ~2 weeks)

@devmotion
Copy link
Member Author

In its current form, the PR removes the submodule.

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.

4 participants