-
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
api: railjson V3 #1933
api: railjson V3 #1933
Conversation
is it what you had in mind? {
"id": "track.42",
"extensions": {
"sncf": {"foo": "bar"}
}
} If so, metaprogramming feels overkill |
It's exactly what we want to achieve here. Metaprog kind of simplified a lot the code. |
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.
- Remove
applicable_train_type
(not used in core) - API could adapt its endpoint to download railjson without extensions
- Rework refs. Could be less flexible.
- Rework signals cosmetic fields
- Remove
bidirectional
from the SwitchPortConnection- The navigability is manged only with routes (needed to be documented)
New route schema suggestion: class Route(BaseObjectTrait):
"""
This class is used to describe routes on the infrastructure.
"""
entry_point: ObjectReference = Field(description="Identifier and type used to define an entry point for the route")
entry_point_direction: ObjectReference = Field(description="Identifier and type used to define an entry point for the route")
exit_point: ObjectReference = Field(description="Identifier and type used to define an exit point for the route")
release_detectors: List[ObjectReference] = Field(
description="Detector allowing the release of resources reserved from the beginning of the route until this one"
)
switches_directions: List[Tuple[ObjectReference, str]] = ... |
2eabb99
to
9e62dad
Compare
1a15d19
to
b482eed
Compare
Codecov Report
@@ Coverage Diff @@
## dev #1933 +/- ##
============================================
+ Coverage 80.12% 80.15% +0.02%
+ Complexity 1636 1631 -5
============================================
Files 261 261
Lines 8448 8354 -94
Branches 939 941 +2
============================================
- Hits 6769 6696 -73
+ Misses 1284 1261 -23
- Partials 395 397 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ea3dbbd
to
7e0cecc
Compare
...main/java/fr/sncf/osrd/railjson/schema/infra/trackranges/SingleDirectionalRJSTrackRange.java
Outdated
Show resolved
Hide resolved
9827427
to
f169206
Compare
f169206
to
9594798
Compare
9594798
to
4901f90
Compare
4901f90
to
7f1a6a3
Compare
close #1909
Changelog in railjson v3
In a nutshell :
Appart from the errors,
ObjectRef
dissappeared from all objects to become aString
.(or a
Waypoint
for route entry/exit point)Cosmetic fields are put in a struct for their scope (
SncfExtension
, orIdentifierExtension
for example).Those structs are put in an other struct containing all different scope of extension (
TrackSectionExtension
, orOperationalPointExtension
for example) and they are optional.Tracksection :
navigability
: suppressedextensions
: new field containingTrackSectionExtensions
structTrackSectionExtensions
: new struct containing optionalTrackSectionSncfExtension
structline_code
,line_name
,track_number
,track_name
are moved inTrackSectionSncfExtension
Detector :
track
: type changed fromObjectRef
toString
(of the track's id)BufferStop :
track
: type changed fromObjectRef
toString
(of the track's id)Waypoint (new) :
BufferStop
orDetector
, This is used for the entry and exit point of the routes.ApplicableDirectionsTrackRange :
track
: type changed fromObjectRef
toString
(of the track's id)DirectionalTrackRange :
track
: type changed fromObjectRef
toString
(of the track's id)TrackEndpoint :
track
: type changed fromObjectRef
toString
(of the track's id)OperationalPoint :
extensions
: new field containingOperationalPointExtensions
structureOperationalPointExtensions
: new struct containingOperationalPointSncfExtension
andOperationalPointIdentifierExtension
structures both optionalname
anduic
are moved inOperationalPointIdentifierExtension
ch_short_label
,ch_long_label
,ci
,ch
,trigram
are moved inOperationalPointSncfExtension
OperationalPointPart
:track
type changed fromObjectRef
toString
(of the track's id)Route :
entry_point
: type changed fromObjectRef
toWaypoint
exit_point
: type changed fromObjectRef
toWaypoint
release_detectors
: type change fromList<ObjectRef>
toList<String>
Signal :
track
: type changed fromObjectRef
toString
(of the track's id)linked_detector
: type changed fromOptional<ObjectRef>
an optionalOptional<String>
extensions
: new field containingSignalExtensions
structSignalExtensions
: new struct containing optionalSignalSncfExtension
default_aspect
,installation_type
,is_in_service
,is_lightable
,is_operational
,label
,physical_organization_group
,responsible_group
,side
,support_type
,type_code
,value
are moved inSignalSncfExtension
Switch :
switch_type
: type changed fromObjectRef
toString
SwitchType :
bidirectional
: suppressedTrackSectionLink :
navigabilty
: suppressed