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

Bugfixes in .stanfunctions, hessian model method, and exposing RNG functions #811

Merged
merged 8 commits into from
Aug 23, 2023

Conversation

andrjohns
Copy link
Collaborator

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

This PR comprises two small bugfixes:

  • .stanfunctions was not treated as a valid extension
  • math/mix.hpp was not included early enough, resulting in compilation errors for some hessian models

And one slightly larger bugfix in the handling of exposing RNG functions. Currently, we expose RNG functions with an integer seed argument (default = 0) - such that users need to change this seed argument if they want a different value on each call. This PR changes that behaviour to initialise a Boost RNG and store it in the functions environment, which is then passed to the exposed RNG function - allowing the exposed RNG function to act as expected.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@rok-cesnovar rok-cesnovar self-requested a review August 9, 2023 11:10
@jgabry
Copy link
Member

jgabry commented Aug 9, 2023

This PR changes that behaviour to initialise a Boost RNG and store it in the functions environment, which is then passed to the exposed RNG function - allowing the exposed RNG function to act as expected.

Good idea, thanks!

@codecov-commenter
Copy link

Codecov Report

Merging #811 (676f44a) into master (74f39dc) will decrease coverage by 1.67%.
Report is 16 commits behind head on master.
The diff coverage is 95.65%.

❗ Current head 676f44a differs from pull request most recent head 7fb88b6. Consider uploading reports for the commit 7fb88b6 to get more accurate results

@@            Coverage Diff             @@
##           master     #811      +/-   ##
==========================================
- Coverage   88.24%   86.58%   -1.67%     
==========================================
  Files          12       12              
  Lines        4161     4175      +14     
==========================================
- Hits         3672     3615      -57     
- Misses        489      560      +71     
Files Changed Coverage Δ
R/fit.R 96.22% <ø> (ø)
R/utils.R 72.43% <94.73%> (-1.28%) ⬇️
R/example.R 97.56% <100.00%> (ø)
R/model.R 90.46% <100.00%> (-0.14%) ⬇️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

Andrew is on a roll, I love it :)

@andrjohns andrjohns merged commit 2b04e4f into master Aug 23, 2023
12 checks passed
@jgabry
Copy link
Member

jgabry commented Aug 23, 2023

Thanks @andrjohns!

@andrjohns andrjohns deleted the qol-improvements branch January 24, 2024 08:02
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.

None yet

4 participants