-
Notifications
You must be signed in to change notification settings - Fork 2.2k
CONFIG cleanup #648
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
CONFIG cleanup #648
Conversation
This has brought up an unexpected issue. We will need to determine which constructor arguments are positional vs which ones are keyword arguments. For example, in the past we could do this Arrow(vec1, vec2) But in the current pass of this PR we need to do this Arrow(start=vec1, end=vec2) I personally think this is fine as it's more explicit, but others might think differently. The reason for this change is that it's easier to pass constructor keyword arguments up to the parent class. Whenever a child class sets the default value of a positional argument (thereby turning it into a keyword argument), things get messy. |
I think this is a major change that will break tons and tons of user code. If there is some possibility; any at all to preserve the current behavior, I'd really like to see that. |
... okay, now I've looked at the code as well. I am not sure about the best course of action. Objects in geometry might actually profit from adding *args that are passed to the call of |
I agree. I'm not sure I like the current state of this PR.
…On Sat, Oct 31, 2020, 5:51 AM Benjamin Hackl ***@***.***> wrote:
... okay, now I've looked at the code as well.
I am not sure about the best course of action. Objects in geometry might
actually profit from adding *args that are passed to the call of __init__
of the inherited class; especially in cases like Line and Arrow.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#648 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILYAAJH4UO5HCPXDDQ6IDSNPMY3ANCNFSM4TFUFIUQ>
.
|
Closing this as @cobordism and I are going to take another try at it. |
Motivation
CONFIG dicts in manim classes are hard to debug, cannot be documented, and are an all around Bad Thing.
List of Changes
Now that the actual global config system is more robust, I finally feel comfortable removing some of the CONFIG stuff. I decided to start in geometry.py since these classes are well tested. I added a bunch of new tests as well.
Testing Status
Local pass
Further Comments
I haven't removed all of the CONFIGs found in geometry.py. The problem is that some of them contain style options such as stroke_width, color, fill_color, fill_opactiy, etc. These in and of themselves are buggy and hard to maintain, and they would require a coordinated effort that goes all the way up to fundamentally modifying Mobject and VMobject. So I'm holding off on those for the time being.