-
Notifications
You must be signed in to change notification settings - Fork 46
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
editoast: update temporary speed limit groups import endpoint #9381
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9381 +/- ##
============================================
- Coverage 39.62% 38.06% -1.57%
============================================
Files 1300 995 -305
Lines 99158 91661 -7497
Branches 3282 1174 -2108
============================================
- Hits 39294 34888 -4406
+ Misses 57931 56319 -1612
+ Partials 1933 454 -1479
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
0a87049
to
2973f9f
Compare
d5ea850
to
f97338e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just seen the issue. I don't really like the idea of having several endpoints to create the same object. I'd really prefer this to be done on the import side and not in editoast.
When importing, do you have information on the "line" "track" and "pk" of the start and end of the temporary speed limit zone?
Note
Using the InfraCache is really not ideal for an endpoint. It makes the endpoint unscalable because it's stateful. If you keep the endpoint this way, you'll need to modify the Gateway configuration in prod (to redirect to editoast-statefull).
wdym? there is only
We have signals and their location, so we could get that, yes. The import side does not have the full track graph with the various corrections (eg. we do not run the kd-tree), and can't run them easily since it lacks track geometry. |
I mean that we should keep the CRUD endpoints of an object quite simple and close from it's model. Usualy transformation are done by the user (using utility endpoint or by it's own). Since we don't have LRS in OSRD (for now) it's really difficult to import linear objects such as speed limits (all of them). However, all these objects are converted from a start point to an end point into a list of track ranges in the import script and not by editoast. This PR goes against this paradigm, hence my caution.
Maybe editoast can help with this, but with a more generic and reusable endpoint 🤷 |
da0cb7a
to
2425cab
Compare
Following discussions with @Khoyo and @flomonster the temporary speed limits group endpoint has been split into two:
|
e9d2af0
to
19f8aa2
Compare
0ca14eb
to
3200621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR! Not much to say on the process apart from the points we discussed orally a while ago, but that's for another PR, if any.
I believe a few panic!
s should be turned into proper errors, and there is probably a few ways to linearize to code using Option<>
's functional interface and the ?
operator.
c37a70b
to
12c1193
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for front side :)
8d84a1a
to
def2d71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Sorry about the time I took to review this. I hope that didn't block rest of the implementation fo the feature. The last batch of comments / responses:
986b709
to
d0c7a95
Compare
Split the endpoint in two: - One endpoint remains responsible from importing temporary speed limits and their list of track ranges. - A new infra endpoint `delimited_area` returns the list of track ranges inside an area delimited by a list of entries and exits (directed locations on the tracks, quite similar to the position and direction of signs). Signed-off-by: Loup Federico <[email protected]>
d0c7a95
to
79b6e32
Compare
fixes #9399
/infra/{infra_id}/delimited_area
that returns the list of track sections inside an area delimited by entry and exit directed locations (i.e. a position on a track and a direction, similar to a light version of a sign with only the relevant positional information).temporary_speed_limit.rs
tests.