-
Notifications
You must be signed in to change notification settings - Fork 13
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
BHoM_Engine: rounding issues fixed #3430
Conversation
@pawelbaran to confirm, the following actions are now queued:
|
Co-Authored-By: Pawel Baran <pawel.baran@burohappold.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with BHoM/DiffingTests_Prototypes#22 and agreed the change with @pawelbaran.
@BHoMBot check required |
@pawelbaran to confirm, the following actions are now queued:
|
FAO: @adecler @pawelbaran @IsakNaslundBh The check they wish to have dispensation on is documentation-compliance. If you are providing dispensation on this occasion, please reply with:
|
@pawelbaran to confirm, the following actions are now queued:
|
Dispensating documentation compliance as it is out of scope of this PR |
@BHoMBot this is a DevOps instruction. I am authorising dispensation to be granted on check ref. 32526179440 |
@pawelbaran I have now provided a passing check on reference |
@BHoMBot check copyright-compliance |
@pawelbaran to confirm, the following actions are now queued:
There are 7 requests in the queue ahead of you. |
@BHoMBot check ready-to-merge |
@pawelbaran to confirm, the following actions are now queued:
|
Issues addressed by this PR
Closes #3426
Closes #3429
Test files
On SharePoint, UTs added
Changelog
Additional comments
So far we had just one method,
RoundWithTolerance
, which did round the numbers towards the floor regardless of sign, i.e. 121 rounded to 2 would yield 120 and equally, -121 rounded to 2 would yield -120. This is potentially ambiguous on 2 levels:As a remedy I propose 3 separate methods that follow the standard rounding conventions:
RoundToFloor
Round
RoundToCeiling
I believe this is a right move for the general audience, although I understand you may need the current implementation for diffing @alelom - if so, I'd suggest moving it to Diffing_Engine as a private method. Let's catch up on that 👍