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

Use more overview tables for annotations #3628

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

henrikt-ma
Copy link
Collaborator

This improves the presentation of some sections in the Annotations chapter, by applying the kind of overview table which is used, for example, in 18.7 Simulations.

This change was triggered by me trying to get an overview of the existing annotations, which isn't easy in in the unstructured sections. More sections could be restructured similarly, but I am keeping down the size of this PR by only taking care of two sections in pressing need, and where the transformation is straight-forward.

Also fixing some minor issues which appear to be results of the recent work on formalizing the notation.

@HansOlsson
Copy link
Collaborator

I can understand that this helps, but my concern with adding such tables is that it is a form of duplicated information, which adds a maintenance burden.

@henrikt-ma
Copy link
Collaborator Author

I can understand that this helps, but my concern with adding such tables is that it is a form of duplicated information, which adds a maintenance burden.

Yes, it is a bit of maintenance burden, but at least to me the burden is easily motivated by the tremendous help it provides me when navigating the document.

@HansOlsson HansOlsson added this to the 2025-January milestone Jan 8, 2025
@HansOlsson
Copy link
Collaborator

Language group: looks good, avoids having annotations at different levels in toc.

When creating a component of the given class, and the annotation is specified it gives the recommended component name.
\end{lstlisting}\end{synopsis}
\begin{semantics}
\lstinline!defaultComponentName! is a class annotation giving the recommended component name to use when creating a component of the class.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
\lstinline!defaultComponentName! is a class annotation giving the recommended component name to use when creating a component of the class.
The \lstinline!defaultComponentName! is a class annotation giving the recommended component name to use when creating a component of the class.

Avoid starting a sentence with a lower-case letter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are numerous examples of starting sentences like this with a lower case initial in inline code, so I don't think we should start using another style here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, there are 109 lines starting with The \lstinline and 124 lines starting with \lstinline, many of which don't start sentences - perhaps half are actual sentences), so I wouldn't say it is a new style - just one that hasn't been followed that well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, 109 lines starting with The \lstinline, 28 A \lstinline and 4 An \lstinline
And there are only 76 lines starting with \lstinline followed by a lower-case letter - many of them not being real sentences, but just items in a list.

When creating a component, it is recommended to generate a declaration of the form
\end{lstlisting}\end{synopsis}
\begin{semantics}
\lstinline!defaultComponentPrefixes! is a class annotation giving a whitespace separated list of recommended type prefixes to include in the \lstinline[language=grammar]!type-prefix! part of a \lstinline[language=grammar]!component-clause1! generated when creating a component of the class:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
\lstinline!defaultComponentPrefixes! is a class annotation giving a whitespace separated list of recommended type prefixes to include in the \lstinline[language=grammar]!type-prefix! part of a \lstinline[language=grammar]!component-clause1! generated when creating a component of the class:
The \lstinline!defaultComponentPrefixes! is a class annotation giving a whitespace separated list of recommended type prefixes to include in the \lstinline[language=grammar]!type-prefix! part of a \lstinline[language=grammar]!component-clause1! generated when creating a component of the class:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as above; better to not inject The.

The default is an empty string.

\begin{nonnormative}
In combination with \lstinline!defaultComponentName! it can be used to make it easy for users to create \lstinline!inner! components matching the \lstinline!outer! declarations; see also example below.
If the prefixes contain \lstinline!inner! or \lstinline!outer! and the default name cannot be used (e.g., since it is already in use) it is recommended to give a diagnostic.
In combination with \lstinline!defaultComponentName!, \lstinline!defaultComponentPrefixes! can be used to make it easy for users to create \lstinline!inner! components matching the \lstinline!outer! declarations; see also example below.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
In combination with \lstinline!defaultComponentName!, \lstinline!defaultComponentPrefixes! can be used to make it easy for users to create \lstinline!inner! components matching the \lstinline!outer! declarations; see also example below.
In combination with \lstinline!defaultComponentName!, the \lstinline!defaultComponentPrefixes! can be used to make it easy for users to create \lstinline!inner! components matching the \lstinline!outer! declarations; see also example below.

Not sure, but think it is better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It would have made more sense if we didn't start sentences without The in front of lower case initials in inline code.

{\lstinline!defaultComponentPrefixes!} & Default type prefixes for new components & \Cref{modelica:defaultComponentPrefixes}\\
{\lstinline!missingInnerMessage!} & Message for unresolved \lstinline!outer! & \Cref{modelica:missingInnerMessage}\\
{\lstinline!absoluteValue!} & Quantity is absolute & \Cref{modelica:absoluteValue}\\
{\lstinline!defaultConnectionStructurallyInconsistent!} & Relax verification of non-simulation class & \Cref{modelica:defaultConnectionStructurallyInconsistent}\\
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{\lstinline!defaultConnectionStructurallyInconsistent!} & Relax verification of non-simulation class & \Cref{modelica:defaultConnectionStructurallyInconsistent}\\
{\lstinline!defaultConnectionStructurallyInconsistent!} & Relax verification of connections & \Cref{modelica:defaultConnectionStructurallyInconsistent}\\

I think that mentioning non-simulation is more confusing than helping, but I'm not sure if the new text is good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about this?

Suggested change
{\lstinline!defaultConnectionStructurallyInconsistent!} & Relax verification of non-simulation class & \Cref{modelica:defaultConnectionStructurallyInconsistent}\\
{\lstinline!defaultConnectionStructurallyInconsistent!} & Suppress certain verification errors & \Cref{modelica:defaultConnectionStructurallyInconsistent}\\

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, looks ok

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or, "balancing" instead of "verification"? (The problem is how to describe so that it makes sense - it doesn't mean that the models are less correct overall; just different.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants