Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 28, 2023
1 parent 3616c50 commit 672b0e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
15 changes: 4 additions & 11 deletions manim/mobject/geometry/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,12 @@ def construct(self):
)

if TYPE_CHECKING:
import manim.mobject.geometry.tips as tips

Check notice

Code scanning / CodeQL

Module is imported with 'import' and 'import from' Note

Module 'manim.mobject.geometry.tips' is imported with both 'import' and 'import from'.
from manim.mobject.mobject import Mobject
from manim.mobject.text.tex_mobject import SingleStringMathTex, Tex
from manim.mobject.text.text_mobject import Text
from manim.typing import CubicBezierPoints, Point3D, QuadraticBezierPoints, Vector

import manim.mobject.geometry.tips as tips


Angle: TypeAlias = Union[float, np.float64]

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'Angle' is not used.

Expand Down Expand Up @@ -170,9 +169,7 @@ def get_unpositioned_tip(
tip = tip_shape(length=tip_length, **style)
return tip

def position_tip(
self, tip: tips.ArrowTip, at_start: bool = False
):
def position_tip(self, tip: tips.ArrowTip, at_start: bool = False):
# Last two control points, defining both
# the end, and the tangency direction
if at_start:
Expand All @@ -199,9 +196,7 @@ def position_tip(
tip.shift(anchor - tip.tip_point)
return tip

def reset_endpoints_based_on_tip(
self, tip: tips.ArrowTip, at_start: bool
) -> Self:
def reset_endpoints_based_on_tip(self, tip: tips.ArrowTip, at_start: bool) -> Self:
if self.get_length() == 0:
# Zero length, put_start_and_end_on wouldn't work
return self
Expand All @@ -212,9 +207,7 @@ def reset_endpoints_based_on_tip(
self.put_start_and_end_on(self.get_start(), tip.base)
return self

def asign_tip_attr(
self, tip: tips.ArrowTip, at_start: bool
) -> Self:
def asign_tip_attr(self, tip: tips.ArrowTip, at_start: bool) -> Self:
if at_start:
self.start_tip = tip
else:
Expand Down
1 change: 1 addition & 0 deletions manim/mobject/geometry/boolean_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class _BooleanOps(VMobject, metaclass=ConvertToOpenGL):
helps to convert to and from skia objects and manim
objects (:class:`~.VMobject`).
"""

def _convert_2d_to_3d_array(
self,
points: Point2D_Array,
Expand Down
8 changes: 4 additions & 4 deletions manim/utils/bezier.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,14 @@ def inverse_interpolate(start: float, end: float, value: float) -> float:
def inverse_interpolate(start: float, end: float, value: Point3D) -> Point3D:
...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


@overload
def inverse_interpolate(start: Point3D, end: Point3D, value: Point3D) -> Point3D:
...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


def inverse_interpolate(
start: float | Point3D,
end: float | Point3D,
value: float | Point3D
start: float | Point3D, end: float | Point3D, value: float | Point3D
) -> float | Point3D:
"""Perform inverse interpolation to determine the alpha
values that would produce the specified ``value``
Expand All @@ -372,7 +372,7 @@ def inverse_interpolate(
value
The value or point for which the alpha value
should be determined.
Returns
-------
The alpha values producing the given input
Expand Down
11 changes: 5 additions & 6 deletions manim/utils/space_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,8 @@ def shoelace_direction(x_y: np.ndarray) -> str:


def cross2d(
a: Sequence[Vector] | Vector,
b: Sequence[Vector] | Vector
) -> Sequence[float] | float:
a: Sequence[Vector] | Vector, b: Sequence[Vector] | Vector
) -> Sequence[float] | float:
"""Compute the determinant(s) of the passed
vector (sequences).
Expand All @@ -635,7 +634,7 @@ def cross2d(
A vector or a sequence of vectors.
b
A vector or a sequence of vectors.
Returns
-------
Sequence[float] | float
Expand All @@ -650,8 +649,8 @@ def cross2d(
>>> cross2d(np.array([1, 2]), np.array([3, 4]))
-2
>>> cross2d(
... np.array([[1, 2, 0], [1, 0, 0]]),
... np.array([[3, 4, 0], [0, 1, 0]]),
... np.array([[1, 2, 0], [1, 0, 0]]),
... np.array([[3, 4, 0], [0, 1, 0]]),
... )
array([-2, 1])
"""
Expand Down

0 comments on commit 672b0e3

Please sign in to comment.