A community-maintained Python framework for creating mathematical animations.
[pre-commit.ci] pre-commit autoupdate (#3308)
pre-commit-ci[bot]88836df8ab1e
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 8f4cdd49f..225996766 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -24,7 +24,7 @@ repos:name: isort (pyi)types: [pyi]- repo: https://github.com/asottile/pyupgrade- rev: v3.9.0+ rev: v3.10.1hooks:- id: pyupgradename: Update code to new python versions@@ -44,7 +44,7 @@ repos:- id: blacken-docsadditional_dependencies: [black==22.3.0]- repo: https://github.com/PyCQA/flake8- rev: 6.0.0+ rev: 6.1.0hooks:- id: flake8additional_dependencies:diff --git a/manim/mobject/opengl/opengl_image_mobject.py b/manim/mobject/opengl/opengl_image_mobject.pyindex 96d69e4a1..7f2828712 100644--- a/manim/mobject/opengl/opengl_image_mobject.py+++ b/manim/mobject/opengl/opengl_image_mobject.py@@ -29,7 +29,7 @@ class OpenGLImageMobject(OpenGLTexturedSurface):):self.image = filename_or_arrayself.resampling_algorithm = resampling_algorithm- if type(filename_or_array) == np.ndarray:+ if isinstance(filename_or_array, np.ndarray):self.size = self.image.shape[1::-1]elif isinstance(filename_or_array, (str, Path)):path = get_full_raster_image_path(filename_or_array)diff --git a/manim/mobject/opengl/opengl_surface.py b/manim/mobject/opengl/opengl_surface.pyindex 6a1672b59..adb4fe2d6 100644--- a/manim/mobject/opengl/opengl_surface.py+++ b/manim/mobject/opengl/opengl_surface.py@@ -380,7 +380,7 @@ class OpenGLTexturedSurface(OpenGLSurface):if not isinstance(uv_surface, OpenGLSurface):raise Exception("uv_surface must be of type OpenGLSurface")- if type(image_file) == np.ndarray:+ if isinstance(image_file, np.ndarray):image_file = change_to_rgba_array(image_file)# Set texture informationdiff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.pyindex 8793275b6..18d0a54aa 100644--- a/manim/mobject/svg/svg_mobject.py+++ b/manim/mobject/svg/svg_mobject.py@@ -280,7 +280,7 @@ class SVGMobject(VMobject, metaclass=ConvertToOpenGL):mob = self.polyline_to_mobject(shape)elif isinstance(shape, se.Text):mob = self.text_to_mobject(shape)- elif isinstance(shape, se.Use) or type(shape) == se.SVGElement:+ elif isinstance(shape, se.Use) or type(shape) is se.SVGElement:continueelse:logger.warning(f"Unsupported element type: {type(shape)}")