Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #3332

Merged
merged 12 commits into from
Apr 24, 2024
1 change: 0 additions & 1 deletion .codespell_ignorelines

This file was deleted.

5 changes: 5 additions & 0 deletions .codespell_ignorewords
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nam
sherif
falsy
medias
strager
6 changes: 3 additions & 3 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
exclude-file=.codespell_ignorelines
check-hidden=True
ignore-words-list = nam,sherif,falsy
check-hidden = True
skip = .git,*.js,*.js.map,*.css,*.css.map,*.html,*.po,*.pot,poetry.lock,*.log,*.svg
ignore-words = .codespell_ignorewords
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ extend-ignore = E203, W503, D202, D212, D213, D404
# Misc
F401, F403, F405, F841, E501, E731, E402, F811, F821,

# multiple statements on one line (overload)
E704,

# Plug-in: flake8-builtins
A001, A002, A003,

Expand Down
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fail_fast: false
exclude: ^(manim/grpc/gen/|docs/i18n/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-ast
name: Validate Python
Expand All @@ -13,7 +13,7 @@ repos:
- id: check-toml
name: Validate Poetry
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand All @@ -24,7 +24,7 @@ repos:
name: isort (pyi)
types: [pyi]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.15.2
hooks:
- id: pyupgrade
name: Update code to new python versions
Expand All @@ -35,16 +35,17 @@ repos:
- id: python-check-blanket-noqa
name: Precision flake ignores
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
additional_dependencies: [black==24.4.0]
exclude: ^\.github/
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -58,7 +59,7 @@ repos:
flake8-simplify==0.14.1,
]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -72,7 +73,7 @@ repos:
files: ^manim/

- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
files: ^.*\.(py|md|rst)$
Expand Down
3 changes: 1 addition & 2 deletions docs/source/contributing/docs/docstrings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ Example:
The mobject linked to this instance.
"""

def __init__(name: str, id: int, singleton: MyClass, mobj: Mobject = None):
...
def __init__(name: str, id: int, singleton: MyClass, mobj: Mobject = None): ...

2. The usage of ``Parameters`` on functions to specify how
every parameter works and what it does. This should be excluded if
Expand Down
3 changes: 1 addition & 2 deletions docs/source/contributing/docs/typings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ Typing guidelines
T = TypeVar("T")


def copy(self: T) -> T:
...
def copy(self: T) -> T: ...

* Use ``typing.Iterable`` whenever the function works with *any* iterable, not a specific type.

Expand Down
1 change: 1 addition & 0 deletions docs/source/guides/add_voiceovers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and then record it during rendering:
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.recorder import RecorderService


# Simply inherit from VoiceoverScene instead of Scene to get all the
# voiceover functionality.
class RecorderExample(VoiceoverScene):
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Now let's look at the next two lines:

class CreateCircle(Scene):
def construct(self):
...
[...]

Most of the time, the code for scripting an animation is entirely contained within
the :meth:`~.Scene.construct` method of a :class:`.Scene` class.
Expand Down
2 changes: 1 addition & 1 deletion example_scenes/opengl.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def construct(self):
self.play(Create(square))
self.wait()

# This opens an iPython termnial where you can keep writing
# This opens an iPython terminal where you can keep writing
# lines as if they were part of this construct method.
# In particular, 'square', 'circle' and 'self' will all be
# part of the local namespace in that terminal.
Expand Down
1 change: 1 addition & 0 deletions manim/_config/logger_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
format.

"""

from __future__ import annotations

import configparser
Expand Down
6 changes: 3 additions & 3 deletions manim/_config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
See :doc:`/guides/configuration` for an introduction to Manim's configuration system.

"""

from __future__ import annotations

import argparse
Expand Down Expand Up @@ -245,8 +246,7 @@ class ManimConfig(MutableMapping):
config.background_color = RED


class MyScene(Scene):
...
class MyScene(Scene): ...

the background color will be set to RED, regardless of the contents of
``manim.cfg`` or the CLI arguments used when invoking manim.
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def from_animation_number(self, value: int) -> None:

@property
def upto_animation_number(self) -> int:
"""Stop rendering animations at this nmber. Use -1 to avoid skipping (-n)."""
"""Stop rendering animations at this number. Use -1 to avoid skipping (-n)."""
return self._d["upto_animation_number"]

@upto_animation_number.setter
Expand Down
1 change: 0 additions & 1 deletion manim/animation/animation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Animate mobjects."""


from __future__ import annotations

