Add timeline determination and validation logic#27
Draft
maarten-ic wants to merge 18 commits into
Draft
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.