Add timeline determination and validation logic#27
Conversation
- Make most TimelineTree variables "private". Accessor functions to be created for public API. - Add tests
- `X | None` is not supported in py3.9 -> replace with `Optional` - Fix flake8 issues
- Add check_consistent() to TimelineTree to check timeline consistency of all conduits - Keep track of "parent" components that have O_I/S ports sending in a particular timeline - Additional public API properties for TimelineNode
2a9d101 to
2e0e99b
Compare
|
I've looked at this and thought about it a bit, and I have some preliminary comments and answers. To be discussed:
Provisional answers:
|
|
|
This pull request is superseded by #62 |
This PR introduces a timeline determination and static checker to
ymmsl.v0_2.TODO:
TimelineTree/TimelineNodeAPI should be public (based on the needs of ymmsl2svg)The main idea behind this PR is that all timelines in a model form a tree (the TimelineTree) with the root timeline (":") as root of the tree.
Each component "lives" in a certain timeline, which is also the timeline of their F_INIT and O_F ports. O_I and S ports belong to a sub-timeline of the component's timeline:
<component_timeline>:<port_timeline>(according to the timeline annotation in the yMMSL ports definition).What this PR does:
TimelineTreeobject, with aTimelineNodefor each timeline in the model.repeaterfilters).lastconduit filter when the sender is an O_F port in the root timeline.TimelineTree.check_consistent(). This ensures that all conduits connect to the right timelines. This is more extensive than the consistency during the previous pass:repeaterfilters are consistent with the other conduits connecting to the F_INIT ports.Some things to discuss (perhaps):
ymmsl.v0_2.timelinesyet, since it feels like I should find theTimelineobject here (but instead it's TimelineTree/Node). What do you think?N.B. I've put the error messages and logic for providing details in separate Error classes, to separate that as much as possible from the logic checks themselves.