Skip to content
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

Added support for state variables in diagrams #1100

Merged
merged 6 commits into from Apr 21, 2022
Merged

Added support for state variables in diagrams #1100

merged 6 commits into from Apr 21, 2022

Conversation

a-sr
Copy link
Collaborator

@a-sr a-sr commented Apr 14, 2022

Added option to display state variables in reactors. Will be off by default.

Also includes some minor unrelated improvements in the diagrams package.

@a-sr a-sr added the diagrams Problems with diagram synthesis label Apr 18, 2022
Copy link
Collaborator

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! But while trying this, I noticed one small problem. If a state variable is initialized by target code, this target code is omitted. So if we have state foo: int({=bar=}) this is rendered as foo: int(). While I think it is a good idea not to print the verbatim target code in the diagrams, currently it looks like the variable is not initialized. Perhaps, instead, we could insert {=...=} as a placeholder?

@lhstrh
Copy link
Member

lhstrh commented Apr 19, 2022

If we show the funny brackets we might as well show what's between them, no?

@a-sr
Copy link
Collaborator Author

a-sr commented Apr 19, 2022

I agree with @lhstrh. I don't think we should omit or replace target code.
In the end, this is an optional feature, so we do not bloat the diagram by default.

I will revise the PR accordingly; also adjusting reactor parameters to be displayed consistently.

@lhstrh
Copy link
Member

lhstrh commented Apr 20, 2022

Does anything need to change in the VS Code extension to enable this feature (besides updating the submodule)?

@a-sr
Copy link
Collaborator Author

a-sr commented Apr 20, 2022

Does anything need to change in the VS Code extension to enable this feature (besides updating the submodule)?

No, this feature will work on both platforms out-of-the-box.
When I create a PR with changes that only work in Epoch, such as #1055, I will make sure to add a comment. Or do we want add a specific workflow, e.g. adding a dedicated label?

Effective in states variables and parameters.
@a-sr
Copy link
Collaborator Author

a-sr commented Apr 20, 2022

Should be fixed now

@lhstrh
Copy link
Member

lhstrh commented Apr 20, 2022

Does anything need to change in the VS Code extension to enable this feature (besides updating the submodule)?

No, this feature will work on both platforms out-of-the-box. When I create a PR with changes that only work in Epoch, such as #1055, I will make sure to add a comment. Or do we want add a specific workflow, e.g. adding a dedicated label?

That's great! What you're doing now works well. Note that we already have an epoch label.

Copy link
Collaborator

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@cmnrd cmnrd merged commit da3eaf7 into master Apr 21, 2022
@cmnrd cmnrd deleted the diagrams branch April 21, 2022 10:48
@a-sr a-sr added the enhancement Enhancement of existing feature label Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagrams Problems with diagram synthesis enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants