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

Remove unused code (#3622) #3623

Merged
merged 7 commits into from
Jan 18, 2024
Merged

Conversation

adrpo
Copy link
Collaborator

@adrpo adrpo commented Aug 29, 2020

There are some components defined that are not used in the blocks or functions.
This PR removes them.

@adrpo adrpo requested a review from AHaumer August 29, 2020 23:44
@HansOlsson
Copy link
Contributor

Removing protected parameters (even if unused) seems problematic with current versioning rules.

@beutlich
Copy link
Member

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.

@beutlich beutlich linked an issue Aug 31, 2020 that may be closed by this pull request
Copy link
Contributor

@christiankral christiankral left a comment

Choose a reason for hiding this comment

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

Remove obsolete code is OK

@christiankral christiankral self-requested a review August 31, 2020 07:27
@christiankral
Copy link
Contributor

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.

@christiankral
Copy link
Contributor

See adrpo#1

Copy link
Contributor

@AHaumer AHaumer left a comment

Choose a reason for hiding this comment

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

I'm against removing the unused code.
It is written as comment and makes the code easier to understand.
So I'm against this PR.

@christiankral
Copy link
Contributor

@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;

@adrpo
Copy link
Collaborator Author

adrpo commented May 17, 2021

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.

@AHaumer
Copy link
Contributor

AHaumer commented May 24, 2021

I'd prefer to keep the comments as internal documentation - thanks.

@christiankral
Copy link
Contributor

christiankral commented Jun 26, 2021

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
Copy link
Contributor

AHaumer commented Dec 13, 2021

@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.

Add alternative implementation comment and revert comment removal for those implementation
Add alternative implementation comment and revert comment removal for those implementation
Add alternative implementation comment and revert comment removal for those implementation
Add alternative implementation comment and revert comment removal for those implementation
@beutlich beutlich changed the title remove unused code (#3622) Remove unused code (#3622) Jan 18, 2024
Add alternative implementation comment and revert comment removal for those implementation
@arunkumar-narasimhan
Copy link
Contributor

@AHaumer @christiankral, we have made the Alternative equivalent implementation comment in relevant places. Could you please review?

Copy link
Contributor

@AHaumer AHaumer left a comment

Choose a reason for hiding this comment

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

ok for me

Copy link
Contributor

@christiankral christiankral left a comment

Choose a reason for hiding this comment

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

OK with me.

@Harisankar-Allimangalath Harisankar-Allimangalath merged commit 5fe4ebd into modelica:master Jan 18, 2024
2 checks passed
@beutlich beutlich added the L: Electrical.Machines Issue addresses Modelica.Electrical.Machines label Jan 18, 2024
@beutlich beutlich added this to the MSL4.1.0 milestone Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Electrical.Machines Issue addresses Modelica.Electrical.Machines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused parameter in function
7 participants