-
Notifications
You must be signed in to change notification settings - Fork 2.5k
WIP: Refactor config and related stuff #3473
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
Draft
Viicos
wants to merge
12
commits into
ManimCommunity:main
Choose a base branch
from
Viicos:3466-refactor-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Collaborator
|
Looking forward to this change! |
9ae9936 to
8e26d05
Compare
Merged
4 tasks
764a864 to
2305816
Compare
for more information, see https://pre-commit.ci
Fix several issues discovered from pyright
for more information, see https://pre-commit.ci
Member
|
Heyo, are there any updates as to how the progress here is going? I'm interested in helping out here :) |
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.
Fixes #3466.
What technically changed:
pydanticto create a newManimConfigclass, providing built-in type hints, validation. This eliminates the need to define properties for each parameter.default.cfgfile where defaults were stored. Instead, default values are set on theManimConfigclass directly (making it easier to keep in sync).ManimColorwas the only exception, so a custom annotation was created (see docs for more details; TLDR theManimColorclass in untouched and not tied to Pydantic in any way, the custom annotation simply provides info about how to validate/parse input, and how JSON schema should be generated).What functionally changed:
ConfigProviderclass was added, exposing aget_configmethod. Each subclass ofConfigProvideris responsible for parsing a specific config format (for now, onlyCfgProvideris implemented and provides an instance ofManimConfigparsed from.cfgfiles).cfg,TOMLis well-specified and easier to parse because of the built-in types it supports. Thanks to the use of Pydantic, a JSON schema can be generated and used in IDEs to provide autocomplete when writing configuration files.ManimConfigclass has slightly changed. Mainly:ffmeg_loglevelffmpeg.loglevelffmpeg_executableffmpeg.executableverbositylogging.verbositymedia_embedjupyter.media_embedmedia_widthjupyter.media_widthproperties with deprecation warnings where added to avoid any breaking changes.
CLI_CTXsection is now made available in the config, through thecli_formattingattribute.cloupcontext settings are made accessible through thecli_formatting.context_settingsproperty.TODO
tex_template/tex_template_filecustom_folders. Needs investigation, confusing? Still required?input_file/output_file(only set through the CLI)get_dirManimFramedigest_args)tex_template/tex_template_file: Might need some refactor to the related tex classes.ManimColorCLI switchtoCLI flagin docstrings?Reviewer Checklist