Skip to content

Expose builtin constraints #1494

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

Merged
merged 16 commits into from
Mar 19, 2025
Merged

Expose builtin constraints #1494

merged 16 commits into from
Mar 19, 2025

Conversation

WardBrian
Copy link
Member

@WardBrian WardBrian commented Feb 24, 2025

Closes #1436

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here: Forthcoming

Release notes

All the built-in constraint types now have corresponding _jacobian, _constrain, and _unconstrain functions. The first two functions are identical except for the _jacobian version will increment the target with the necessary change of variables adjustment.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.55%. Comparing base (3aa50a9) to head (a407878).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1494      +/-   ##
==========================================
+ Coverage   89.52%   89.55%   +0.02%     
==========================================
  Files          66       66              
  Lines        9684     9695      +11     
==========================================
+ Hits         8670     8682      +12     
+ Misses       1014     1013       -1     
Files with missing lines Coverage Δ
src/frontend/Typechecker.ml 93.08% <100.00%> (+0.03%) ⬆️
src/stan_math_backend/Lower_expr.ml 93.65% <100.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WardBrian
Copy link
Member Author

The expression test failures are kind of weird but they seem to be fixed by stan-dev/math#3147 so there might just be some known bug in offset_multipliers code (cc @SteveBronder)

@WardBrian WardBrian marked this pull request as ready for review March 7, 2025 21:45
@WardBrian WardBrian requested a review from SteveBronder March 10, 2025 16:53
Copy link
Contributor

@SteveBronder SteveBronder 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 small comments but overall I think good!

@WardBrian WardBrian merged commit 1b67efa into master Mar 19, 2025
3 checks passed
@WardBrian WardBrian deleted the expose-builtin-constraints branch March 19, 2025 13:34
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.

Expose built-in constraint transforms as _jacobian functions
2 participants