Rename method named "replace" in Mobject and OpenGLMobject#4657
Open
GoThrones wants to merge 2 commits intoManimCommunity:mainfrom
Open
Rename method named "replace" in Mobject and OpenGLMobject#4657GoThrones wants to merge 2 commits intoManimCommunity:mainfrom
GoThrones wants to merge 2 commits intoManimCommunity:mainfrom
Conversation
Member
|
This is a deprecation and name change that I do support, Thanks for your contribution(s)! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview: What does this pull request change?
This PR renames the method named "replace" in mobject.py and opengl_mobject.py, and adds a wrapper with a warning that this method will be deprecated in future.
Motivation and Explanation: Why and how do your changes improve the library?
There are 3 methods named replace in manimce source code.
The one in Scene class does what a method named "replace" is expected to do: it replaces the target mobject with the one calling this method.
The 2nd works with strings.
The third one is in mobject.py and in opengl_mobject.py and it works on mobjects only. The method has been renamed to "match_size_and_position_to" because that's what it does. It matches the size and position of the mobject calling it, to the target mobject. The erstwhile name "replace" in mobject.py and opengl_mobject.py is misleading.
Other places in manimce source code, where this replace method of mobject.py and opengl_mobject.py is called, has been kept as it was, for the time being.
Reviewer Checklist