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

core: use rounding when converting from double to long #5266

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

eckter
Copy link
Contributor

@eckter eckter commented Oct 10, 2023

This prevents off-by-one errors in the few places where we convert back and forth from one to the other. Most notably, when saving the pathfinding result in the db and re-loading it to run standalone simulations.

@eckter eckter requested a review from a team as a code owner October 10, 2023 08:25
This prevents off-by-one errors in the few places
where we convert back and forth from one to the other.
Most notably, when saving the pathfinding result in the db
and re-loading it to run standalone simulations.
@eckter eckter force-pushed the ech/core-use-rounding branch from 07477e6 to e737852 Compare October 10, 2023 08:55
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #5266 (e737852) into dev (e0a1bb7) will increase coverage by 0.00%.
The diff coverage is 75.00%.

@@            Coverage Diff            @@
##                dev    #5266   +/-   ##
=========================================
  Coverage     18.66%   18.66%           
- Complexity     2318     2320    +2     
=========================================
  Files           856      856           
  Lines        104007   104011    +4     
  Branches       2409     2410    +1     
=========================================
+ Hits          19409    19414    +5     
  Misses        83257    83257           
+ Partials       1341     1340    -1     
Flag Coverage Δ
core 78.98% <75.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...c/main/kotlin/fr/sncf/osrd/utils/units/Distance.kt 64.51% <100.00%> (ø)
...c/main/kotlin/fr/sncf/osrd/utils/units/Duration.kt 0.00% <0.00%> (ø)
.../src/main/kotlin/fr/sncf/osrd/utils/units/Speed.kt 25.00% <50.00%> (ø)
...implementation/tracks/directed/TrackRangeView.java 86.95% <90.00%> (+0.59%) ⬆️
...va/fr/sncf/osrd/standalone_sim/SignalProjection.kt 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@eckter eckter enabled auto-merge October 10, 2023 09:08
@eckter eckter added this pull request to the merge queue Oct 10, 2023
Merged via the queue into dev with commit 3124c69 Oct 10, 2023
@eckter eckter deleted the ech/core-use-rounding branch October 10, 2023 09: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.

core: paths generated by the pathfinding may be invalid in standalone sim
2 participants