-
Notifications
You must be signed in to change notification settings - Fork 41
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
Standardise Evaluate = true handling on records #2288
Comments
Clarifying existing rule on Evaluate. |
* Specify Evaluate for hierarchical components. Closes #2288
In the meeting (#2288 (comment)), it was said that priority would not be given to I also find the both used in this added sentence somewhat unclear:
I get the point of it being applied to all components, but would find it more consistent with the sentence before if the outermost is the one in effect also in this case (and this is how I think it was presented in the meeting). |
While it would certainly be possible to make a poll regarding the precedence of What we really need is a concept for |
Hmm... I had to investigate this more here. It seems the reason Evaluate=true is giving preference is that there were a number of existing models that had this combination (I don't know why Evaluate=false was added in them as it didn't have any effect earlier).
|
Just to make sure there is no confusion here. Do you really mean that these are components with |
Yes, as far as I recall, components with Evaluate=false where sub-components have Evaluate=true. |
The point of reopening was that the decision was based on a discussion where it was clarified that this sort of precedence rule wouldn't be introduced. |
That's a rather good reason why these shouldn't be used as motivation behind design. |
I have nothing agains the added clarification, so no need to revert all of it. |
So, let's do a poll then, I assume this is what you mean:
|
Yes, that makes it clear what is being decided. Thanks! |
Just to confirm, does the second option means that the annotation on a record, for example, overrides any possible annotations on the record elements? So the priority is given to the annotation on the record regardless of whether it is true or false? |
Yes, this is what I consider just a clarification of the old formulation. It has struck me, however, that a useful way of doing this that would be an alternative to (rocket), but without giving precedence to either |
To me that isn't clear.
If we go without giving precedence to Evaluate=true, I would say that only applying it to components that don't already have Evaluate would be the cleanest. |
OK, so it was worth clarifying :-) I agree with @HansOlsson that it would make sense to keep any annotation that was already there. |
This is also the option that would be the easiest to our poor users to understand: when you see |
I was trying to poll but it is really hard to understand the short sentence that is polled on. Could you write down the options a bit more clearly that also specifies what "it" and "them" means. |
The original idea was to not specify it - and only handle non-conflicting ones, but after more thinking I conclude that if nothing is specified the expected result is that it works similarly for records where overriding the value for a record overrides it for all elements https://specification.modelica.org/master/inheritance-modification-and-redeclaration.html#merging-of-modifications That means the new variants are: Full text: The annotation \lstinline!Evaluate! can occur in the component declaration, its type declaration, or a base-class of the type-declaration. Revert Evaluate=true precedence and clarify the issue (eyes): Full text: The annotation \lstinline!Evaluate! can occur in the component declaration, its type declaration, or a base-class of the type-declaration. |
This was also my clear opinion at the beginning of this discussion. While I still think that the analogy with modifying an entire record is a strong argument in favor of overriding for all components, I can also see that there are some good reasons for not overriding for any components, and it would have been interesting to see what kind of support this would get in the poll. Reasons:
|
I chose the eyes. My first thought way that I would have preferred keeping any existing annotations on subcomponents without overriding them. However, it is always possible to specify the annotation on every subcomponent individually when you define the class instead of on the record as a whole. And since it is impossible to specify annotations on subcomponents when you declare a hierarchical component, the only way to modify the annotation specified at the class declaration is by allowing the the annotation on the hierarchical component override the one on a subcomponent. |
Summing up numbers: Seems like a clear decision. |
The newest Dymola version 2019FD01 now handles the
Evaluate = true
annotation as follows:That should probably be standardised to avoid user models behaving differently in future.
The text was updated successfully, but these errors were encountered: