ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
remove unused code (#3622)
There are some components defined that are not used in the blocks or functions. This PR removes them.
Removing protected parameters (even if unused) seems problematic with current versioning rules.
Removing protected parameters (even if unused) seems problematic with current versioning rules.
Indeed. It is not covered by conversion rules. For that reason, we mentioned every removed component as backward-compatibility breaking change in the release notes and require a new major version.
So we could remove the protected parameters from functions, as these quantities cannot be accessed from outside and keep them in models and blocks. Additionally, all commented code fragments shall be removed.
See https://github.com/adrpo/Modelica/pull/1
@AHaumer @adrpo Would you agree to better document the code lines? I understand that @ahaumer wants to keep the commented code as it represents an alternative (inverse) representation of the used equations.
Example: Change
Real RotationMatrix[2, 2]={{+cos(-angle),-sin(-angle)},{+sin(-angle),+
cos(-angle)}};
//Real InverseRotator[2,2] = {{+cos(+angle),-sin(+angle)},{+sin(+angle),+cos(+angle)}};
...
//u = InverseRotator*y;
to
Real RotationMatrix[2, 2]={{+cos(-angle),-sin(-angle)},{+sin(-angle),+
cos(-angle)}};
// Alternative equivalent implementation:
// Real InverseRotator[2,2] = {{+cos(+angle),-sin(+angle)},{+sin(+angle),+cos(+angle)}};
...
// Alternative equivalent implementation:
// u = InverseRotator*y;
Is OK from my side, I thought it was some left over code, but if this is documentation, of course we should keep it. @AHaumer just let us know how you want it.
I'd prefer to keep the comments as internal documentation - thanks.
I'd prefer to keep the comments as internal documentation - thanks.
@AHaumer OK, but shall we add
// Alternative equivalent implementation:
as proposed above to make the documentation character more clear to the users?
@AHaumer OK, but shall we add
// Alternative equivalent implementation:as proposed above to make the documentation character more clear to the users?
Fine with me.
@AHaumer @christiankral, we have made the Alternative equivalent implementation comment in relevant places. Could you please review?