Skip to content

get rid of CONFIG dicts #763

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

Closed
wants to merge 45 commits into from
Closed

Conversation

leotrs
Copy link
Contributor

@leotrs leotrs commented Nov 23, 2020

Motivation

CONFIG dicts in manim classes are hard to debug, cannot be documented, and are an all around Bad Thing.

Explanation for Changes

Basically, every key in a CONFIG dict has been converted to a __init__ argument.

Testing Status

Local pass.

Further Comments

This is WIP. @cobordism and I are going to keep working on this.

This is a second try of #648. In that PR, I tried removing some keys from Mobject and its derivatives, and left some others intact. This proved to be the wrong approach. I know understand that CONFIG should be removed from a class as well as from all its ancestors at the same time.

In #648, I made the mistake of removing some positional arguments and turning them into keyword-only arguments. I've tried my best to be more careful here.

I believe that this does not actually introduce breaking changes. But even if it does, we have to discuss what kind of breaking changes we are comfortable with introducing, because CONFIG dicts must go sooner rather than later.

@leotrs leotrs mentioned this pull request Nov 23, 2020
6 tasks
@leotrs leotrs marked this pull request as draft November 23, 2020 12:35
@leotrs leotrs marked this pull request as ready for review November 28, 2020 00:10
@leotrs leotrs changed the title [WIP] Remove config from Animation and its derivatives get rid of CONFIG dicts Nov 28, 2020
@cobordism
Copy link
Member

Status update:

All CONFIGs and all digest_config have been removed.
All variables previously in the CONFIG dict are now keyword arguments to __init__ and are then set as object attributes.
This makes for some very large __init__ signatures and there is plenty of scope to clean this up, but the point is, this cleanup is now possible. You no longer run the risk of breaking something far away by refactoring the internals of one class.

All tests pass, all docs build - some have been rewritten themselves, specifically we removed all CONFIGs from the docstrings too.

An error message was added to Container.__init__ and Animation.__init__ if a CONFIG is present warning people to use keyword arguments instead.

@kolibril13
Copy link
Member

Can this pr be closed in favour of #783?

@leotrs
Copy link
Contributor Author

leotrs commented Nov 29, 2020

I believe so. @cobordism I think we can close this, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants