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

Add CI/CH/UIC codes next to station names #6180

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

Yohh
Copy link
Contributor

@Yohh Yohh commented Dec 21, 2023

editoast:

  • add uic and ch to PathfindingResponse and PathWaypoint struct
  • get them from waypoint in Pathfinding impl
  • add ch to ResultStops struct, add_stops_additional_information fn and train_with_simulation_output_fixture_set fn
  • update openapi.yaml

front:

  • create formatUicToCi in utils/strings.ts
  • add CI/CH codes in ModalSugerredVias, StationCard and DisplayVias
  • add CH code in AllowancesModalOP and DriverTrainScheduleStop
  • add elipsis to vias name in modal
  • replace suggered by suggested

@Yohh Yohh requested review from a team as code owners December 21, 2023 12:03
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 52 lines in your changes are missing coverage. Please review.

Comparison is base (ee0649e) 26.66% compared to head (c7e60ec) 26.67%.
Report is 1 commits behind head on dev.

Files Patch % Lines
...anageTrainSchedule/Itinerary/ModalSuggeredVias.tsx 0.00% 31 Missing ⚠️
...ents/ManageTrainSchedule/Itinerary/DisplayVias.tsx 0.00% 5 Missing ⚠️
front/src/common/StationCard.tsx 0.00% 4 Missing ⚠️
...ts/DriverTrainSchedule/DriverTrainScheduleStop.tsx 0.00% 4 Missing ⚠️
...nageTrainSchedule/Allowances/AllowancesModalOP.tsx 0.00% 4 Missing ⚠️
front/src/utils/strings.ts 80.00% 2 Missing ⚠️
...oast/src/views/train_schedule/simulation_report.rs 50.00% 1 Missing ⚠️
...portTrainSchedule/generateTrainSchedulesPayload.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #6180      +/-   ##
============================================
+ Coverage     26.66%   26.67%   +0.01%     
  Complexity     2139     2139              
============================================
  Files           931      931              
  Lines        123397   123444      +47     
  Branches       2682     2682              
============================================
+ Hits          32901    32927      +26     
- Misses        88898    88919      +21     
  Partials       1598     1598              
Flag Coverage Δ
core 78.87% <ø> (ø)
editoast 74.95% <94.73%> (+<0.01%) ⬆️
front 9.38% <23.88%> (+0.01%) ⬆️
gateway 2.55% <ø> (ø)

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.

@Yohh Yohh requested a review from a team as a code owner December 21, 2023 12:16
@Yohh Yohh force-pushed the yoh/display-CI-CH-codes branch from f1874d4 to 5ef96c5 Compare December 21, 2023 12:22
@multun
Copy link
Contributor

multun commented Dec 21, 2023

I understand this is the easier way to implement it, but ch codes aren't something international. Couldn't we use an enum of common location specifiers ? I believe the UIC has a list of CH equivalents

@Yohh Yohh force-pushed the yoh/display-CI-CH-codes branch 5 times, most recently from 9a38335 to a464b17 Compare December 21, 2023 13:32
@axrolld
Copy link
Contributor

axrolld commented Dec 21, 2023

@multun didn't we agree on implementing this that way for now and think about a more international-friendly model later ? We were already displaying those info in the search results, this PR is just supposed to spread this infos.

I agree that it is not the target but this is a quick improvement.

@Yohh Yohh force-pushed the yoh/display-CI-CH-codes branch from a464b17 to 7c6c5fb Compare December 21, 2023 13:36
@multun
Copy link
Contributor

multun commented Dec 21, 2023

I don't think we did agree: this change starts to hardcode assumptions about CH codes, which is pretty much documented nowhere on the internet. Can't we delay this a little bit, and take the time to make an internationally acceptable list of place types? I'm pretty sure I've seen one in UIC documentation.

The plan would then be as follows:

  • get or make a list of operational point types
  • add it to the data model and documentation
  • during import, convert CH codes into this enum's equivalent

Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

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

A few minor comments (some stylistic, some about factorizing code). But nothing blocking from merging.

@Yohh Yohh force-pushed the yoh/display-CI-CH-codes branch 2 times, most recently from e9822c0 to f695fdd Compare December 21, 2023 15:02
Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

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

LGTM (peer reviewed), one small fix I've missed:

@Yohh Yohh force-pushed the yoh/display-CI-CH-codes branch from f695fdd to 2e458fe Compare December 21, 2023 15:10
@leovalais leovalais changed the title display ci ch codes Add CI/CH/UIC codes next to station names Dec 21, 2023
Copy link
Contributor

@Math-R Math-R left a comment

Choose a reason for hiding this comment

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

LGTM :)

@axrolld
Copy link
Contributor

axrolld commented Dec 21, 2023

The plan would then be as follows:

  • get or make a list of operational point types
  • add it to the data model and documentation
  • during import, convert CH codes into this enum's equivalent

This plan should be kept in mind for later, but once again this task was to spread those info quickly to acess them in front end. We know it's not the target. It's a quick unperfect improvement.
Are you ok if i open a new issue to make an internationally acceptable list of place types ? This can easily be done later.

@multun
Copy link
Contributor

multun commented Dec 21, 2023

sure. I'm worried I'll be one more thing on a list of hacks we don't process as fast as we create.

@flomonster
Copy link
Contributor

The purpose of this PR is to add context to the OPs. For the moment, we haven't generalized the trigram and CH code system. But this can be done later. During a side discussion, we agreed to carry out this task. However, it's important to ensure that the services work properly when the SNCF extension is not filled in.

@Yohh
Copy link
Contributor Author

Yohh commented Dec 21, 2023

image
image

with german infra, CH and CI are null, everything works fine
@flomonster is it ok for you?

@axrolld
Copy link
Contributor

axrolld commented Dec 21, 2023

I created this issue to keep track of the leftover work. Feel free to add some details to it !

Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

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

Left some comments :)

@Math-R Math-R force-pushed the yoh/display-CI-CH-codes branch 2 times, most recently from bfa2f12 to 419861e Compare December 22, 2023 10:46
Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

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

LGTM ✅ I didn't test but I believe the previous reviewers did it :)

@clarani clarani added this pull request to the merge queue Dec 22, 2023
@clarani clarani removed this pull request from the merge queue due to a manual request Dec 22, 2023
editoast: pathfinding: add CI/CH codes to pathfinding response
- add uic and ch to PathfindingResponse and PathWaypoint struct
- get them from waypoint in Pathfinding impl
- add ch to ResultStops struct, add_stops_additional_information fn and train_with_simulation_output_fixture_set fn
- update openapi.yaml

front: pathfinding: display CI/CH codes
- create formatUicToCi in utils/strings.ts
- add CI/CH codes in ModalSugerredVias, StationCard and DisplayVias
- add CH code in AllowancesModalOP and DriverTrainScheduleStop
- add elipsis to vias name in modal
- replace suggered by suggested

tests:
- add ch and uic to steps in test_pathfinding.py
@clarani clarani force-pushed the yoh/display-CI-CH-codes branch from 419861e to c7e60ec Compare December 22, 2023 11:09
@clarani clarani enabled auto-merge December 22, 2023 11:09
@clarani clarani added this pull request to the merge queue Dec 22, 2023
Merged via the queue into dev with commit d316156 Dec 22, 2023
@clarani clarani deleted the yoh/display-CI-CH-codes branch December 22, 2023 11:23
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.

10 participants