-
Notifications
You must be signed in to change notification settings - Fork 64
editoast: add local_track_name field to OperationalPointPart
#14516
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
base: dev
Are you sure you want to change the base?
editoast: add local_track_name field to OperationalPointPart
#14516
Conversation
|
ac27cd3 to
73606b2
Compare
73606b2 to
ac86618
Compare
9bbc80d to
aca5389
Compare
flomonster
left a comment
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, just need to make small changes with the railjson version.
670a44d to
edce075
Compare
edce075 to
162540d
Compare
2ff4d92 to
41eea92
Compare
acc3540 to
8689614
Compare
| #[schema(inline)] | ||
| pub track: Identifier, | ||
| pub position: f64, | ||
| pub local_track_name: String, |
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.
This should be an Option<NonBlankString>.
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.
Done.
| props["weight"] = weight | ||
| } | ||
| if (opPart.extensions?.sncf != null) props["kp"] = opPart.extensions!!.sncf!!.kp | ||
| if (opPart.localTrackName != null && opPart.localTrackName.isNotEmpty()) { |
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.
The isNotEmpty check should generate an infra loading warning.
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.
| OperationalPointPartResponse( | ||
| trackSectionName, | ||
| opPartTrackSectionOffset.meters, | ||
| opPartProps["local_track_name"] ?: "", |
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.
Should be null instead of empty string
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.
Done.
| part: OperationalPointPart { | ||
| track: Identifier("T1".to_string()), | ||
| position: 0.0, | ||
| local_track_name: "".to_string(), |
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.
None
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.
Done.
| @SuppressFBWarnings({"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"}) | ||
| public class RJSOperationalPointPart extends RJSTrackObject { | ||
| @Json(name = "local_track_name") | ||
| public String localTrackName; |
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.
@Nullable
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.
Done.
| }, | ||
| }, | ||
| part: { track: location.track, position: location.offset }, | ||
| part: { track: location.track, position: location.offset, local_track_name: '' }, |
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.
null
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.
Done.
| }, | ||
| }, | ||
| part: { track: '', position: 0 }, | ||
| part: { track: '', position: 0, local_track_name: '' }, |
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.
null
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.
Done.
| part: matchedOp.parts.at(0) || { | ||
| track: '', | ||
| position: 0, | ||
| local_track_name: '', |
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.
null
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.
Done.
|
|
||
| def add_part(self, track, offset): | ||
| op_part = OperationalPointPart(self, offset) | ||
| def add_part(self, track, offset, local_track_name): |
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.
local_track_name=None
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.
Done.
| class OperationalPointPart: | ||
| operational_point: OperationalPoint | ||
| position: float | ||
| local_track_name: str |
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.
Optional[str]
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.
Done.
7190e1c to
c4fb6a1
Compare
achrafmohye
left a comment
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.
the front LGTM :)
| """ | ||
|
|
||
| pass | ||
| local_track_name: Optional[str] = Field( |
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 don't think it's supposed to be optional
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.
also you should probably use Identifier, so we get reasonable lengths
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 don't think it's supposed to be optional
@Khoyo wdyt ?
| neutral_sections: List[NeutralSection] = field(default_factory=list) | ||
|
|
||
| VERSION = "3.4.13" | ||
| VERSION = "3.4.14" |
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.
you probably should update the packages version as well
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.
Done.
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.
thanks, same for osrd_schemas
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.
Done.
c4fb6a1 to
d319802
Compare
Signed-off-by: hamz2a <atrari.hamza@gmail.com>
d319802 to
291b59c
Compare
closes #14229
Changes
local_track_namestring field toOperationalPointPartschemaosrd_schemasandrailjson_generatorRawInfraRJSParserandpath_propertiescore endpoint