A community-maintained Python framework for creating mathematical animations.
[pre-commit.ci] pre-commit autoupdate (#4181)
pre-commit-ci[bot]44da20d71dc0
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex dce220beb..fdc48e837 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -13,7 +13,7 @@ repos:- id: check-tomlname: Validate pyproject.toml- repo: https://github.com/astral-sh/ruff-pre-commit- rev: v0.9.7+ rev: v0.11.0hooks:- id: ruffname: ruff lintdiff --git a/manim/mobject/graph.py b/manim/mobject/graph.pyindex 25a3ce4b1..3e9b91ede 100644--- a/manim/mobject/graph.py+++ b/manim/mobject/graph.py@@ -335,7 +335,7 @@ def _tree_layout(# Always make a copy of the children because they get eatenstack = [list(children[root_vertex]).copy()]stick = [root_vertex]- parent = {u: root_vertex for u in children[root_vertex]}+ parent = dict.fromkeys(children[root_vertex], root_vertex)pos = {}obstruction = [0.0] * len(T)o = -1 if orientation == "down" else 1@@ -810,12 +810,12 @@ class GenericGraph(VMobject, metaclass=ConvertToOpenGL):vertex_mobjects = {}graph_center = self.get_center()- base_positions = {v: graph_center for v in vertices}+ base_positions = dict.fromkeys(vertices, graph_center)base_positions.update(positions)positions = base_positionsif isinstance(labels, bool):- labels = {v: labels for v in vertices}+ labels = dict.fromkeys(vertices, labels)else:assert isinstance(labels, dict)base_labels = dict.fromkeys(vertices, False)