manim
manim copied to clipboard
Typing vector space scene
Overview: What does this pull request change?
This PR adds type annotations to vector_space_scene.py.
Motivation and Explanation: Why and how do your changes improve the library?
More work towards https://github.com/ManimCommunity/manim/issues/3375
Links to added or changed documentation pages
Further Information and Comments
During work on the PR, a few inconsistencies between the existing implementation and the type annotations were found. To find proper solutions to these, the following questions will have to be answered.
- What should the default value of "row_sep" be? (
manim/_config/cli_colors.py)
def parse_cli_ctx(parser: configparser.SectionProxy) -> dict[str, Any]:
formatter_settings: dict[str, str | int] = {
"indent_increment": int(parser["indent_increment"]),
"width": int(parser["width"]),
"col1_max_width": int(parser["col1_max_width"]),
"col2_min_width": int(parser["col2_min_width"]),
"col_spacing": int(parser["col_spacing"]),
# TODO
# What should the default value of "row_sep" be?
# I cannot be None according to the typing in line 12.
"row_sep": parser["row_sep"] if parser["row_sep"] else None,
}
- Is there a better solution than adding three additional properties to the MathTex class (in
manim/mobject/text/tex_mobject.py), as some methods inmanim/scene/vector_space_scene.pydepend on these (see comment on line 945).
Reviewer Checklist
- [ ] The PR title is descriptive enough for the changelog, and the PR is labeled correctly
- [ ] If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
- [ ] If applicable: newly added functions and classes are tested