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

Fix incorrect input saving when switching simulations during a running calculation #10497

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

kmer2016
Copy link
Contributor

closes #10480
When a different simulation is selected while a calculation is still running, the new simulation’s inputs overwrite the inputs of the ongoing calculation. This causes a mismatch between the inputs used for the calculation and the results.

Now, the inputs for the simulation being calculated are stored in a different state variable than the one used for the selected simulation.

@kmer2016 kmer2016 requested a review from a team as a code owner January 23, 2025 10:05
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 23, 2025
@kmer2016 kmer2016 requested review from theocrsb, SharglutDev and RomainValls and removed request for theocrsb January 23, 2025 10:05
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

⚠️ 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 81.94%. Comparing base (7a08098) to head (3b7c890).

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

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10497   +/-   ##
=======================================
  Coverage   81.94%   81.94%           
=======================================
  Files        1078     1078           
  Lines      107587   107664   +77     
  Branches      733      734    +1     
=======================================
+ Hits        88158    88229   +71     
- Misses      19390    19396    +6     
  Partials       39       39           
Flag Coverage Δ
editoast 74.38% <ø> (-0.02%) ⬇️
front 89.43% <100.00%> (+0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 88.14% <ø> (ø)

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.

@kmer2016 kmer2016 force-pushed the cnh/front/fix-wrong-inputs-saved branch from cf10bc1 to d4cca27 Compare January 23, 2025 10:08
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Thank you for the fix, it works great !

But now that it works, it reveals some strange behaviors that we should correct I think.

front/src/applications/stdcm/views/StdcmView.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

If I switch between simulations, it seems like the speed limit tag isn't reset

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this bug is still there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't reproduce the bug
Capture vidéo du 10-02-2025 18:13:25.webm

Copy link
Contributor

Choose a reason for hiding this comment

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

If I switch between a simulation with a short form and a long one, the viewport changes. I think it should stay as it is when we switch (you can double check with @thibautsailly). Also maybe we should remove the animation for the via in that case, it's a little weird.
https://github.com/user-attachments/assets/0fbadb77-d587-40b3-bd5b-58f828ffeae5

Copy link
Contributor

@SharglutDev SharglutDev Feb 6, 2025

Choose a reason for hiding this comment

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

The last part of the comment is fixed but the first part

I think it should stay as it is when we switch

is still there. What did @thibautsailly said about that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

confirmed by @thibautsailly

@kmer2016 kmer2016 force-pushed the cnh/front/fix-wrong-inputs-saved branch from d4cca27 to 8016bc4 Compare January 23, 2025 17:02
Copy link
Contributor

@RomainValls RomainValls left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested and it works well. ✅

@kmer2016 kmer2016 force-pushed the cnh/front/fix-wrong-inputs-saved branch 3 times, most recently from aeaf7ba to 495a832 Compare February 5, 2025 14:45
@@ -107,7 +107,10 @@
}

.stdcm-vias-bundle {
animation: bouncin-in 0.75s cubic-bezier(0.567, -0.475, 0, 1);

&.animated {
Copy link
Contributor

Choose a reason for hiding this comment

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

With this behavior, we have the animation after switching simulation and clearing a via input

Enregistrement.de.l.ecran.2025-02-06.a.12.50.40.mov

Copy link
Contributor

@SharglutDev SharglutDev Feb 6, 2025

Choose a reason for hiding this comment

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

The last part of the comment is fixed but the first part

I think it should stay as it is when we switch

is still there. What did @thibautsailly said about that ?

@kmer2016 kmer2016 force-pushed the cnh/front/fix-wrong-inputs-saved branch 2 times, most recently from fd06672 to fba5713 Compare February 10, 2025 16:23
… running calculation

When a different simulation is selected while a calculation is still running,
the new simulation’s inputs overwrite the inputs of the ongoing calculation.
This causes a mismatch between the inputs used for the calculation and the results.

Now, the inputs for the simulation being calculated are stored in a different
state variable than the one used for the selected simulation.

Signed-off-by: nncluzu <[email protected]>
@kmer2016 kmer2016 force-pushed the cnh/front/fix-wrong-inputs-saved branch from fba5713 to 3b7c890 Compare February 10, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong inputs saved for the simulation
4 participants