from manim.mobject.opengl.opengl_mobject import OpenGLMobject
Expand Down
1 change: 0 additions & 1 deletion manim/animation/composition.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tools for displaying multiple animations at once."""


from __future__ import annotations

import types
Expand Down
1 change: 0 additions & 1 deletion manim/animation/fading.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def construct(self):

"""


from __future__ import annotations

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class Circumscribe(Succession):
mobject
The mobject to be circumscribed.
shape
The shape with which to surrond the given mobject. Should be either
The shape with which to surround the given mobject. Should be either
:class:`~.Rectangle` or :class:`~.Circle`
fade_in
Whether to make the surrounding shape to fade in. It will be drawn otherwise.
Expand Down
1 change: 0 additions & 1 deletion manim/camera/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""A camera converts the mobjects contained in a Scene into an array of pixels."""


from __future__ import annotations

__all__ = ["Camera", "BackgroundColoredVMobjectDisplayer"]
Expand Down
1 change: 1 addition & 0 deletions manim/cli/cfg/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
group.

"""

from __future__ import annotations

from ast import literal_eval
Expand Down
1 change: 1 addition & 0 deletions manim/cli/default_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
This library isn't used as a dependency as we need to inherit from ``cloup.Group`` instead
of ``click.Group``.
"""

import warnings

import cloup
Expand Down
1 change: 1 addition & 0 deletions manim/cli/init/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
group.

"""

from __future__ import annotations

import configparser
Expand Down
1 change: 1 addition & 0 deletions manim/cli/plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
group.

"""

from __future__ import annotations

import cloup
Expand Down
1 change: 1 addition & 0 deletions manim/cli/render/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
can specify options, and arguments for the render command.

"""

from __future__ import annotations

import http.client
Expand Down
21 changes: 9 additions & 12 deletions manim/mobject/graphing/coordinate_systems.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Mobjects that represent coordinate systems."""


from __future__ import annotations

__all__ = [
Expand Down Expand Up @@ -441,8 +440,7 @@ def get_line_from_axis_to_point(
line_config: dict | None = ...,
color: ParsableManimColor | None = ...,
stroke_width: float = ...,
) -> DashedLine:
...
) -> DashedLine: ...
Dismissed Show dismissed Hide dismissed

@overload
def get_line_from_axis_to_point(
Expand All @@ -453,8 +451,7 @@ def get_line_from_axis_to_point(
line_config: dict | None = ...,
color: ParsableManimColor | None = ...,
stroke_width: float = ...,
) -> LineType:
...
) -> LineType: ...
Dismissed Show dismissed Hide dismissed

def get_line_from_axis_to_point( # type: ignore[no-untyped-def]
self,
Expand Down Expand Up @@ -855,9 +852,11 @@ def plot_surface(
function: Callable[[float], float],
u_range: Sequence[float] | None = None,
v_range: Sequence[float] | None = None,
colorscale: Sequence[ParsableManimColor]
| Sequence[tuple[ParsableManimColor, float]]
| None = None,
colorscale: (
Sequence[ParsableManimColor]
| Sequence[tuple[ParsableManimColor, float]]
| None
) = None,
colorscale_axis: int = 2,
**kwargs: Any,
) -> Surface | OpenGLSurface:
Expand Down Expand Up @@ -2653,14 +2652,12 @@ def construct(self):

def __init__(
self,
x_range: Sequence[float]
| None = (
x_range: Sequence[float] | None = (
-config["frame_x_radius"],
config["frame_x_radius"],
1,
),
y_range: Sequence[float]
| None = (
y_range: Sequence[float] | None = (
-config["frame_y_radius"],
config["frame_y_radius"],
1,
Expand Down
2 changes: 1 addition & 1 deletion manim/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def construct(self):
Examples
--------
A typical manim script includes a class derived from :class:`Scene` with an
overridden :meth:`Scene.contruct` method:
overridden :meth:`Scene.construct` method:

.. code-block:: python

Expand Down
11 changes: 5 additions & 6 deletions manim/scene/three_d_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,15 @@ def move_camera(
frame_center = frame_center.get_center()
frame_center = list(frame_center)

zoom_value = None
if zoom is not None:
zoom_value = config.frame_height / (zoom * cam.height)

for value, method in [
[theta, "theta"],
[phi, "phi"],
[gamma, "gamma"],
[
config.frame_height / (zoom * cam.height)
if zoom is not None
else None,
"zoom",
],
[zoom_value, "zoom"],
[frame_center, "frame_center"],
]:
if value is not None:
Expand Down
Loading
Loading