-
Notifications
You must be signed in to change notification settings - Fork 43
Generalize modern table presentation with application to Protection #3770
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
Open
henrikt-ma
wants to merge
1
commit into
modelica:master
Choose a base branch
from
henrikt-ma:cleanup/access-control-tables
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
Making it consistent with the other ones.
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 are right that the PR is currently inconsistent and that this needs to be fixed.
However, I am not sure it's such a good idea to present the sub-annotations in the same way as the annotations residing directly under
annotation(…).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.
Well, many sub-annotations are defined as part of a record https://specification.modelica.org/master/annotations.html#annotations-for-documentation https://specification.modelica.org/master/annotations.html#annotations-for-figures https://specification.modelica.org/master/annotations.html#modelica:Dialog
So, the alternative would be to have "record Protection" preceding this declaration as in the current specification, but it would seem odd with just one element, and normally the entry would then be called "Protection".
Uh oh!
There was an error while loading. Please reload this page.
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 see some similarities with those examples, but as you already noted they are not quite the same:
Documentationis not a sub-annotation, so it could be converted to the new style if we really wanted to. However, there is not that much to say aboutDocumentationas a whole, so it makes sense to me that we don't present it in the same way as an annotation which we are able to cover in more detail without only referring to other sections.Figureis a type and not the name of an annotation, so it looks correct to me that we don't present it as an annotation by itself, and that we don't include it in any summary table. However, if there was a way to presentDocumentation.figuresas a sub-annotation, it would have been nice to do so at the top of https://specification.modelica.org/master/annotations.html#annotations-for-figures, something like this:Dialogproperly presented already. WithloadSelectorand friends being described together with the rest ofDialog, I don't see a need to change anything regarding them. (Having separate annotation definitions forDialog.loadSelectoretc would just look odd to me since they are such an integral part ofDialog.)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.
Well, one thing to consider is that not only is it different, it also breaks the idea that the annotations are described by legal Modelica code.
E.g., we use
/*literal*/to avoid having a special keyword, whereasProtection.accessis not a valid name for a component - and the most obvious way of handling it:'Protection.access'would just create more confusion.So, having
record Protectionin front of may seem a bit excessive, but at least we have some precedence and it is legal Modelica.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 problems I see with
record Protectionare:I mean, this becomes a very cumbersome way to say that the
accessmember aProtectionis a/*literal*/ constant Access:While I would still much prefer the non-valid Modelica
Protection.accessnotation, one could also consider some sort of class modification notation: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.
Well, the text already has a link to the rest of the contents of Protection, and master already has the
So, why not keep it for now?
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.
Various variants were considered, including having Protection in the text and having the full Protection-annotation followed by simplified form.
Open a new issue for resolving this.