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

Param::Set: fix truncation of floating-point values #1137

Merged
merged 6 commits into from
Sep 28, 2022

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Sep 9, 2022

🦟 Bug fix

Fixes #1136, #103

Summary

As noted in #1136, the Param::Set API currently truncates floating point values, demonstrated by the failing test added in f45d371. In 1107f21, the ParamStreamer helper is used in Param::Set with maximum digits to prevent truncation. The expected values in a test are adjusted in 9ef6cd7 to expect more precision.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Prevent truncation of floating point digits in
Param::Set and Param::GetDefault.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters requested a review from azeey as a code owner September 9, 2022 09:56
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Sep 9, 2022
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Merging #1137 (56f1cdd) into sdf13 (e645951) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##            sdf13    #1137   +/-   ##
=======================================
  Coverage   87.00%   87.00%           
=======================================
  Files         125      125           
  Lines       15834    15834           
=======================================
  Hits        13777    13777           
  Misses       2057     2057           
Impacted Files Coverage Δ
include/sdf/Param.hh 80.72% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@scpeters scpeters requested a review from jennuine September 9, 2022 17:18
Copy link
Collaborator

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

LGTM, I'll formally approve after the garden release so this doesn't accidentally get merged

@scpeters
Copy link
Member Author

@iche033 I realized that this should also fix #103, which you reported long ago and added a test for. I've cherry-picked your test to this branch, but it doesn't have a sign-off message. Are you comfortable with amending that commit with your sign-off message on this branch?

@iche033 iche033 force-pushed the scpeters/param_set_digits branch from 60d0070 to 5c9edf8 Compare September 16, 2022 20:15
@iche033
Copy link
Contributor

iche033 commented Sep 16, 2022

just amended and signed off the last commit

@scpeters
Copy link
Member Author

LGTM, I'll formally approve after the garden release so this doesn't accidentally get merged

@jennuine we have a stable release of sdformat13, so I think we can start merging for 13.1

@scpeters scpeters merged commit 91a6ffc into sdf13 Sep 28, 2022
@scpeters scpeters deleted the scpeters/param_set_digits branch September 28, 2022 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants