A community-maintained Python framework for creating mathematical animations.
LGTM Error Fix (#2001)
GameDungeon9a98d67dd459
diff --git a/lgtm.yml b/lgtm.ymlnew file mode 100644index 000000000..e14c831a5--- /dev/null+++ b/lgtm.yml@@ -0,0 +1,6 @@+queries:+ - exclude: py/init-calls-subclass+ - exclude: py/unexpected-raise-in-special-method+ - exclude: py/modification-of-locals+ - exclude: py/multiple-calls-to-init+ - exclude: py/missing-call-to-initdiff --git a/manim/_config/utils.py b/manim/_config/utils.pyindex bd5af10b0..3dd79ca47 100644--- a/manim/_config/utils.py+++ b/manim/_config/utils.py@@ -1102,8 +1102,7 @@ class ManimConfig(MutableMapping):for qual in constants.QUALITIES:if all([q[k] == constants.QUALITIES[qual][k] for k in keys]):return qual- else:- return None+ return None@quality.setterdef quality(self, qual: str) -> None:diff --git a/manim/camera/camera.py b/manim/camera/camera.pyindex 41df1e2b7..ceedde780 100644--- a/manim/camera/camera.py+++ b/manim/camera/camera.py@@ -187,8 +187,7 @@ class Camera:for _type in self.display_funcs:if isinstance(mobject, _type):return _type- else:- raise TypeError(f"Displaying an object of class {_type} is not supported")+ raise TypeError(f"Displaying an object of class {_type} is not supported")def reset_pixel_shape(self, new_height, new_width):"""This method resets the height and widthdiff --git a/manim/camera/mapping_camera.py b/manim/camera/mapping_camera.pyindex 690639d98..ee23dce3e 100644--- a/manim/camera/mapping_camera.py+++ b/manim/camera/mapping_camera.py@@ -33,7 +33,8 @@ class MappingCamera(Camera):def points_to_pixel_coords(self, points):return super().points_to_pixel_coords(np.apply_along_axis(self.mapping_func, 1, points),- )+ ) # TODO: There is an error here, but I don't know how to fix it:+ # FIXME: Call to method Camera.points_to_pixel_coords with too few arguments; should be no fewer than 3.def capture_mobjects(self, mobjects, **kwargs):mobjects = self.get_mobjects_to_display(mobjects, **kwargs)diff --git a/manim/cli/cfg/group.py b/manim/cli/cfg/group.pyindex 8e6ceb14b..c872da941 100644--- a/manim/cli/cfg/group.py+++ b/manim/cli/cfg/group.py@@ -200,8 +200,8 @@ modify write_cfg_subcmd_input to account for it.""",end="",)temp = input()- else:- default[key] = temp++ default[key] = tempdefault = replace_keys(default) if category == "logger" else defaultdiff --git a/manim/mobject/changing.py b/manim/mobject/changing.pyindex 4aad0bebc..fa0d3c1de 100644--- a/manim/mobject/changing.py+++ b/manim/mobject/changing.py@@ -4,7 +4,6 @@ __all__ = ["AnimatedBoundary", "TracedPath"]from typing import Callable, Optional-import numpy as npfrom colour import Colorfrom .._config import configdiff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.pyindex c949793eb..f76655362 100644--- a/manim/mobject/mobject.py+++ b/manim/mobject/mobject.py@@ -46,12 +46,7 @@ from ..utils.exceptions import MultiAnimationOverrideExceptionfrom ..utils.iterables import list_update, remove_list_redundanciesfrom ..utils.paths import straight_pathfrom ..utils.simple_functions import get_parameters-from ..utils.space_ops import (- angle_between_vectors,- normalize,- rotation_matrix,- rotation_matrix_transpose,-)+from ..utils.space_ops import angle_between_vectors, normalize, rotation_matrixfrom .opengl_compatibility import ConvertToOpenGL# TODO: Explain array_attrsdiff --git a/manim/mobject/opengl_three_dimensions.py b/manim/mobject/opengl_three_dimensions.pyindex 9c7f7a67c..dd72878e1 100644--- a/manim/mobject/opengl_three_dimensions.py+++ b/manim/mobject/opengl_three_dimensions.py@@ -1,5 +1,3 @@-import math-import numpy as npfrom ..constants import *diff --git a/manim/mobject/svg/opengl_tex_mobject.py b/manim/mobject/svg/opengl_tex_mobject.pyindex f1154d411..a8e8170ee 100644--- a/manim/mobject/svg/opengl_tex_mobject.py+++ b/manim/mobject/svg/opengl_tex_mobject.py@@ -180,7 +180,6 @@ from ...mobject.types.opengl_vectorized_mobject import (OpenGLVGroup,)from ...utils.color import BLACK-from ...utils.deprecation import deprecatedfrom ...utils.strings import split_string_list_to_isolate_substringsfrom ...utils.tex_file_writing import tex_to_svg_filefrom .style_utils import parse_stylediff --git a/manim/mobject/svg/tex_mobject.py b/manim/mobject/svg/tex_mobject.pyindex 3bce3c030..3fb2fb4e4 100644--- a/manim/mobject/svg/tex_mobject.py+++ b/manim/mobject/svg/tex_mobject.py@@ -36,7 +36,6 @@ from ...mobject.svg.svg_path import SVGPathMobjectfrom ...mobject.types.vectorized_mobject import VectorizedPoint, VGroupfrom ...utils.color import BLACK, WHITEfrom ...utils.deprecation import deprecated_params-from ...utils.tex import TexTemplatefrom ...utils.tex_file_writing import tex_to_svg_filefrom .style_utils import parse_stylediff --git a/manim/plugins/import_plugins.py b/manim/plugins/import_plugins.pyindex 180b7bb95..0f5d2c565 100644--- a/manim/plugins/import_plugins.py+++ b/manim/plugins/import_plugins.py@@ -37,6 +37,6 @@ for plugin in pkg_resources.iter_entry_points("manim.plugins"):exec(f"{lst.__name__}=lst")__all__.append(lst.__name__)plugins_requested.remove(plugin.name)-else:- if plugins_requested != []:- logger.warning("Missing Plugins: %s", plugins_requested)++if plugins_requested != []:+ logger.warning("Missing Plugins: %s", plugins_requested)diff --git a/scripts/dev_changelog.py b/scripts/dev_changelog.pyindex 806fb5407..3b515a5d6 100755--- a/scripts/dev_changelog.py+++ b/scripts/dev_changelog.py@@ -48,7 +48,6 @@ import osimport refrom collections import defaultdictfrom pathlib import Path-from posixpath import dirnamefrom textwrap import dedent, indentimport click