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

Add sum_to_zero transform #1443

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Add sum_to_zero transform #1443

merged 2 commits into from
Aug 13, 2024

Conversation

WardBrian
Copy link
Member

@WardBrian WardBrian commented Aug 5, 2024

Draft because it relies on stan-dev/stan#3308 and one of stan-dev/math#3099 stan-dev/math#3101

Submission Checklist

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

Release notes

Added the sum_to_zero transform for vector types.

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 Aug 5, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Project coverage is 89.49%. Comparing base (0ea83bb) to head (13938a8).

Files Patch % Lines
src/frontend/Pretty_printing.ml 25.00% 3 Missing ⚠️
src/analysis_and_optimization/Mir_utils.ml 0.00% 2 Missing ⚠️
src/frontend/Ast_to_Mir.ml 60.00% 2 Missing ⚠️
src/middle/Transformation.ml 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1443      +/-   ##
==========================================
- Coverage   89.52%   89.49%   -0.03%     
==========================================
  Files          63       63              
  Lines       10614    10618       +4     
==========================================
+ Hits         9502     9503       +1     
- Misses       1112     1115       +3     
Files Coverage Δ
src/frontend/Typechecker.ml 91.78% <100.00%> (+<0.01%) ⬆️
src/stan_math_backend/Lower_expr.ml 93.55% <100.00%> (+0.01%) ⬆️
src/middle/Transformation.ml 87.50% <0.00%> (-3.81%) ⬇️
src/analysis_and_optimization/Mir_utils.ml 76.05% <0.00%> (-0.36%) ⬇️
src/frontend/Ast_to_Mir.ml 94.15% <60.00%> (-0.20%) ⬇️
src/frontend/Pretty_printing.ml 92.28% <25.00%> (+0.02%) ⬆️

@WardBrian WardBrian linked an issue Aug 6, 2024 that may be closed by this pull request
@WardBrian WardBrian marked this pull request as ready for review August 8, 2024 17:17
@nhuurre
Copy link
Collaborator

nhuurre commented Aug 9, 2024

The original issue asks for zero_sum_vector but here it has been renamed to sum_to_zero. I didn't see any discussion as to why. Personally, I prefer zero_sum (without _vector, cf. ordered)

@WardBrian
Copy link
Member Author

@bob-carpenter listed these for consideration in an email with me before implementation work began

  • zero_sum
  • zero_sum_vector
  • sum_to_zero
  • sum_to_zero_vector

I don't have that strong of a preference, but I do think sum_to_zero is more self explanatory without being that much longer

@bob-carpenter
Copy link
Contributor

I like sum_to_zero_vector, because that's how I'd say it out loud.

@WardBrian
Copy link
Member Author

sum_to_zero_vector is shorter than some of the other types (I think cholesky_factor_corr holds that title?), so if that sounds better to others I'm happy to make the change

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.

Good!

@WardBrian WardBrian merged commit 7865be8 into master Aug 13, 2024
3 checks passed
@WardBrian WardBrian deleted the feature/sum-to-zero branch August 13, 2024 14:29
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.

zero_sum_vector type
4 participants