Skip to content

Conversation

devmotion
Copy link
Member

When working on adding a new distribution, I realized (once again) that the R test references can't be re-generated currently since running Rscript gendref.R errors:

  • The LindleyR package is not available anymore
  • For distr = StudentizedRange(...) since the function distr$pdf is undefined
  • truncated(Normal(...), ...) is not a valid reference name as it can't be mapped to a reference distribution

Moreover, after commenting out these three reference distribution types rerunning Rscript gendref.R changes reference values for most distributions.


This PR tries to fix the setup of the R reference tests:

  • Use renv for a reproducible package environment
  • Add a GHA that updates the R environment and reference values (scheduled and manually)
  • Replace LindleyR with new.dist
  • Use explicit package::function syntax instead of relying on library(package) in other source files
  • Calculate (log)pdf reference values of StudentizedRange by finite differencing of (log)cdf
  • Allow manual specification of distr$dtype and distr$expr (to support truncated(...) properly)
  • Simplify matrix-variate data generation by using StanHeaders instead of rstan
  • Improve definition of reference distributions for alternative Julia distribution types (e.g. Erlang and NormalCanon)
  • Update test/ref/readme.md
  • Update reference values by running Rscript gendref.R

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.29%. Comparing base (bbdd4f1) to head (9d75f78).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2007      +/-   ##
==========================================
- Coverage   86.35%   86.29%   -0.07%     
==========================================
  Files         146      146              
  Lines        8782     8782              
==========================================
- Hits         7584     7578       -6     
- Misses       1198     1204       +6     

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

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