Skip to content

Commit

Permalink
LGTM Error Fix (#2001)
Browse files Browse the repository at this point in the history
* LGTM Error Crush

* I'm dumb

* fix

* Update manim/plugins/import_plugins.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Darylgolden <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2021
1 parent 0976f23 commit 9a98d67
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 22 deletions.
6 changes: 6 additions & 0 deletions lgtm.yml
Original file line number Diff line number Diff line change
@@ -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-init
3 changes: 1 addition & 2 deletions manim/_config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,7 @@ def quality(self):
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.setter
def quality(self, qual: str) -> None:
Expand Down
3 changes: 1 addition & 2 deletions manim/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ def type_or_raise(self, mobject):
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 width
Expand Down
3 changes: 2 additions & 1 deletion manim/camera/mapping_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(
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)
Expand Down
4 changes: 2 additions & 2 deletions manim/cli/cfg/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def write(level: str = None, openfile: bool = False) -> None:
end="",
)
temp = input()
else:
default[key] = temp

default[key] = temp

default = replace_keys(default) if category == "logger" else default

Expand Down
1 change: 0 additions & 1 deletion manim/mobject/changing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from typing import Callable, Optional

import numpy as np
from colour import Color

from .._config import config
Expand Down
7 changes: 1 addition & 6 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@
from ..utils.iterables import list_update, remove_list_redundancies
from ..utils.paths import straight_path
from ..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_matrix
from .opengl_compatibility import ConvertToOpenGL

# TODO: Explain array_attrs
Expand Down
2 changes: 0 additions & 2 deletions manim/mobject/opengl_three_dimensions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import math

import numpy as np

from ..constants import *
Expand Down
1 change: 0 additions & 1 deletion manim/mobject/svg/opengl_tex_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def construct(self):
OpenGLVGroup,
)
from ...utils.color import BLACK
from ...utils.deprecation import deprecated
from ...utils.strings import split_string_list_to_isolate_substrings
from ...utils.tex_file_writing import tex_to_svg_file
from .style_utils import parse_style
Expand Down
1 change: 0 additions & 1 deletion manim/mobject/svg/tex_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from ...mobject.types.vectorized_mobject import VectorizedPoint, VGroup
from ...utils.color import BLACK, WHITE
from ...utils.deprecation import deprecated_params
from ...utils.tex import TexTemplate
from ...utils.tex_file_writing import tex_to_svg_file
from .style_utils import parse_style

Expand Down
6 changes: 3 additions & 3 deletions manim/plugins/import_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
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)
1 change: 0 additions & 1 deletion scripts/dev_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import re
from collections import defaultdict
from pathlib import Path
from posixpath import dirname
from textwrap import dedent, indent

import click
Expand Down

0 comments on commit 9a98d67

Please sign in to comment.