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: fix distance_range_map.to_range_map #8831

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

Castavo
Copy link
Contributor

@Castavo Castavo commented Sep 11, 2024

Without this fix, we can't simulate trains with more than 1 power restriction range.

I added a test case.

@Castavo Castavo added kind:bug Something isn't working severity:major Major severity bug labels Sep 11, 2024
@Castavo Castavo self-assigned this Sep 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.01%. Comparing base (d420d30) to head (62c072a).
Report is 21 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##                dev    #8831    +/-   ##
==========================================
  Coverage     37.01%   37.01%            
+ Complexity     2212     2211     -1     
==========================================
  Files          1254     1255     +1     
  Lines        113938   114240   +302     
  Branches       3189     3182     -7     
==========================================
+ Hits          42177    42290   +113     
- Misses        69864    70059   +195     
+ Partials       1897     1891     -6     
Flag Coverage Δ
core 74.84% <100.00%> (+0.04%) ⬆️
editoast 72.42% <ø> (+<0.01%) ⬆️
front 14.89% <ø> (-0.05%) ⬇️
gateway 2.20% <ø> (ø)
osrdyne 2.71% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.37% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Castavo Castavo force-pushed the core-power-restrictions branch from e7cf9a3 to 914f29e Compare September 12, 2024 07:44
@Castavo Castavo marked this pull request as ready for review September 12, 2024 08:03
@Castavo Castavo requested a review from a team as a code owner September 12, 2024 08:03
@Castavo Castavo requested review from eckter and bougue-pe September 12, 2024 08:03
Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

Thanks for the test too!

Copy link
Contributor

@eckter eckter left a comment

Choose a reason for hiding this comment

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

Oof. I was almost certain that building with closed intervals worked, with the old value being overwritten at the transition. I don't know if it was changed but it's kind of bad that we didn't notice it.

Though there's technically no value at the very end with this change. But I don't think it matters.

@Castavo Castavo mentioned this pull request Sep 12, 2024
1 task
@Castavo
Copy link
Contributor Author

Castavo commented Sep 12, 2024

@eckter I believe the overwriting works when using a MutableRangeMap rather than an ImmutableRangeMap

@Castavo Castavo force-pushed the core-power-restrictions branch from 914f29e to 62c072a Compare September 12, 2024 16:59
Copy link
Contributor

@Erashin Erashin left a comment

Choose a reason for hiding this comment

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

Yay :)

@Castavo Castavo added this pull request to the merge queue Sep 13, 2024
Merged via the queue into dev with commit 6ea7e56 Sep 13, 2024
23 checks passed
@Castavo Castavo deleted the core-power-restrictions branch September 13, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Something isn't working severity:major Major severity bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants