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

Clean up and enhance simulation report sheet #10001

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

Conversation

achrafmohye
Copy link
Contributor

Closes #10000

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Dec 10, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

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

Codecov Report

Attention: Patch coverage is 89.79592% with 20 lines in your changes missing coverage. Please review.

Project coverage is 81.42%. Comparing base (3bc6d02) to head (d040ddf).
Report is 14 commits behind head on dev.

Files with missing lines Patch % Lines
...cations/stdcm/utils/formatSimulationReportSheet.ts 0.00% 9 Missing ⚠️
front/src/reducers/osrdconf/stdcmConf/index.ts 18.18% 9 Missing ⚠️
front/src/modules/pathfinding/utils.ts 33.33% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10001      +/-   ##
==========================================
+ Coverage   79.94%   81.42%   +1.48%     
==========================================
  Files        1057     1057              
  Lines      106302   104272    -2030     
  Branches      724      720       -4     
==========================================
- Hits        84980    84902      -78     
+ Misses      21280    19328    -1952     
  Partials       42       42              
Flag Coverage Δ
editoast 73.59% <ø> (-0.34%) ⬇️
front 89.16% <89.79%> (-0.04%) ⬇️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.00% <ø> (ø)

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.

@achrafmohye achrafmohye force-pushed the ame/clean-stdcm-simualtion-report-sheet branch 2 times, most recently from c95d87e to 95d9784 Compare December 10, 2024 09:34
@achrafmohye achrafmohye self-assigned this Dec 10, 2024
@achrafmohye achrafmohye force-pushed the ame/clean-stdcm-simualtion-report-sheet branch from 1bb87f2 to 47d2bbc Compare December 10, 2024 11:08
@achrafmohye achrafmohye marked this pull request as ready for review December 10, 2024 11:09
@achrafmohye achrafmohye requested a review from a team as a code owner December 10, 2024 11:09
@achrafmohye achrafmohye requested review from clarani and removed request for SharglutDev December 10, 2024 11:11
Copy link
Contributor

@Akctarus Akctarus left a comment

Choose a reason for hiding this comment

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

Tested, ty for this clean, just left few comments:

Tolerance could be set a little higher
Capture d’écran 2024-12-10 à 17 30 23

The data seems to be shifted to the right of the column headings, so I think there's an extra margin somewhere. If you fix this problem, you'll also have to watch out for lines with stops, which are displayed in a different way from the others

Capture d’écran 2024-12-10 à 17 32 22

Comment on lines 5 to 7
"conventionalSign": "signe conv.",
"convoy": "convoi",
"crossedATE": "ATE croisé",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to also delete these on the english file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still used here in SimulationReportSheetScenario

Copy link
Contributor

Choose a reason for hiding this comment

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

You must have the same modifications in the french and english translation files:

  • either the keys are not used anymore and it should be removed in both files
  • or they are still used and you should not removed it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry i got it know i misread your comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

@@ -112,7 +112,7 @@ export default function useSearchOperationalPoint({

if (chCodeFilter === undefined) return true;

return result.ch.toLocaleLowerCase().includes(chCodeFilter.trim().toLowerCase());
return result?.ch?.toLocaleLowerCase().includes(chCodeFilter.trim().toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if it's necessary, but if it makes the code more robust we should keep it

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 encountered some issues not relating to this where i have a blank page :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Hum are you sure it is necessary ? Can you check again now ? :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

Comment on lines 5 to 7
"conventionalSign": "signe conv.",
"convoy": "convoi",
"crossedATE": "ATE croisé",
Copy link
Contributor

Choose a reason for hiding this comment

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

You must have the same modifications in the french and english translation files:

  • either the keys are not used anymore and it should be removed in both files
  • or they are still used and you should not removed it

@@ -17,7 +17,7 @@
"passageStop": "passage",
"refEngine": "Ref. engine",
"referenceEngine": "reference engine",
"referencePath": "Reference path",
"length": "Length",
Copy link
Contributor

Choose a reason for hiding this comment

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

The keys should be alphabetically ordered :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

@@ -54,6 +54,7 @@ const StcdmResults = ({
const hasSimulationResults = hasResults(outputs);

const { trackConflicts, workConflicts } = useConflictsMessages(t, outputs);
const { username } = useAuth();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move this hook directly in StdcmReportSheet

Copy link
Contributor Author

@achrafmohye achrafmohye Dec 12, 2024

Choose a reason for hiding this comment

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

i've encountered an issue doing that of redux being out of scope of the Provider

stdcmResponse,
stdcmTrainResult,
setPathProperties,
dispatch
Copy link
Contributor

Choose a reason for hiding this comment

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

You can get the dispatch directly in useStdcmResults with useAppDispatch()

Suggested change
dispatch

@@ -38,6 +38,7 @@ const useStdcmForm = (): StdcmSimulationInputs => {
pathSteps,
departureDate: originArrival?.arrivalDate,
departureTime: originArrival?.arrivalTime,
tolerances: origin.tolerances,
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the tolerances are on the destination ?
Moreover, with this data structure, you will loose a piece of information: on which extremity the tolerances are defined :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

};
});

const operationalPointsWithUniqueIds = operationalPointsWithMetadata.map((op, index) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to use operationalPointsWithMetadata to define the ops for the manchette, you can keep operational_points

Suggested change
const operationalPointsWithUniqueIds = operationalPointsWithMetadata.map((op, index) => ({
const operationalPointsWithUniqueIds = operational_points.map((op, index) => ({

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

@@ -112,7 +112,7 @@ export default function useSearchOperationalPoint({

if (chCodeFilter === undefined) return true;

return result.ch.toLocaleLowerCase().includes(chCodeFilter.trim().toLowerCase());
return result?.ch?.toLocaleLowerCase().includes(chCodeFilter.trim().toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

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

Hum are you sure it is necessary ? Can you check again now ? :/

@achrafmohye achrafmohye force-pushed the ame/clean-stdcm-simualtion-report-sheet branch from 47d2bbc to a5c1dad Compare December 11, 2024 10:02
@clarani
Copy link
Contributor

clarani commented Dec 11, 2024

Found some bugs:

  • I have these inputs (no linked path, tolerances on the arrival and not on the departure)
    image
    and this simulation sheet:
    image

    • a linked path is given, but I haven't specified any
    • the tolerances are specified on the departure and not the arrival
  • I can't test it right now, but I think that if I give a posterior train linked, then it may not be correctly displayed

@achrafmohye achrafmohye force-pushed the ame/clean-stdcm-simualtion-report-sheet branch from 205ed74 to 236f1d7 Compare December 24, 2024 15:49
Signed-off-by: Achraf Mohyeddine <[email protected]>
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.

Clean up and enhance simulation report sheet
4 participants