A community-maintained Python framework for creating mathematical animations.
Flake8 Changes + Fixing Warnings (#1968)
GameDungeon94821c10d847
diff --git a/.codespellrc b/.codespellrcindex 67ff7d050..f12f26b4c 100644--- a/.codespellrc+++ b/.codespellrc@@ -1,4 +1,4 @@[codespell]exclude-file=.codespell_ignorelinescheck-hidden=True-ignore-words-list = sherif,+ignore-words-list = sherifdiff --git a/.flake8 b/.flake8index 046c8cc19..137619889 100644--- a/.flake8+++ b/.flake8@@ -1,20 +1,35 @@[flake8]# Exclude the grpc generated codeexclude = ./.*,manim/grpc/gen/*-max-complexity = 35-max-line-length = 211+max-complexity = 15+max-line-length = 88statistics = True+# Prevents some flake8-rst-docstrings errors+rst-roles = attr,class,func,meth,mod,obj,ref,doc,exc+rst-directives = manim, SEEALSO, seealso+# Adds some more bugbear checks+select = B9+# Black Compatibilityextend-ignore = E203, W503,# Unused imports, wildcard imports, and unused variables- F401, F403, F405, F841,+ F401, F403, F405, F841, E501,# Plug-in: flake8-builtinsA001, A002, A003,# Plug-in: flake8-bugbear- B006, B007, B008, B009, B010, B011, B015,+ B006, B008, B009, B010,++ # Plug-in: flake8-simplify+ SIM105, SIM106, SIM119,++ # Plug-in: flake8-comprehensions+ C408,++ # Plug-in: flake8-pytest-style+ PT001, PT004, PT006, PT011, PT018, PT022, PT023,# Plug-in: flake8-docstringsD100, D101, D102, D103, D104, D105, D106, D107,@@ -23,5 +38,7 @@ extend-ignore = E203, W503,D400, D401, D402, D403, D412, D414,# Plug-in: flake8-rst-docstrings- RST201, RST203, RST205, RST210, RST212, RST213, RST215,- RST301, RST303, RST304,+ RST201, RST203, RST210, RST212, RST213, RST215,+ RST301,++# I believe B009, B010, and F841 can be removed but I don't want to break thingsdiff --git a/.gitattributes b/.gitattributesindex bf25f1d93..19fda371f 100644--- a/.gitattributes+++ b/.gitattributes@@ -8,4 +8,3 @@*.wav binarymanim/grpc/gen/** linguist-generated=true-diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.mdindex afb258938..538ae61f4 100644--- a/.github/PULL_REQUEST_TEMPLATE.md+++ b/.github/PULL_REQUEST_TEMPLATE.md@@ -10,7 +10,7 @@<!-- Optional for bugfixes, small enhancements, and documentation-related PRs. Otherwise, please give a short reasoning for your changes. -->## Links to added or changed documentation pages-<!-- Please add links to the affected documentation pages (edit the description after opening the PR). The link to the documentation for your PR is https://manimce--####.org.readthedocs.build/en/####/, where #### represents the PR number. -->+<!-- Please add links to the affected documentation pages (edit the description after opening the PR). The link to the documentation for your PR is https://manimce--####.org.readthedocs.build/en/####/, where #### represents the PR number. -->## Further Information and Commentsdiff --git a/.github/PULL_REQUEST_TEMPLATE/bugfix.md b/.github/PULL_REQUEST_TEMPLATE/bugfix.mdindex 2079339be..1902d1dc2 100644--- a/.github/PULL_REQUEST_TEMPLATE/bugfix.md+++ b/.github/PULL_REQUEST_TEMPLATE/bugfix.md@@ -5,7 +5,7 @@ Before filling in the details, ensure:- Added gradient support and documentation for SVG files-->-## Changelog+## Changelog<!-- Optional: more descriptive changelog entry than just the title for the upcomingrelease. Write RST between the following start and end comments.--><!--changelog-start-->diff --git a/.github/PULL_REQUEST_TEMPLATE/documentation.md b/.github/PULL_REQUEST_TEMPLATE/documentation.mdindex 55abe8478..ff27ede4d 100644--- a/.github/PULL_REQUEST_TEMPLATE/documentation.md+++ b/.github/PULL_REQUEST_TEMPLATE/documentation.md@@ -6,7 +6,7 @@ Before filling in the details, ensure:-->## Summary of Changes-## Changelog+## Changelog<!-- Optional: more descriptive changelog entry than just the title for the upcomingrelease. Write RST between the following start and end comments.--><!--changelog-start-->diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex d5850315a..051c096bd 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -4,16 +4,13 @@ repos:- repo: https://github.com/pre-commit/pre-commit-hooksrev: v4.0.1hooks:+ - id: check-ast+ name: Validate Python+ - id: trailing-whitespace- id: mixed-line-ending- - repo: https://github.com/psf/black- rev: 21.8b0- hooks:- - id: black- - repo: https://github.com/asottile/blacken-docs- rev: v1.11.0- hooks:- - id: blacken-docs- additional_dependencies: [black==20.8b1]+ - id: end-of-file-fixer+ - id: check-toml+ name: Validate Poetry- repo: https://github.com/pycqa/isortrev: 5.9.3hooks:@@ -25,11 +22,44 @@ repos:- id: isortname: isort (pyi)types: [pyi]+ - repo: https://github.com/asottile/add-trailing-comma+ rev: v2.1.0+ hooks:+ - id: add-trailing-comma+ - repo: https://github.com/asottile/pyupgrade+ rev: v2.25.0+ hooks:+ - id: pyupgrade+ name: Update code to new python versions+ args: [--py37-plus]+ exclude: ^manim/grpc/gen/+ - repo: https://github.com/pre-commit/pygrep-hooks+ rev: v1.9.0+ hooks:+ - id: python-check-blanket-noqa+ name: Precision flake ignores+ - repo: https://github.com/psf/black+ rev: 21.8b0+ hooks:+ - id: black+ exclude: ^manim/grpc/gen/+ - repo: https://github.com/asottile/blacken-docs+ rev: v1.11.0+ hooks:+ - id: blacken-docs+ additional_dependencies: [black==20.8b1]+ - repo: https://github.com/asottile/yesqa+ rev: v1.2.3+ hooks:+ - id: yesqa+ name: Remove unneeded flake ignores- repo: https://github.com/PyCQA/flake8rev: 3.9.2hooks:- id: flake8- additional_dependencies: [flake8-builtins==1.5.3, flake8-bugbear==21.4.3, flake8-docstrings==1.6.0, flake8-rst-docstrings==0.2.3]+ additional_dependencies: [flake8-builtins==1.5.3, flake8-bugbear==21.4.3,+ flake8-docstrings==1.6.0, flake8-rst-docstrings==0.2.3,+ flake8-pytest-style==1.5.0, flake8-simplify==0.14.1, flake8-comprehensions==3.6.1]- repo: https://github.com/codespell-project/codespellrev: v2.1.0hooks:diff --git a/CITATION.cff b/CITATION.cffindex 779f1906a..1efdd3334 100644--- a/CITATION.cff+++ b/CITATION.cff@@ -1,6 +1,6 @@# YAML 1.2----authors:+authors:-name: "The Manim Community Developers"cff-version: "1.1.0"@@ -10,4 +10,4 @@ message: "We acknowledge the importance of good software to support research, antitle: Manim – Mathematical Animation Frameworkurl: "https://www.manim.community/"version: "v0.10.0"-...\ No newline at end of file+...diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.mdindex 701af0c72..e5b8c8f9d 100644--- a/CODE_OF_CONDUCT.md+++ b/CODE_OF_CONDUCT.md@@ -204,7 +204,7 @@ Some team members may have a conflict of interest and may be excluded from discuOnce the team has approved the behavioral modification plans and consequences, they will communicate the recommended response to the Manim Community moderators. The team should not state who reported this incident. They should attempt to anonymize any identifying information from the report.-Moderators are required to respond with whether they accept the recommended response to the report. If they disagree with the recommended response, they should provide a detailed response or additional context as to why they disagree. Moderators are encouraged to respond within a week.+Moderators are required to respond with whether they accept the recommended response to the report. If they disagree with the recommended response, they should provide a detailed response or additional context as to why they disagree. Moderators are encouraged to respond within a week.In cases where the moderators disagree on the suggested resolution for a report, the Manim Community Code of Conduct team may choose to notify the Manim Community Moderators.diff --git a/README.md b/README.mdindex dbd1a58c6..29c84fdee 100644--- a/README.md+++ b/README.md@@ -169,7 +169,7 @@ We acknowledge the importance of good software to support research, and we notethat research becomes more valuable when it is communicated effectively. Todemonstrate the value of Manim, we ask that you cite Manim in your work.Currently, the best way to cite Manim is to go to our-[repository page](https://github.com/ManimCommunity/manim) (if you aren't already) and+[repository page](https://github.com/ManimCommunity/manim) (if you aren't already) andclick the "cite this repository" button on the right sidebar. This will generatea citation in your preferred format, and will also integrate well with citation managers.diff --git a/docker/readme.md b/docker/readme.mdindex 367c12770..3041cd1de 100644--- a/docker/readme.md+++ b/docker/readme.md@@ -13,4 +13,3 @@ Multi-platform builds are possible by runningdocker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag manimcommunity/manim:TAG -f docker/Dockerfile .```from the root directory of the repository.-diff --git a/docker/texlive-profile.txt b/docker/texlive-profile.txtindex 722c0dc4a..413b46a56 100644--- a/docker/texlive-profile.txt+++ b/docker/texlive-profile.txt@@ -7,4 +7,4 @@ TEXMFSYSCONFIG /usr/local/texlive/texmf-configTEXMFSYSVAR /usr/local/texlive/texmf-varTEXMFVAR ~/.texlive/texmf-varoption_doc 0-option_src 0\ No newline at end of file+option_src 0diff --git a/docs/source/_static/responsiveSvg.js b/docs/source/_static/responsiveSvg.jsindex 7c49e09f4..12a4c210c 100644--- a/docs/source/_static/responsiveSvg.js+++ b/docs/source/_static/responsiveSvg.js@@ -44,16 +44,16 @@ window.addEventListener("load", function () {.node text {fill: ${colors.text};}-+.node polygon {fill: ${colors.box};}-+.edge polygon {fill: ${colors.edge};stroke: ${colors.edge};}-+.edge path {stroke: ${colors.edge};}diff --git a/docs/source/changelog/0.1.0-changelog.rst b/docs/source/changelog/0.1.0-changelog.rstindex 4d160dedf..191d0b75d 100644--- a/docs/source/changelog/0.1.0-changelog.rst+++ b/docs/source/changelog/0.1.0-changelog.rst@@ -115,4 +115,4 @@ Other Changes#. Cleanup 3b1b Specific Files#. Rename package from manimlib to manim#. Move all imports to :code:`__init__`, so :code:`from manim import *` replaces :code:`from manimlib.imports import *`-#. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.\ No newline at end of file+#. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.diff --git a/docs/source/changelog/0.10.0-changelog.rst b/docs/source/changelog/0.10.0-changelog.rstindex 946b867bf..aeae5e47d 100644--- a/docs/source/changelog/0.10.0-changelog.rst+++ b/docs/source/changelog/0.10.0-changelog.rst@@ -77,7 +77,7 @@ Breaking changes----------------* `#1843 <https://github.com/ManimCommunity/manim/pull/1843>`__: Dropped redundant OpenGL files and add metaclass support for :class:`~.Surface`- - ``OpenGL<x>`` classes from ``opengl_geometry.py``, ``opengl_text_mobject.py``, ``opengl_tex_mobject.py``, ``opengl_svg_path.py``, ``opengl_svg_mobject.py`` and most of ``opengl_three_dimensions.py`` have been removed.+ - ``OpenGL<x>`` classes from ``opengl_geometry.py``, ``opengl_text_mobject.py``, ``opengl_tex_mobject.py``, ``opengl_svg_path.py``, ``opengl_svg_mobject.py`` and most of ``opengl_three_dimensions.py`` have been removed.- ``ParametricSurface`` has been renamed to :class:`~.Surface`Deprecated classes and functions@@ -280,5 +280,3 @@ New releases------------* `#1989 <https://github.com/ManimCommunity/manim/pull/1989>`__: Prepare new release v0.10.0--diff --git a/docs/source/changelog/0.2.0-changelog.rst b/docs/source/changelog/0.2.0-changelog.rstindex c0d205bca..723bf7851 100644--- a/docs/source/changelog/0.2.0-changelog.rst+++ b/docs/source/changelog/0.2.0-changelog.rst@@ -90,4 +90,3 @@ Other changes- Change several ``str.format()`` to ``f``-strings (:pr:`867`)- Update javascript renderer (:pr:`830`)- Bump version number to 0.2.0, update changelog (:pr:`894`)-diff --git a/docs/source/changelog/0.5.0-changelog.rst b/docs/source/changelog/0.5.0-changelog.rstindex 6ab0e7633..7c18dc2e7 100644--- a/docs/source/changelog/0.5.0-changelog.rst+++ b/docs/source/changelog/0.5.0-changelog.rst@@ -161,7 +161,7 @@ Fixed bugs* `#1134 <https://github.com/ManimCommunity/manim/pull/1134>`__: Fixed the `-a` flag.The ``-a`` / ``--write-all`` flag was broken. When used, it would cause Manim to crash just after beginning to render the second scene.-* `#1115 <https://github.com/ManimCommunity/manim/pull/1115>`__: Fixed bugs in :class:`~.OpenGLMobject` and added :class:`ApplyMethod` support+* `#1115 <https://github.com/ManimCommunity/manim/pull/1115>`__: Fixed bugs in :class:`~.OpenGLMobject` and added :class:`ApplyMethod` supportFixed undefined variables and converted :class:`Mobject` to :class:`OpenGLMobject`. Also, fixed assert statement in :class:`ApplyMethod`.* `#1092 <https://github.com/ManimCommunity/manim/pull/1092>`__: Refactored coordinate_systems.py, fixed bugs, added :class:`~.NumberPlane` test@@ -297,11 +297,10 @@ Code quality improvements and similar refactors* `#1019 <https://github.com/ManimCommunity/manim/pull/1019>`__: Refactored :meth:`~.Scene.play`- Removed the _**three**_ decorators of :meth:`~.Scene.play`, in particular: caching logic and file writer logic are now included within :meth:`~.Scene.play` (it wasn't possible before, because `scene.wait` and `scene.play` were two different things).- - Added `is_static_wait` attributes to Wait. (<=> if wait is a frozen frame).- - Renamed and moved `scene.add_static_frame` to `renderer.freeze_current_frame`.+ - Added `is_static_wait` attributes to Wait. (<=> if wait is a frozen frame).+ - Renamed and moved `scene.add_static_frame` to `renderer.freeze_current_frame`.- Now when calling play without animation, it raises `ValueError` instead of just a warning.- Fixed :pr:`874` by modifying `renderer.update_skipping_status`- `renderer` starts the animation with `scene.begin_animations` (`scene.compile_animation_data` used to do this)- - The run time and the time progression generation is now done in `scene.play_internal` although it'd make more sense that renderer processes it later.+ - The run time and the time progression generation is now done in `scene.play_internal` although it'd make more sense that renderer processes it later.- Added a bunch of cool tests thanks to mocks, and thanks to the new syntax `scene.render`-diff --git a/docs/source/changelog/0.6.0-changelog.rst b/docs/source/changelog/0.6.0-changelog.rstindex 4a60a8e0e..0f8866691 100644--- a/docs/source/changelog/0.6.0-changelog.rst+++ b/docs/source/changelog/0.6.0-changelog.rst@@ -473,4 +473,3 @@ New releases------------* `#1434 <https://github.com/ManimCommunity/manim/pull/1434>`__: Prepare v0.6.0-diff --git a/docs/source/changelog/0.7.0-changelog.rst b/docs/source/changelog/0.7.0-changelog.rstindex 653c887c6..4e2a4cb8c 100644--- a/docs/source/changelog/0.7.0-changelog.rst+++ b/docs/source/changelog/0.7.0-changelog.rst@@ -140,7 +140,7 @@ New features* `#1559 <https://github.com/ManimCommunity/manim/pull/1559>`__: Update VGroup to support item assignment (#1530)Support indexed item-assignment for VGroup-* `#1518 <https://github.com/ManimCommunity/manim/pull/1518>`__: Allow fading multiple Mobjects in one Animation+* `#1518 <https://github.com/ManimCommunity/manim/pull/1518>`__: Allow fading multiple Mobjects in one Animation* `#1422 <https://github.com/ManimCommunity/manim/pull/1422>`__: Added :func:`~.override_animation` decorator@@ -190,7 +190,7 @@ Enhancements* `#1567 <https://github.com/ManimCommunity/manim/pull/1567>`__: Compatibility Fixes with ManimPango v0.3.0- - ManimPango v0.3.0+ is required for Manim now.+ - ManimPango v0.3.0+ is required for Manim now.- Show errors from Pango when Markup isn't correct* `#1512 <https://github.com/ManimCommunity/manim/pull/1512>`__: OpenGL compatibility via metaclass: graph@@ -244,7 +244,7 @@ Fixed bugs* `#1560 <https://github.com/ManimCommunity/manim/pull/1560>`__: Declare ``*.npz`` ``*.wav`` ``*.png`` as binary in ``.gitattributes``-* `#1211 <https://github.com/ManimCommunity/manim/pull/1211>`__: Refactored scene caching and fixed issue when a different hash was produced when copying a mobject in the scene+* `#1211 <https://github.com/ManimCommunity/manim/pull/1211>`__: Refactored scene caching and fixed issue when a different hash was produced when copying a mobject in the sceneRefactored internal scene-caching mechanism and fixed bug when an inconsistent hash was produced when copying a mobject.* `#1527 <https://github.com/ManimCommunity/manim/pull/1527>`__: Improved handling of substring isolation within sqrt, and fixed a bug with transform_mismatch for the matching shape transforms@@ -342,7 +342,7 @@ Changes to our development infrastructure* `#1499 <https://github.com/ManimCommunity/manim/pull/1499>`__: Updated Discord links in the docs to point towards a standardized redirect-* `#1461 <https://github.com/ManimCommunity/manim/pull/1461>`__: Build the docs - Logging+* `#1461 <https://github.com/ManimCommunity/manim/pull/1461>`__: Build the docs - Logging* `#1481 <https://github.com/ManimCommunity/manim/pull/1481>`__: pyproject.toml: poetry_core -> poetry-core@@ -397,5 +397,3 @@ New releases------------* `#1601 <https://github.com/ManimCommunity/manim/pull/1601>`__: Preparation for v0.7.0: added changelog and bumped version number--diff --git a/docs/source/changelog/0.8.0-changelog.rst b/docs/source/changelog/0.8.0-changelog.rstindex f5dd7b212..dece78e30 100644--- a/docs/source/changelog/0.8.0-changelog.rst+++ b/docs/source/changelog/0.8.0-changelog.rst@@ -332,5 +332,3 @@ New releases------------* `#1738 <https://github.com/ManimCommunity/manim/pull/1738>`__: Preparation for v0.8.0: added changelog and bumped version number--diff --git a/docs/source/changelog/0.9.0-changelog.rst b/docs/source/changelog/0.9.0-changelog.rstindex 65592cc65..326058b6f 100644--- a/docs/source/changelog/0.9.0-changelog.rst+++ b/docs/source/changelog/0.9.0-changelog.rst@@ -278,5 +278,3 @@ New releases------------* `#1850 <https://github.com/ManimCommunity/manim/pull/1850>`__: Bump version number to ``v0.9.0`` and generate changelog--diff --git a/docs/source/conf.py b/docs/source/conf.pyindex 1c4b54355..bdd68f900 100644--- a/docs/source/conf.py+++ b/docs/source/conf.py@@ -142,7 +142,11 @@ inheritance_graph_attrs = dict()inheritance_node_attrs = dict(- penwidth=0, shape="box", width=0.05, height=0.05, margin=0.05+ penwidth=0,+ shape="box",+ width=0.05,+ height=0.05,+ margin=0.05,)inheritance_edge_attrs = dict(diff --git a/docs/source/contributing/development.rst b/docs/source/contributing/development.rstindex 831fb375f..02e1ee7ea 100644--- a/docs/source/contributing/development.rst+++ b/docs/source/contributing/development.rst@@ -40,22 +40,22 @@ For first-time contributors.. code-block:: shellgit remote add upstream https://github.com/ManimCommunity/manim.git-+#. Now, ``git remote -v`` should show two remote repositories named:-+- ``origin``, your forked repository- ``upstream`` the ManimCommunity repository#. Install Manim:- - Follow the steps in our :doc:`installation instructions+ - Follow the steps in our :doc:`installation instructions<../installation>` to install **Manim's dependencies**,primarily ``ffmpeg`` and ``LaTeX``.-+- We recommend using `Poetry <https://python-poetry.org>`__ to manage yourdeveloper installation of Manim. Poetry is a tool for dependencymanagement and packaging in Python. It allows you to declare the libraries- your project depends on, and it will manage (install / update) them+ your project depends on, and it will manage (install / update) themfor you. In addition, Poetry provides a simple interface formanaging virtual environments.@@ -65,7 +65,7 @@ For first-time contributorsyour cloned repository. Poetry will then install Manim, as wellas create and enter a virtual environment. You can always re-enterthat environment by running ``poetry shell``.-+- In case you decided against Poetry, you can install Manim via pipby running ``python3 -m pip install .``. Note that due to ourdevelopment infrastructure being based on Poetry, we currently@@ -83,7 +83,7 @@ For first-time contributors.. code-block:: shellpoetry run pre-commit install-+This will ensure during development that each of your commits is properlyformatted against our linter and formatters, ``black``, ``flake8``,``isort`` and ``codespell``.@@ -118,7 +118,7 @@ Develop your contribution``git add .``, or add specific files with.. code-block:: shell-+git add <file/directory>and commit these changes to your local history with ``git commit``. If you@@ -126,7 +126,7 @@ Develop your contributionhooks fail... tip::-+When crafting commit messages, it is highly recommended thatyou adhere to `these guidelines <https://www.conventionalcommits.org/en/v1.0.0/>`_.@@ -226,7 +226,7 @@ sticks to our coding conventions.and `flake8 <https://flake8.pycqa.org/en/latest/>`_. The GitHub pipelinemakes sure that the (Python) files changed in your pull requestalso adhere to this code style. If this step of the pipeline fails,- fix your code formatting automatically by running ``black <file or directory>`` and ``isort <file or directory>``.+ fix your code formatting automatically by running ``black <file or directory>`` and ``isort <file or directory>``.To fix code style problems, run ``flake8 <file or directory>`` for a style report, and then fix the problemsmanually that were detected by ``flake8``.@@ -267,7 +267,7 @@ Further useful guidelinesto them in your new issue (even if the old ones are closed).#. When submitting a code review, it is highly recommended that you adhere to- `these general guidelines <https://conventionalcomments.org/>`_.+ `these general guidelines <https://conventionalcomments.org/>`_.#. If you find stale or inactive issues that seem to be irrelevant, please posta comment saying 'This issue should be closed', and a community developerdiff --git a/docs/source/contributing/docstrings.rst b/docs/source/contributing/docstrings.rstindex df27d8309..86ee68f81 100644--- a/docs/source/contributing/docstrings.rst+++ b/docs/source/contributing/docstrings.rst@@ -160,7 +160,7 @@ Example:d: "SomeClassFromFarAway",test: Optional[int] = 45) -> "EpicClassInThisFile": # typings are optional for now- """My cool function. Builds and modifies an :class:`EpicClassInThisFile` instance with the given+ """My cool function. Builds and modifies an :class:`EpicClassInThisFile` instance with the givenparameters.Parametersdiff --git a/docs/source/contributing/examples.rst b/docs/source/contributing/examples.rstindex 5508460b2..2180ffe28 100644--- a/docs/source/contributing/examples.rst+++ b/docs/source/contributing/examples.rst@@ -2,23 +2,23 @@Adding Examples===============-This is a page for adding examples to the documentation.+This is a page for adding examples to the documentation.Here are some guidelines you should follow before you publish your examples.Guidelines for examples------------------------Everybody is welcome to contribute examples to the documentation. Since straightforward+Everybody is welcome to contribute examples to the documentation. Since straightforwardexamples are a great resource for quickly learning manim, here are some guidelines.What makes a great example---------------------------.. note::+.. note::- As soon as a new version of manim is released, the documentation will be a snapshot of that+ As soon as a new version of manim is released, the documentation will be a snapshot of thatversion. Examples contributed after the release will only be shown in the latest documentation.-+* Examples should be ready to copy and paste for use.* Examples should be brief yet still easy to understand.@@ -47,7 +47,7 @@ How examples are structuredWriting examples~~~~~~~~~~~~~~~~-When you want to add/edit examples, they can be found in the ``docs/source/`` directory, or directly in the manim source code (e.g. ``manim/mobject/mobject.py``). The examples are written in+When you want to add/edit examples, they can be found in the ``docs/source/`` directory, or directly in the manim source code (e.g. ``manim/mobject/mobject.py``). The examples are written in``rst`` format and use the manim directive (see :mod:`~.manim_directive` ), ``.. manim::``. Every example is in its own block, and looks like this:.. code:: rst@@ -64,8 +64,8 @@ When you want to add/edit examples, they can be found in the ``docs/source/`` diself.add(t)self.wait(1)-In the building process of the docs, all ``rst`` files are scanned, and the-manim directive (``.. manim::``) blocks are identified as scenes that will be run+In the building process of the docs, all ``rst`` files are scanned, and the+manim directive (``.. manim::``) blocks are identified as scenes that will be runby the current version of manim.Here is the syntax:@@ -84,7 +84,7 @@ has the same name: ``class Formula1(Scene)``.Sometimes, when you reload an example in your browser, it has still the oldwebsite somewhere in its cache. If this is the case, delete the website cache,or open a new incognito tab in your browser, then the latest docs- should be shown.+ should be shown.**Only for locally built documentation:** If this still doesn't work, you may needto delete the contents of ``docs/source/references`` before rebuilding- the documentation.\ No newline at end of file+ the documentation.diff --git a/docs/source/contributing/references.rst b/docs/source/contributing/references.rstindex b3cefce1d..9526344b6 100644--- a/docs/source/contributing/references.rst+++ b/docs/source/contributing/references.rst@@ -134,4 +134,4 @@ Example: ``List[Optional[:class:`str`]]`` for a list that returnselements that are either a ``str`` or ``None``;``Tuple[:class:`str`, :class:`int`]`` for a tuple of type``(str, int)``; ``Tuple[:class:`int`, ...]`` for a tuple of variable-length with only integers.\ No newline at end of file+length with only integers.diff --git a/docs/source/contributing/testing.rst b/docs/source/contributing/testing.rstindex 897dc5e0f..6e1b685e6 100644--- a/docs/source/contributing/testing.rst+++ b/docs/source/contributing/testing.rst@@ -8,20 +8,20 @@ feature has been broken and/or been unintentionally modified.How Manim tests----------------Manim uses pytest as its testing framework.-To start the testing process, go to the root directory of the project and run pytest in your terminal.+Manim uses pytest as its testing framework.+To start the testing process, go to the root directory of the project and run pytest in your terminal.Any errors that occur during testing will be displayed in the terminal.-Some useful pytest flags:+Some useful pytest flags:- ``-x`` will make pytest stop at the first failure it encounters-+- ``-s`` will make pytest display all the print messages (including those during scene generation, like DEBUG messages)-+- ``--skip_slow`` will skip the (arbitrarily) slow tests- ``--show_diff`` will show a visual comparison in case a unit test is failing.-+How it Works~~~~~~~~~~~~@@ -129,7 +129,7 @@ The Main Directories- ``test_graphical_units/``:Contains graphical tests.-+- ``test_scene_rendering/``:For tests that need to render a scene in some way, such as tests for CLI@@ -169,7 +169,7 @@ For example, to test the ``Circle`` VMobject which resides inThe name of the module is indicated by the variable __module_test__, that **must** be declared in any graphical test file. The module name is used to store the graphical control data... important::- You will need to use the ``frames_comparison`` decorator to create a test. The test function **must** accept a+ You will need to use the ``frames_comparison`` decorator to create a test. The test function **must** accept aparameter named ``scene`` that will be used like ``self`` in a standard ``construct`` method.Here's an example in ``test_geometry.py``:@@ -196,7 +196,7 @@ The decorator can be used with or without parentheses. **By default, the test oncircle = Circle()scene.play(Animation(circle))-You can also specify, when needed, which base scene you need (ThreeDScene, for example) :+You can also specify, when needed, which base scene you need (ThreeDScene, for example) :.. code:: python@@ -211,16 +211,16 @@ Note that tests name must follow the syntax ``test_<thing_to_test>``, otherwise.. warning::If you run pytest now, you will get a ``FileNotFound`` error. This is because- you have not created control data for your test.+ you have not created control data for your test.-To create the control data for your test, you have to use the flag ``--set_test`` along with pytest.-For the example above, it would be+To create the control data for your test, you have to use the flag ``--set_test`` along with pytest.+For the example above, it would be.. code-block:: bashpytest test_geometry.py::test_circle --set_test -s-(``-s`` is here to see manim logs, so you can see what's going on).+(``-s`` is here to see manim logs, so you can see what's going on).Please make sure to add the control data to git as soon as it is produced with ``git add <your-control-data.npz>``.@@ -251,7 +251,7 @@ To test videos generated, we use the decoratorout, err, exit_code = capture(command)assert exit_code == 0, err-.. note:: ``assert exit*\ code == 0, err`` is used in case of the command fails+.. note:: ``assert exit*\ code == 0, err`` is used in case of the command failsto run. The decorator takes two arguments: json name and the pathto where the video should be generated, starting from the ``media/`` dir.diff --git a/docs/source/contributing/typings.rst b/docs/source/contributing/typings.rstindex f55a53d9f..034f4b6fa 100644--- a/docs/source/contributing/typings.rst+++ b/docs/source/contributing/typings.rst@@ -75,13 +75,13 @@ When adding type hints to manim, there are some guidelines that should be follow.. note::As a helper for tool for typesets, you can use `typestring-parser- <https://github.com/Dominik1123/typestring-parser>`_+ <https://github.com/Dominik1123/typestring-parser>`_which can be accessed by first installing it via ``pip`` - ``pip install typestring-parser`` andthen using ``from typestring_parser import parse``... doctest:::options: +SKIP-+>>> from typestring_parser import parse>>> parse("int")<class 'int'>@@ -100,4 +100,4 @@ Missing Sections for typehints are:* Where to find the alias* When to use Object and when to use "Object".* The use of a TypeVar on the type hints for copy().-* The definition and use of Protocols (like Sized, or Sequence, or Iterable...)\ No newline at end of file+* The definition and use of Protocols (like Sized, or Sequence, or Iterable...)diff --git a/docs/source/examples.rst b/docs/source/examples.rstindex 60c23c8b9..9ee5aa41b 100644--- a/docs/source/examples.rst+++ b/docs/source/examples.rst@@ -322,7 +322,7 @@ Plotting with Manimx_range=[0, 10], y_range=[0, 100, 10], axis_config={"include_tip": False})labels = ax.get_axis_labels(x_label="x", y_label="f(x)")-+t = ValueTracker(0)def func(x):@@ -570,7 +570,7 @@ Special Camera Settings.. manim:: ThreeDSurfacePlot:save_last_frame::ref_classes: ThreeDScene Surface-+class ThreeDSurfacePlot(ThreeDScene):def construct(self):resolution_fa = 42diff --git a/docs/source/installation.rst b/docs/source/installation.rstindex 9c7f2f3ed..06a4d44fd 100644--- a/docs/source/installation.rst+++ b/docs/source/installation.rst@@ -11,7 +11,7 @@ Otherwise, if you intend to use Manim to work on an animation project,we recommend installing the library locally (either to your system'sPython, or via Docker).-.. warning::+.. warning::Note that there are several different versions of Manim. Theinstructions on this website are **only** for the *community edition*.@@ -21,7 +21,7 @@ Python, or via Docker).#. :ref:`Installing Manim to your system's Python <local-installation>`#. :ref:`Using Manim via Docker <docker-installation>`-#. :ref:`Interactive Jupyter notebooks via Binder / Google Colab+#. :ref:`Interactive Jupyter notebooks via Binder / Google Colab<interactive-online>`@@ -43,7 +43,7 @@ operating system specific instructions for you to follow.follow the steps on the following pages carefully, but in caseyou hit a wall we are happy to help: either `join our Discord<https://www.manim.community/discord/>`__, or start a new- Discussion `directly on GitHub+ Discussion `directly on GitHub<https://github.com/ManimCommunity/manim/discussions>`__... toctree::@@ -59,12 +59,12 @@ Once Manim is installed locally, you can proceed to ourthrough rendering a first simple scene.As mentioned above, do not worry if there are errors or other-problems: consult our :doc:`troubleshooting+problems: consult our :doc:`troubleshootingguide <installation/troubleshooting>` for help, or get in touch-with the community via `GitHub discussions-<https://github.com/ManimCommunity/manim/discussions>`__ or+with the community via `GitHub discussions+<https://github.com/ManimCommunity/manim/discussions>`__ or`Discord <https://www.manim.community/discord/>`__.-+.. _docker-installation:@@ -108,6 +108,3 @@ In order to change code in the library, it is recommended toinstall Manim in a different way. Please follow the instructionsin our :doc:`contribution guide <contributing>` if you areinterested in that.---diff --git a/docs/source/installation/docker.rst b/docs/source/installation/docker.rstindex 66cb43db0..45eab6864 100644--- a/docs/source/installation/docker.rst+++ b/docs/source/installation/docker.rst@@ -2,19 +2,19 @@ Docker======The community maintains a docker image, which can be found-`on DockerHub <https://hub.docker.com/r/manimcommunity/manim>`__.+`on DockerHub <https://hub.docker.com/r/manimcommunity/manim>`__.For our image ``manimcommunity/manim``, there are the following tags:-- ``latest``: the most recent version corresponding+- ``latest``: the most recent version correspondingto `the main branch <https://github.com/ManimCommunity/manim>`__,-- ``stable``: the latest released version (according to+- ``stable``: the latest released version (according to`the releases page <https://github.com/ManimCommunity/manim/releases>`__),-- ``vX.Y.Z``: any particular released version (according to+- ``vX.Y.Z``: any particular released version (according to`the releases page <https://github.com/ManimCommunity/manim/releases>`__)... note::- When using Manim's CLI within a Docker container, some flags like+ When using Manim's CLI within a Docker container, some flags like``-p`` (preview file) and ``-f`` (show output file in the file browser)are not supported.@@ -23,7 +23,7 @@ Basic usage of the Docker container-----------------------------------Assuming that you can access the docker installation on your system-from a terminal (bash / PowerShell) via ``docker``, you can+from a terminal (bash / PowerShell) via ``docker``, you canrender a scene ``CircleToSquare`` in a file `test_scenes.py`with the following command.@@ -45,7 +45,7 @@ modify to your liking. First, run.. code-block:: sh- docker run -it --name my-manim-container -v "/full/path/to/your/directory:/manim" manimcommunity/manim /bin/bash+ docker run -it --name my-manim-container -v "/full/path/to/your/directory:/manim" manimcommunity/manim /bin/bashto obtain an interactive shell inside your container allowing you@@ -75,4 +75,4 @@ local JupyterLab instance. To do that, simply rundocker run -it -p 8888:8888 manimcommunity/manim jupyter lab --ip=0.0.0.0-and then follow the instructions in the terminal.\ No newline at end of file+and then follow the instructions in the terminal.diff --git a/docs/source/installation/jupyter.rst b/docs/source/installation/jupyter.rstindex 0680b0c93..e2a61114f 100644--- a/docs/source/installation/jupyter.rst+++ b/docs/source/installation/jupyter.rst@@ -29,12 +29,12 @@ a way that allows them to be shared interactively via Binder as well:FROM manimcommunity/manim:v0.9.0COPY --chown=manimuser:manimuser . /manim-+Don't forget to change the version tag ``v0.9.0`` to the version youwere working with locally when creating your notebooks.#. Make the directory with your worksheets and the ``Dockerfile``available to the public (and in particular: to Binder!). There are- `several different options to do so+ `several different options to do so<https://mybinder.readthedocs.io/en/latest/introduction.html#how-can-i-prepare-a-repository-for-binder>`__,within the community we usually work with GitHubrepositories or gists.@@ -44,7 +44,7 @@ a way that allows them to be shared interactively via Binder as well:.. hint::- The repository containing our `interactive tutorial+ The repository containing our `interactive tutorial<https://try.manim.community>`__ can be found athttps://github.com/ManimCommunity/jupyter_examples.@@ -88,12 +88,12 @@ in a new code cell. Then create another cell containing thefollowing code::%%manim -qm -v WARNING SquareToCircle-+class SquareToCircle(Scene):def construct(self):square = Square()- circle = Circle()- circle.set_fill(PINK, opacity=0.5)+ circle = Circle()+ circle.set_fill(PINK, opacity=0.5)self.play(Create(square))self.play(Transform(square, circle))self.wait()diff --git a/docs/source/installation/linux.rst b/docs/source/installation/linux.rstindex 6b56edf92..de19a6a5c 100644--- a/docs/source/installation/linux.rst+++ b/docs/source/installation/linux.rst@@ -6,7 +6,7 @@ system and package manager. If you happen to know exactly what you are doing,you can also simply ensure that your system has:- a reasonably recent version of Python 3 (3.7 or above),-- with working Cairo bindings in the form of+- with working Cairo bindings in the form of`pycairo <https://cairographics.org/pycairo/>`__,- FFmpeg accessible from the command line as ``ffmpeg``,- and `Pango <https://pango.gnome.org>`__ headers.@@ -20,10 +20,10 @@ Then, installing Manim is just a matter of running:.. note::In light of the current efforts of migrating to rendering via OpenGL,- this list might be incomplete. Please `let us know+ this list might be incomplete. Please `let us know<https://github.com/ManimCommunity/manim/issues/new/choose>` if youran into missing dependencies while installing.-+In any case, we have also compiled instructions for several commoncombinations of operating systems and package managers below.@@ -38,13 +38,13 @@ simply run:.. code-block:: bash- sudo apt update+ sudo apt updatesudo apt install libcairo2-dev libpango1.0-dev ffmpegIf you don't have python3-pip installed, install it via:.. code-block:: bash-+sudo apt install python3-pipThen, to install Manim, run:@@ -95,11 +95,11 @@ pacman – Arch / Manjaro.. tip::- Thanks to *groctel*, there is a `dedicated Manim package+ Thanks to *groctel*, there is a `dedicated Manim packageon the AUR! <https://aur.archlinux.org/packages/manim/>`If you don't want to use the packaged version from AUR, here is what-you need to do manually: Update your package sources, then install+you need to do manually: Update your package sources, then installCairo, Pango, and FFmpeg:.. code-block:: bash@@ -110,7 +110,7 @@ Cairo, Pango, and FFmpeg:If you don't have ``python-pip`` installed, get it by running:.. code-block:: bash-+sudo pacman -S python-pipthen simply install Manim via:@@ -134,7 +134,7 @@ equations, LaTeX has to be installed as well. Note that this is an optionaldependency: if you don't intend to use LaTeX, you don't have to install it.You can use whichever LaTeX distribution you like or whichever is easiest-to install with your package manager. Usually,+to install with your package manager. Usually,`TeX Live <https://www.tug.org/texlive/>`__ is a good candidate if you don'tcare too much about disk space.diff --git a/docs/source/installation/macos.rst b/docs/source/installation/macos.rstindex e212d3aa7..429373930 100644--- a/docs/source/installation/macos.rst+++ b/docs/source/installation/macos.rst@@ -16,7 +16,7 @@ follow `Homebrew's installation instructions <https://docs.brew.sh/Installation>layer between Intel and ARM architectures. This is no longer necessary, Manim can(and is recommended to) be installed natively.-+Required Dependencies---------------------@@ -28,7 +28,7 @@ and some required Python packages), run:brew install py3cairo ffmpegOn *Apple Silicon* based machines (i.e., devices with the M1 chip or similar; if-you are unsure which processor you have check by opening the Apple menu, select+you are unsure which processor you have check by opening the Apple menu, select*About This Mac* and check the entry next to *Chip*), some additional dependenciesare required, namely:@@ -66,7 +66,7 @@ In order to make use of Manim's interface to LaTeX for, e.g., renderingequations, LaTeX has to be installed as well. Note that this is an optionaldependency: if you don't intend to use LaTeX, you don't have to install it.-For MacOS, the recommended LaTeX distribution is+For MacOS, the recommended LaTeX distribution is`MacTeX <http://www.tug.org/mactex/>`__. You can install it by followingthe instructions from the link, or alternatively also via Homebrew byrunning:@@ -79,7 +79,7 @@ running:MacTeX is a *full* LaTeX distribution and will require more than 4GB ofdisk space. If this is an issue for you, consider installing a smaller- distribution like+ distribution like`BasicTeX <http://www.tug.org/mactex/morepackages.html>`__.Should you choose to work with some partial TeX distribution, the full listdiff --git a/docs/source/installation/troubleshooting.rst b/docs/source/installation/troubleshooting.rstindex 1eecf3ca6..15d4bd47f 100644--- a/docs/source/installation/troubleshooting.rst+++ b/docs/source/installation/troubleshooting.rst@@ -6,14 +6,14 @@ Version incompatibilityConfusion and conflict between versions is by far the most common reasonfor installation failures. Some signs and errors resulting from this are-as follows:--- ``There are no scenes in that module``-- ``ModuleNotFoundError: No module named 'manim'``-- ``ModuleNotFoundError: No module named 'manimlib'``-- You followed any tutorial created before October 2020 (because the community edition did not exist before then)-- You cloned a repository on GitHub (installation of the community version for normal use does not require the cloning of any repository)-- Different import statements (explained below)+as follows:++- ``There are no scenes in that module``+- ``ModuleNotFoundError: No module named 'manim'``+- ``ModuleNotFoundError: No module named 'manimlib'``+- You followed any tutorial created before October 2020 (because the community edition did not exist before then)+- You cloned a repository on GitHub (installation of the community version for normal use does not require the cloning of any repository)+- Different import statements (explained below)- You used documentation for multiple versions (such as the readme for 3b1b/manim and this documentation).. note::@@ -41,7 +41,7 @@ generally not work without some modification.Identifying the version you are running----------------------------------------The community edition of manim should always state `Manim Community <version_number>`+The community edition of manim should always state `Manim Community <version_number>`as its first line of any command you run.Identifying and removing conflicting versions of manim@@ -120,7 +120,7 @@ First, make sure your ``dvisvgm`` version is at least 2.4:If you do not know how to update ``dvisvgm``, please refer to your operating system's documentation.-Second, check whether your ``dvisvgm`` supports PostScript specials. This is+Second, check whether your ``dvisvgm`` supports PostScript specials. This isneeded to convert from PDF to SVG... code-block:: bash@@ -128,7 +128,7 @@ needed to convert from PDF to SVG.dvisvgm -l-If the output to this command does **not** contain ``ps dvips PostScript specials``,+If the output to this command does **not** contain ``ps dvips PostScript specials``,this is a bad sign. In this case, run.. code-block:: bash@@ -136,16 +136,16 @@ this is a bad sign. In this case, rundvisvgm -h-If the output does **not** contain ``--libgs=filename``, this means your+If the output does **not** contain ``--libgs=filename``, this means your``dvisvgm`` does not currently support PostScript. You must get another binary.-If, however, ``--libgs=filename`` appears in the help, that means that your-``dvisvgm`` needs the Ghostscript library to support PostScript. Search for-``libgs.so`` (on Linux, probably in ``/usr/local/lib`` or ``/usr/lib``) or-``gsdll32.dll`` (on 32-bit Windows, probably in ``C:\windows\system32``) or-``gsdll64.dll`` (on 64-bit Windows, probably in ``c:\windows\system32`` -- yes-32) or ``libgsl.dylib`` (on Mac OS, probably in ``/usr/local/lib`` or-``/opt/local/lib``). Please look carefully, as the file might be located+If, however, ``--libgs=filename`` appears in the help, that means that your+``dvisvgm`` needs the Ghostscript library to support PostScript. Search for+``libgs.so`` (on Linux, probably in ``/usr/local/lib`` or ``/usr/lib``) or+``gsdll32.dll`` (on 32-bit Windows, probably in ``C:\windows\system32``) or+``gsdll64.dll`` (on 64-bit Windows, probably in ``c:\windows\system32`` -- yes+32) or ``libgsl.dylib`` (on Mac OS, probably in ``/usr/local/lib`` or+``/opt/local/lib``). Please look carefully, as the file might be locatedelsewhere, e.g. in the directory where Ghostscript is installed.As soon as you have found the library, try (on Mac OS or Linux)@@ -163,8 +163,8 @@ or (on Windows)dvisvgm -l-You should now see ``ps dvips PostScript specials`` in the output. Refer to-your operating system's documentation to find out how you can set or export the+You should now see ``ps dvips PostScript specials`` in the output. Refer to+your operating system's documentation to find out how you can set or export theenvironment variable ``LIBGS`` automatically whenever you open a shell.As a last check, you can run@@ -173,12 +173,12 @@ As a last check, you can rundvisvgm -V1-while still having ``LIBGS`` set to the correct path, of course. If ``dvisvgm``-can find your Ghostscript installation, it will be shown in the output together+while still having ``LIBGS`` set to the correct path, of course. If ``dvisvgm``+can find your Ghostscript installation, it will be shown in the output togetherwith the version number.-If you do not have the necessary library on your system, please refer to your-operating system's documentation to find out where you can get it and how you+If you do not have the necessary library on your system, please refer to your+operating system's documentation to find out where you can get it and how youhave to install it.If you are unable to solve your problem, check out the `dvisvgm FAQ <https://dvisvgm.de/FAQ/>`_.diff --git a/docs/source/installation/versions.rst b/docs/source/installation/versions.rstindex 809b634eb..6bad75c0d 100644--- a/docs/source/installation/versions.rst+++ b/docs/source/installation/versions.rst@@ -1,24 +1,24 @@Differences between Manim Versions==================================-While originally a single library, there are now three main versions of manim,-each with their own advantages, disadvantages, and ideal use cases.-It is important to understand these differences in order to select the best version+While originally a single library, there are now three main versions of manim,+each with their own advantages, disadvantages, and ideal use cases.+It is important to understand these differences in order to select the best versionfor your use case and avoid confusion arising from version mismatches.A brief history of Manim************************-Manim was originally created by Grant Sanderson as a personal project and for use in his YouTube channel,-`3Blue1Brown <https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw>`_. As his channel gained popularity,-many grew to like the style of his animations and wanted to use manim for their own projects.-However, as manim was only intended for personal use,+Manim was originally created by Grant Sanderson as a personal project and for use in his YouTube channel,+`3Blue1Brown <https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw>`_. As his channel gained popularity,+many grew to like the style of his animations and wanted to use manim for their own projects.+However, as manim was only intended for personal use,it was very difficult for other users to install and use it.-In late 2019, Grant started working on faster OpenGL rendering in a new branch,-known as the shaders branch. In mid-2020, a group of developers forked it into what is now the community edition;-this is the version documented on this website.-In early 2021, Grant merged the shaders branch back into master, making it the default branch in his repository.+In late 2019, Grant started working on faster OpenGL rendering in a new branch,+known as the shaders branch. In mid-2020, a group of developers forked it into what is now the community edition;+this is the version documented on this website.+In early 2021, Grant merged the shaders branch back into master, making it the default branch in his repository.The old version is still available as the branch ``cairo-backend``.The three versions of Manim@@ -32,8 +32,8 @@ There are currently three main versions of manim. They are as follows:Which version to use********************-We recommend using the community edition for most purposes, as it has been developed to be more stable,-better tested, quicker to respond to community contributions, and easier for beginners to use.+We recommend using the community edition for most purposes, as it has been developed to be more stable,+better tested, quicker to respond to community contributions, and easier for beginners to use.It also has partial experimental OpenGL support and should have full support shortly (as of April 2021).If you would like to use a version with full OpenGL support or render recent 3Blue1Brown videos (2020 onwards), you should use ManimGL.@@ -42,8 +42,8 @@ If you would like to render old 3Blue1Brown projects (2019 and before), you shouNotes on installation, documentation, and use*********************************************-If you are a beginner, it is very important that you only use the documentation for your desired version.-Trying to install or learn manim using documentation or guides made for different versions will likely fail and only lead to more confusion.-As many tutorials and guides on the internet are outdated, we do not recommend you follow them.-You should only read tutorials and documentation for other versions once you are aware of the differences between them+If you are a beginner, it is very important that you only use the documentation for your desired version.+Trying to install or learn manim using documentation or guides made for different versions will likely fail and only lead to more confusion.+As many tutorials and guides on the internet are outdated, we do not recommend you follow them.+You should only read tutorials and documentation for other versions once you are aware of the differences between themand know how to adapt code for your desired version.diff --git a/docs/source/installation/windows.rst b/docs/source/installation/windows.rstindex fae7a0e71..512b6a9bf 100644--- a/docs/source/installation/windows.rst+++ b/docs/source/installation/windows.rst@@ -2,7 +2,7 @@ Windows=======The easiest way of installing Manim and its dependencies is by using a-package manager like `Chocolatey <https://chocolatey.org/>`__+package manager like `Chocolatey <https://chocolatey.org/>`__or `Scoop <https://scoop.sh>`__. If you are not afraid of editingyour System's ``PATH``, a manual installation is also possible.In fact, if you already have an existing Python@@ -11,7 +11,7 @@ everything up and running.If you choose to use one of the package managers, please followtheir installation instructions-(`for Chocolatey <https://chocolatey.org/install#install-step2>`__,+(`for Chocolatey <https://chocolatey.org/install#install-step2>`__,`for Scoop <https://scoop-docs.now.sh/docs/getting-started/Quick-Start.html>`__)to make one of them available on your system.@@ -69,24 +69,24 @@ installed on your system.We have received reports of problems caused by using the version ofPython that can be installed from the Windows Store. At this point,we recommend staying away from the Windows Store version. Instead,- install Python directly from the+ install Python directly from the`official website <https://www.python.org>`__.**FFmpeg:** In order to install FFmpeg, you can get apre-compiled and ready-to-use version from one of the resourceslinked at https://ffmpeg.org/download.html#build-windows, such as-`the version available here+`the version available here<https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.7z>`__(recommended), or if you know exactly what you are doingyou can alternatively get the source codefrom https://ffmpeg.org/download.html and compile it yourself.-After downloading the pre-compiled archive,+After downloading the pre-compiled archive,`unzip it <https://www.7-zip.org>`__ and, if you like, move the-extracted directory to some more permanent place (e.g.,+extracted directory to some more permanent place (e.g.,``C:\Program Files\``). Next, edit the ``PATH`` environment variable:-first, visit ``Control Panel`` > ``System`` > ``System settings`` >+first, visit ``Control Panel`` > ``System`` > ``System settings`` >``Environment Variables``, then add the full path to the ``bin``directory inside of the (moved) ffmpeg directory to the``PATH`` variable. Finally, save your changes and exit.@@ -111,14 +111,14 @@ In order to make use of Manim's interface to LaTeX to, for example, renderequations, LaTeX has to be installed as well. Note that this is an optionaldependency: if you don't intend to use LaTeX, you don't have to install it.-For Windows, the recommended LaTeX distribution is+For Windows, the recommended LaTeX distribution is`MiKTeX <https://miktex.org/download>`__. You can install it by using theinstaller from the linked MiKTeX site, or by using the package managerof your choice (Chocolatey: ``choco install miktex.install``,Scoop: ``scoop install latex``).If you are concerned about disk space, there are some alternative,-smaller distributions of LaTeX like+smaller distributions of LaTeX like`TinyTeX <https://yihui.org/tinytex/>`__ (Chocolatey: ``choco install tinytex``,Scoop: first ``scoop bucket add r-bucket https://github.com/cderv/r-bucket.git``,then ``scoop install tinytex``). In this case, you will have to manage thediff --git a/docs/source/manim_directive.py b/docs/source/manim_directive.pyindex e30b53d05..68d9f8c72 100644--- a/docs/source/manim_directive.py+++ b/docs/source/manim_directive.py@@ -133,7 +133,8 @@ class ManimDirective(Directive):option_spec = {"hide_source": bool,"quality": lambda arg: directives.choice(- arg, ("low", "medium", "high", "fourk")+ arg,+ ("low", "medium", "high", "fourk"),),"save_as_gif": bool,"save_last_frame": bool,@@ -148,7 +149,9 @@ class ManimDirective(Directive):if "skip-manim" in self.state.document.settings.env.app.builder.tags.tags:node = skip_manim_node()self.state.nested_parse(- StringList(self.content[0]), self.content_offset, node+ StringList(self.content[0]),+ self.content_offset,+ node,)return [node]@@ -273,7 +276,8 @@ class ManimDirective(Directive):ref_block=ref_block,)state_machine.insert_input(- rendered_template.split("\n"), source=document.attributes["source"]+ rendered_template.split("\n"),+ source=document.attributes["source"],)return []@@ -289,7 +293,7 @@ def _write_rendering_stats(scene_name, run_time, file_name):re.sub(r"^(reference\/)|(manim\.)", "", file_name),scene_name,"%.3f" % run_time,- ]+ ],)@@ -312,7 +316,7 @@ def _log_rendering_times(*args):continuetime_sum = sum(float(row[2]) for row in group)print(- f"{key}{f'{time_sum:.3f}'.rjust(7, '.')}s => {len(group)} EXAMPLES"+ f"{key}{f'{time_sum:.3f}'.rjust(7, '.')}s => {len(group)} EXAMPLES",)for row in group:print(f"{' '*(max_file_length)} {row[2].rjust(7)}s {row[1]}")diff --git a/docs/source/plugins.rst b/docs/source/plugins.rstindex 7b5cd2cbe..d963aa8b2 100644--- a/docs/source/plugins.rst+++ b/docs/source/plugins.rst@@ -8,7 +8,7 @@ Plugins are features that extend Manim's core functionality. Since Manim isextensible and not everything belongs in its core, we'll go over how toinstall, use, and create your own plugins.-.. note::+.. note::The standard naming convention for plugins is to prefix the plugin with``manim-``. This makes them easy for users to find on package@@ -65,7 +65,7 @@ For enabling a plugin ``manim.cfg`` or command line parameters should be used.The plugins should be module name of the plugin and not PyPi name.-Enabling plugins through ``manim.cfg``+Enabling plugins through ``manim.cfg``.. code-block:: inidiff --git a/docs/source/reference_index/animations.rst b/docs/source/reference_index/animations.rstindex c4bc6e6fd..a58800141 100644--- a/docs/source/reference_index/animations.rst+++ b/docs/source/reference_index/animations.rst@@ -44,5 +44,3 @@ Module Index~animation.transform~animation.transform_matching_parts~animation.update--diff --git a/docs/source/reference_index/configuration.rst b/docs/source/reference_index/configuration.rstindex 966beb7f2..6cb59189a 100644--- a/docs/source/reference_index/configuration.rst+++ b/docs/source/reference_index/configuration.rst@@ -12,5 +12,3 @@ Module Index~_config~_config.utils~_config.logger_utils--diff --git a/docs/source/reference_index/mobjects.rst b/docs/source/reference_index/mobjects.rstindex e0e8afbb2..dd33d012b 100644--- a/docs/source/reference_index/mobjects.rst+++ b/docs/source/reference_index/mobjects.rst@@ -77,4 +77,3 @@ Module Index~mobject.types.image_mobject~mobject.types.point_cloud_mobject~mobject.types.vectorized_mobject-diff --git a/docs/source/robots.txt b/docs/source/robots.txtindex a8fc0e350..cf837d481 100644--- a/docs/source/robots.txt+++ b/docs/source/robots.txt@@ -2,4 +2,4 @@ User-agent: *Disallow: /Allow: /en/stable/-Sitemap: https://docs.manim.community/sitemap.xml\ No newline at end of file+Sitemap: https://docs.manim.community/sitemap.xmldiff --git a/docs/source/tutorials/building_blocks.rst b/docs/source/tutorials/building_blocks.rstindex 8c117f880..7c691df85 100644--- a/docs/source/tutorials/building_blocks.rst+++ b/docs/source/tutorials/building_blocks.rst@@ -274,7 +274,7 @@ the use of :meth:`.animate`.self.play(square.animate.shift(UP).rotate(PI / 3))self.wait(1)-:meth:`.animate` is a property of all mobjects that animates the methods that come+:meth:`.animate` is a property of all mobjects that animates the methods that comeafterward. For example, :code:`square.set_fill(WHITE)` sets the fill color ofthe square, while :code:`sqaure.animate.set_fill(WHITE)` animates this action.@@ -368,7 +368,7 @@ Using coordinates of a mobject==============================Mobjects contain points that define their boundaries.-These points can be used to add other mobjects respectively to each other,+These points can be used to add other mobjects respectively to each other,e.g. by methods like :meth:`~.Mobject.get_center` , :meth:`~.Mobject.get_top`and :meth:`~.Mobject.get_start`. Here is an example of some important coordinates:@@ -411,12 +411,12 @@ It is also possible to transform a mobject into another mobject like this:m2 = Rectangle().set_color(RED).rotate(0.2)self.play(Transform(m1,m2))-The Transform function maps points of the previous mobject to the points of the+The Transform function maps points of the previous mobject to the points of thenext mobject.-This might result in strange behaviour, e.g. when the dots of one mobject are+This might result in strange behaviour, e.g. when the dots of one mobject arearranged clockwise and the other points are arranged counterclockwise.-Here it might help to use the `flip` function and reposition the points via the-`roll <https://numpy.org/doc/stable/reference/generated/numpy.roll.html>`_+Here it might help to use the `flip` function and reposition the points via the+`roll <https://numpy.org/doc/stable/reference/generated/numpy.roll.html>`_function of numpy:.. manim:: ExampleRotation@@ -428,11 +428,11 @@ function of numpy:m1b = Circle().set_color(RED).shift(LEFT)m2a= Square().set_color(BLUE).shift(RIGHT)m2b= Circle().set_color(BLUE).shift(RIGHT)-+points = m2a.pointspoints = np.roll(points, int(len(points)/4), axis=0)m2a.points = points-+self.play(Transform(m1a,m1b),Transform(m2a,m2b), run_time=1)******diff --git a/docs/source/tutorials/configuration.rst b/docs/source/tutorials/configuration.rstindex b109788d7..04a735892 100644--- a/docs/source/tutorials/configuration.rst+++ b/docs/source/tutorials/configuration.rst@@ -90,7 +90,7 @@ high, and 4k quality, respectively... code-block:: bash- manim -ql <file.py> SceneName+ manim -ql <file.py> SceneNameThese flags set the values of the config options ``config.pixel_width``,``config.pixel_height``, ``config.frame_rate``, and ``config.quality``.@@ -110,7 +110,7 @@ instead of the whole video, you can execute.. code-block:: bash- manim -sqh <file.py> SceneName+ manim -sqh <file.py> SceneNameThe following example specifies the output file name (with the :code:`-o`flag), renders only the first ten animations (:code:`-n` flag) with a white@@ -120,7 +120,7 @@ open the file after it is rendered... code-block:: bash- manim -o myscene -i -n 0,10 -c WHITE <file.py> SceneName+ manim -o myscene -i -n 0,10 -c WHITE <file.py> SceneName.. tip:: There are many more command-line flags that manim accepts. All thepossible flags are shown by executing ``manim render --help``. A complete list@@ -162,7 +162,7 @@ Now, executing the following command.. code-block:: bash- manim -o myscene -i -c WHITE <file.py> SceneName+ manim -o myscene -i -c WHITE <file.py> SceneNameis equivalent to executing the following command, provided that ``manim.cfg``is in the same directory as <file.py>,@@ -377,8 +377,8 @@ A list of all CLI flagsplugins Manages Manim plugins.Made with <3 by Manim Community developers.--Each of the subcommands has its own help page which can be++Each of the subcommands has its own help page which can be.. code::diff --git a/docs/source/tutorials/quickstart.rst b/docs/source/tutorials/quickstart.rstindex 0088c7d66..48ee0d0ec 100644--- a/docs/source/tutorials/quickstart.rst+++ b/docs/source/tutorials/quickstart.rst@@ -60,7 +60,7 @@ the following command:.. code-block:: bash- manim -pql scene.py SquareToCircle+ manim -pql scene.py SquareToCircleAfter showing some output, manim should render the scene into a .mp4 file,and open that file with the default movie player application. You should see a@@ -158,7 +158,7 @@ And render it using the following command:.. code-block:: bash- manim -pql scene.py SquareToCircle+ manim -pql scene.py SquareToCircleThe output should look as follows.diff --git a/docs/source/tutorials/using_text.rst b/docs/source/tutorials/using_text.rstindex 51be2cab8..85a2c00a5 100644--- a/docs/source/tutorials/using_text.rst+++ b/docs/source/tutorials/using_text.rst@@ -7,11 +7,11 @@ There are two different ways by which you can render **Text** in videos:1. Using Pango (:mod:`~.text_mobject`)2. Using LaTeX (:mod:`~.tex_mobject`)-If you want to render simple text, you should use either :class:`~.Text` or+If you want to render simple text, you should use either :class:`~.Text` or:class:`~.MarkupText`, or one of its derivatives like :class:`~.Paragraph`.See :ref:`using-text-objects` for more information.-LaTeX should be used when you need mathematical typesetting. See+LaTeX should be used when you need mathematical typesetting. See:ref:`rendering-with-latex` for more information... _using-text-objects:@@ -26,7 +26,7 @@ render non-English alphabets like 你好 or こんにちは or 안녕하세요Here is a simple *Hello World* animation.-.. manim:: HelloWorld+.. manim:: HelloWorld:save_last_frame::ref_classes: Text@@ -39,7 +39,7 @@ You can also use :class:`~.MarkupText` which allows the use of PangoMarkup(see the documentation of :class:`~.MarkupText` for details) to render text.For example:-.. manim:: SingleLineColor+.. manim:: SingleLineColor:save_last_frame::ref_classes: MarkupText@@ -61,7 +61,7 @@ Using FontsYou can set a different font using :attr:`~.Text.font`.-.. note::+.. note::The font used must be installed in your system, and Pango should knowabout it. You can get a list of fonts using :func:`manimpango.list_fonts`.@@ -71,9 +71,9 @@ You can set a different font using :attr:`~.Text.font`.[...]-.. manim:: FontsExample+.. manim:: FontsExample:save_last_frame:-+class FontsExample(Scene):def construct(self):ft = Text("Noto Sans", font="Noto Sans")@@ -81,7 +81,7 @@ You can set a different font using :attr:`~.Text.font`.Setting Slant and Weight-------------------------Slant is the style of the Text, and it can be ``NORMAL`` (the default),+Slant is the style of the Text, and it can be ``NORMAL`` (the default),``ITALIC`` or ``OBLIQUE``. Usually, for many fonts both ``ITALIC`` and``OBLIQUE`` look similar, but ``ITALIC`` uses **Roman Style**, whereas``OBLIQUE`` uses **Italic Style**.@@ -97,7 +97,7 @@ Weight specifies the boldness of a font. You can see a list of weights ina = Text("Italic", slant=ITALIC)self.add(a)-.. manim:: DifferentWeight+.. manim:: DifferentWeight:save_last_frame:class DifferentWeight(Scene):@@ -131,10 +131,10 @@ as explained in :ref:`iterating-text`.:attr:`~Text.t2c` accepts two types of dictionaries,-* The keys can contain indices like ``[2:-1]`` or ``[4:8]``,+* The keys can contain indices like ``[2:-1]`` or ``[4:8]``,this works similar to how `slicing <https://realpython.com/python-strings/#string-slicing>`_works in Python. The values should be the color of the Text from :class:`~.Color`.-+* The keys contain words or characters which should be colored separatelyand the values should be the color from :class:`~.Color`:@@ -166,7 +166,7 @@ be an iterable of any length:t = Text("Hello", gradient=(RED, BLUE, GREEN), font_size=96)self.add(t)-You can also use :attr:`~.Text.t2g` for gradients with specific+You can also use :attr:`~.Text.t2g` for gradients with specificcharacters of the text. It shares a similar syntax to :ref:`theinterface for colors <using-colors>`:@@ -210,7 +210,7 @@ Disabling Ligatures-------------------By disabling ligatures you would get a one-to-one mapping between characters and-submobjects. This fixes the issues with coloring text.+submobjects. This fixes the issues with coloring text... warning::@@ -218,7 +218,7 @@ submobjects. This fixes the issues with coloring text.Be aware that using this method with text that heavily depends onligatures (Arabic text) may yield unexpected results.-You can disable ligatures by passing ``disable_ligatures`` to+You can disable ligatures by passing ``disable_ligatures`` to:class:`Text`. For example:.. manim:: DisableLigature@@ -262,14 +262,14 @@ For example, you can set each letter to different color by iterating it.Working with :class:`~.MarkupText`==================================-MarkupText is similar to :class:`~.Text`, the only difference between them is+MarkupText is similar to :class:`~.Text`, the only difference between them isthat this accepts and processes PangoMarkup (which is similar tohtml), instead of just rendering plain text.Consult the documentation of :class:`~.MarkupText` for more detailsand further references about PangoMarkup.-.. manim:: MarkupTest+.. manim:: MarkupTest:save_last_frame:class MarkupTest(Scene):@@ -291,7 +291,7 @@ use :class:`~.Tex` to insert LaTeX.For example,-.. manim:: HelloLaTeX+.. manim:: HelloLaTeX:save_last_frame:class HelloLaTeX(Scene):@@ -314,14 +314,14 @@ Everything passed to :class:`~.MathTex` is in math mode by default. To be more psimilar effect with :class:`~.Tex` by enclosing your formula with ``$`` symbols:``$\xrightarrow{x^6y^8}$``:-.. manim:: MathTeXDemo+.. manim:: MathTeXDemo:save_last_frame:class MathTeXDemo(Scene):def construct(self):rtarrow0 = MathTex(r"\xrightarrow{x^6y^8}", font_size=96)rtarrow1 = Tex(r"$\xrightarrow{x^6y^8}$", font_size=96)-+self.add(VGroup(rtarrow0, rtarrow1).arrange(DOWN))@@ -339,8 +339,8 @@ as the ``mathtt`` math-text type or the ``looparrowright`` arrow.tex = Tex(r'$\mathtt{H} \looparrowright$ \LaTeX', font_size=144)self.add(tex)-On the Manim side, the :class:`~.Tex` class also accepts attributes to-change the appearance of the output. This is very similar to the+On the Manim side, the :class:`~.Tex` class also accepts attributes to+change the appearance of the output. This is very similar to the:class:`~.Text` class. For example, the ``color`` keyword changes thecolor of the TeX mobject.@@ -355,7 +355,7 @@ color of the TeX mobject.Extra LaTeX Packages====================-Some commands require special packages to be loaded into the TeX template.+Some commands require special packages to be loaded into the TeX template.For example, to use the ``mathscr`` script, we need to add the ``mathrsfs``package. Since this package isn't loaded into Manim's tex template by default,we have to add it manually.@@ -401,7 +401,7 @@ the Tex, not just the specific symbol or Tex expression. Consider the followingequation.set_color_by_tex("x", YELLOW)self.add(equation)-As you can see, this colors the entire equation yellow, contrary to what+As you can see, this colors the entire equation yellow, contrary to whatmay be expected. To color only ``x`` yellow, we have to do the following:.. manim:: CorrectLaTeXSubstringColoring@@ -417,8 +417,8 @@ may be expected. To color only ``x`` yellow, we have to do the following:self.add(equation)By setting ``substrings_to_isolate`` to ``x``, we split up the-:class:`~.MathTex` into substrings automatically and isolate the ``x`` components-into individual substrings. Only then can :meth:`~.set_color_by_tex` be used+:class:`~.MathTex` into substrings automatically and isolate the ``x`` components+into individual substrings. Only then can :meth:`~.set_color_by_tex` be usedto achieve the desired result.Note that Manim also supports a custom syntax that allows splitting@@ -432,9 +432,9 @@ to write using :class:`~.TransformMatchingTex`.LaTeX Maths Fonts - The Template Library========================================-Changing fonts in LaTeX when typesetting mathematical formulae is+Changing fonts in LaTeX when typesetting mathematical formulae istrickier than regular text. It requires changing the template that is used-to compile the TeX. Manim comes with a collection of :class:`~.TexFontTemplates`+to compile the TeX. Manim comes with a collection of :class:`~.TexFontTemplates`ready for you to use. These templates will all work in math mode:.. manim:: LaTeXMathFonts@@ -445,11 +445,11 @@ ready for you to use. These templates will all work in math mode:tex = Tex(r'$x^2 + y^2 = z^2$', tex_template=TexFontTemplates.french_cursive, font_size=144)self.add(tex)-Manim also has a :class:`~.TexTemplateLibrary` containing the TeX+Manim also has a :class:`~.TexTemplateLibrary` containing the TeXtemplates used by 3Blue1Brown. One example is the ctex template,used for typesetting Chinese script. For this to work, the ctex LaTeX package-must be installed on your system. Furthermore, if you are only-typesetting Text, you probably do not need :class:`~.Tex` at all, and+must be installed on your system. Furthermore, if you are only+typesetting Text, you probably do not need :class:`~.Tex` at all, andshould use :class:`~.Text` instead... manim:: LaTeXTemplateLibrary@@ -465,7 +465,7 @@ Aligning formulae=================:class:`~.MathTex` mobject is typeset in the LaTeX ``align*``-environment. This means you can use the ``&`` alignment character+environment. This means you can use the ``&`` alignment characterwhen typesetting multiline formulae:.. manim:: LaTeXAlignEnvironmentdiff --git a/example_scenes/advanced_tex_fonts.py b/example_scenes/advanced_tex_fonts.pyindex e0d9f527f..63edb0603 100644--- a/example_scenes/advanced_tex_fonts.py+++ b/example_scenes/advanced_tex_fonts.py@@ -13,7 +13,7 @@ TemplateForFrenchCursive = TexTemplate(\usepackage[default]{frcursive}\usepackage[eulergreek,noplusnominus,noequal,nohbar,%nolessnomore,noasterisk]{mathastext}-"""+""",)@@ -33,9 +33,9 @@ class TexFontTemplateManual(Scene):self.play(Create(Tex(- "See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html"- ).shift(2 * DOWN)- )+ "See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html",+ ).shift(2 * DOWN),+ ),)self.wait(2)@@ -132,8 +132,8 @@ class TexFontTemplateLibrary(Scene):self.play(Create(Tex(- "See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html"- ).shift(2 * DOWN)- )+ "See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html",+ ).shift(2 * DOWN),+ ),)self.wait(2)diff --git a/example_scenes/basic.py b/example_scenes/basic.pyindex b6c5f5188..7a46808c1 100644--- a/example_scenes/basic.py+++ b/example_scenes/basic.py@@ -46,7 +46,7 @@ class OpeningManim(Scene):self.wait()grid_transform_title = Tex(- r"That was a non-linear function \\ applied to the grid"+ r"That was a non-linear function \\ applied to the grid",)grid_transform_title.move_to(grid_title, UL)grid.prepare_for_nonlinear_transform()@@ -58,8 +58,8 @@ class OpeningManim(Scene):np.sin(p[1]),np.sin(p[0]),0,- ]- )+ ],+ ),),run_time=3,)@@ -86,8 +86,9 @@ class WarpSquare(Scene):square = Square()self.play(ApplyPointwiseFunction(- lambda point: complex_to_R3(np.exp(R3_to_complex(point))), square- )+ lambda point: complex_to_R3(np.exp(R3_to_complex(point))),+ square,+ ),)self.wait()diff --git a/example_scenes/manim.cfg b/example_scenes/manim.cfgindex 02ca266bb..227bcde46 100644--- a/example_scenes/manim.cfg+++ b/example_scenes/manim.cfg@@ -8,8 +8,7 @@ logging_level_info = dim greenlogging_level_warning = dim redlogging_level_error = redlogging_level_critical = red-log_level =+log_level =log_time = dim yellowlog_message = greenlog_path = dim-diff --git a/example_scenes/opengl.py b/example_scenes/opengl.pyindex a6fdfba64..864e93ccd 100644--- a/example_scenes/opengl.py+++ b/example_scenes/opengl.py@@ -41,7 +41,7 @@ def get_plane_mesh(context):[-1, 0, -1, 1],[1, 0, -1, 1],[1, 0, 1, 1],- ]+ ],)attributes["in_color"] = np.array([@@ -66,7 +66,7 @@ def get_plane_mesh(context):[0, 0, 1, 1],[0, 0, 1, 1],[0, 0, 1, 1],- ]+ ],)return Mesh(shader, attributes)@@ -95,7 +95,8 @@ class GuiTest(Scene):def update_mesh(mesh, dt):mesh.model_matrix = np.matmul(- opengl.rotation_matrix(z=dt), mesh.model_matrix+ opengl.rotation_matrix(z=dt),+ mesh.model_matrix,)mesh.add_updater(update_mesh)@@ -124,7 +125,7 @@ class GuiTest2(Scene):"min_value": 0,"max_value": 1,"default_value": 1,- }+ },)self.interactive_embed()@@ -145,7 +146,8 @@ class ThreeDMobjectTest(Scene):def update_mesh(mesh, dt):mesh.model_matrix = np.matmul(- opengl.rotation_matrix(z=dt), mesh.model_matrix+ opengl.rotation_matrix(z=dt),+ mesh.model_matrix,)mesh.add_updater(update_mesh)@@ -157,7 +159,8 @@ class NamedFullScreenQuad(Scene):def construct(self):surface = FullScreenQuad(self.renderer.context, fragment_shader_name="design_3")surface.shader.set_uniform(- "u_resolution", (config["pixel_width"], config["pixel_height"], 0.0)+ "u_resolution",+ (config["pixel_width"], config["pixel_height"], 0.0),)surface.shader.set_uniform("u_time", 0)self.add(surface)@@ -219,7 +222,8 @@ class InlineFullScreenQuad(Scene):""",)surface.shader.set_uniform(- "u_resolution", (config["pixel_width"], config["pixel_height"])+ "u_resolution",+ (config["pixel_width"], config["pixel_height"]),)shader_time = 0@@ -322,7 +326,8 @@ class InlineShaderExample(Scene):)shader.set_uniform("u_model_view_matrix", opengl.view_matrix())shader.set_uniform(- "u_projection_matrix", opengl.orthographic_projection_matrix()+ "u_projection_matrix",+ opengl.orthographic_projection_matrix(),)attributes = np.zeros(@@ -340,7 +345,7 @@ class InlineShaderExample(Scene):[-1, -1, 0, 1],[1, -1, 0, 1],[1, 1, 0, 1],- ]+ ],)attributes["in_color"] = np.array([@@ -350,7 +355,7 @@ class InlineShaderExample(Scene):[0, 0, 1, 1],[0, 0, 1, 1],[0, 0, 1, 1],- ]+ ],)mesh = Mesh(shader, attributes)self.add(mesh)@@ -367,7 +372,8 @@ class NamedShaderExample(Scene):view_matrix = self.camera.get_view_matrix()shader.set_uniform("u_model_view_matrix", view_matrix)shader.set_uniform(- "u_projection_matrix", opengl.perspective_projection_matrix()+ "u_projection_matrix",+ opengl.perspective_projection_matrix(),)attributes = np.zeros(6,@@ -383,7 +389,7 @@ class NamedShaderExample(Scene):[-1, -1, 0, 1],[1, -1, 0, 1],[1, 1, 0, 1],- ]+ ],)mesh = Mesh(shader, attributes)self.add(mesh)diff --git a/manim/__init__.py b/manim/__init__.pyindex 1389e7b2d..12f677f56 100644--- a/manim/__init__.py+++ b/manim/__init__.py@@ -1,6 +1,5 @@#!/usr/bin/env python-# flake8: noqaimport pkg_resourcesdiff --git a/manim/_config/__init__.py b/manim/_config/__init__.pyindex f534441d7..6ebe48fa0 100644--- a/manim/_config/__init__.py+++ b/manim/_config/__init__.py@@ -23,7 +23,8 @@ parser = make_config_parser()# Throughout the codebase, use manim.console.print() instead of print().# Use error_console to print errors so that it outputs to stderr.logger, console, error_console = make_logger(- parser["logger"], parser["CLI"]["verbosity"]+ parser["logger"],+ parser["CLI"]["verbosity"],)# TODO: temporary to have a clean terminal output when working with PIL or matplotliblogging.getLogger("PIL").setLevel(logging.INFO)diff --git a/manim/_config/default.cfg b/manim/_config/default.cfgindex d62dc0def..976d2ba56 100644--- a/manim/_config/default.cfg+++ b/manim/_config/default.cfg@@ -116,7 +116,7 @@ fullscreen = Falsewindow_position = UR# Manually adjust the size of the window, or use default to automatically scale the window based on-# the dimensions of the monitor.+# the dimensions of the monitor.# --window_sizewindow_size = default@@ -150,7 +150,7 @@ tex_template =# specify the plugins as comma separated values# manim will load that plugin if it specified here.-plugins =+plugins =# Overrides the default output folders, NOT the output file names. Note that# if the custom_folders flag is present, the Tex and text files will not be putdiff --git a/manim/_config/logger_utils.py b/manim/_config/logger_utils.pyindex effa61c00..6301017df 100644--- a/manim/_config/logger_utils.py+++ b/manim/_config/logger_utils.py@@ -49,7 +49,8 @@ Loading the default color configuration.[/logging.level.error]def make_logger(- parser: configparser.ConfigParser, verbosity: str+ parser: configparser.ConfigParser,+ verbosity: str,) -> typing.Tuple[logging.Logger, Console]:"""Make the manim logger and console.@@ -88,7 +89,8 @@ def make_logger(# set the rich handlerRichHandler.KEYWORDS = HIGHLIGHTED_KEYWORDSrich_handler = RichHandler(- console=console, show_time=parser.getboolean("log_timestamps")+ console=console,+ show_time=parser.getboolean("log_timestamps"),)# finally, the logger@@ -130,7 +132,7 @@ def parse_theme(parser: configparser.ConfigParser) -> Theme:k: vfor k, v in theme.items()if k not in ["log.width", "log.height", "log.timestamps"]- }+ },)except (color.ColorParseError, errors.StyleSyntaxError):printf(WRONG_COLOR_CONFIG_MSG)@@ -201,5 +203,5 @@ class JSONFormatter(logging.Formatter):"levelname": record_c.levelname,"module": record_c.module,"message": super().format(record_c),- }+ },)diff --git a/manim/_config/utils.py b/manim/_config/utils.pyindex fdbc5e3f0..371a530fe 100644--- a/manim/_config/utils.py+++ b/manim/_config/utils.py@@ -445,18 +445,18 @@ class ManimConfig(MutableMapping):self._d[key] = valelse:raise ValueError(- f"{key} must be an integer such that {lo} <= {key} <= {hi}"+ f"{key} must be an integer such that {lo} <= {key} <= {hi}",)def _set_pos_number(self, key: str, val: int, allow_inf: bool) -> None:"""Set ``key`` to ``val`` if ``val`` is a positive integer."""if isinstance(val, int) and val > -1:self._d[key] = val- elif allow_inf and (val == -1 or val == float("inf")):+ elif allow_inf and val in [-1, float("inf")]:self._d[key] = float("inf")else:raise ValueError(- f"{key} must be a non-negative integer (use -1 for infinity)"+ f"{key} must be a non-negative integer (use -1 for infinity)",)def __repr__(self) -> str:@@ -696,9 +696,8 @@ class ManimConfig(MutableMapping):self[key] = attr# dry_run is special because it can only be set to True- if hasattr(args, "dry_run"):- if getattr(args, "dry_run"):- self["dry_run"] = True+ if getattr(args, "dry_run", False):+ self["dry_run"] = Truefor key in ["media_dir", # always set this one first@@ -723,7 +722,7 @@ class ManimConfig(MutableMapping):self.upto_animation_number = nflag[1]except Exception:logging.getLogger("manim").info(- f"No end scene number specified in -n option. Rendering from {nflag[0]} onwards..."+ f"No end scene number specified in -n option. Rendering from {nflag[0]} onwards...",)# Handle the quality flags@@ -759,10 +758,9 @@ class ManimConfig(MutableMapping):if args.tex_template:self.tex_template = TexTemplateFromFile(tex_filename=args.tex_template)- if self.renderer == "opengl":- if getattr(args, "write_to_movie") is None:- # --write_to_movie was not passed on the command line, so don't generate video.- self["write_to_movie"] = False+ if self.renderer == "opengl" and getattr(args, "write_to_movie") is None:+ # --write_to_movie was not passed on the command line, so don't generate video.+ self["write_to_movie"] = False# Handle --gui_location flag.if getattr(args, "gui_location") is not None:@@ -827,7 +825,9 @@ class ManimConfig(MutableMapping):progress_bar = property(lambda self: self._d["progress_bar"],lambda self, val: self._set_from_list(- "progress_bar", val, ["none", "display", "leave"]+ "progress_bar",+ val,+ ["none", "display", "leave"],),doc="Whether to show progress bars while rendering animations.",)@@ -912,13 +912,15 @@ class ManimConfig(MutableMapping):)if self.format == "webm":logging.getLogger("manim").warning(- "Output format set as webm, this can be slower than other formats"+ "Output format set as webm, this can be slower than other formats",)ffmpeg_loglevel = property(lambda self: self._d["ffmpeg_loglevel"],lambda self, val: self._set_from_list(- "ffmpeg_loglevel", val, ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]+ "ffmpeg_loglevel",+ val,+ ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],),doc="Verbosity level of ffmpeg (no flag).",)@@ -1052,7 +1054,9 @@ class ManimConfig(MutableMapping):movie_file_extension = property(lambda self: self._d["movie_file_extension"],lambda self, val: self._set_from_list(- "movie_file_extension", val, [".mp4", ".mov", ".webm"]+ "movie_file_extension",+ val,+ [".mp4", ".mov", ".webm"],),doc="Either .mp4, .webm or .mov.",)@@ -1125,7 +1129,7 @@ class ManimConfig(MutableMapping):"It is unclear what it means to set dry_run to ""False. Instead, try setting each option ""individually. (write_to_movie, write_all, "- "save_last_frame, save_pngs, or save_as_gif)"+ "save_last_frame, save_pngs, or save_as_gif)",)@property@@ -1401,7 +1405,7 @@ class ManimConfig(MutableMapping):raise KeyError("must pass one of ""{media,video,images,text,tex,log}_dir "- "or {input,output}_file"+ "or {input,output}_file",)dirs.remove(key) # a path cannot contain itself@@ -1418,7 +1422,7 @@ class ManimConfig(MutableMapping):raise KeyError(f"{key} {self._d[key]} requires the following "+ "keyword arguments: "- + " ".join(exc.args)+ + " ".join(exc.args),) from excreturn Path(path) if path else None@@ -1520,7 +1524,7 @@ class ManimConfig(MutableMapping):if val:if not os.access(val, os.R_OK):logging.getLogger("manim").warning(- f"Custom TeX template {val} not found or not readable."+ f"Custom TeX template {val} not found or not readable.",)else:self._d["tex_template_file"] = Path(val)diff --git a/manim/animation/animation.py b/manim/animation/animation.pyindex 7ecb2d6bb..e37ac98af 100644--- a/manim/animation/animation.py+++ b/manim/animation/animation.py@@ -108,7 +108,7 @@ class Animation:logger.debug(f"The {cls.__name__} animation has been is overridden for "f"{type(mobject).__name__} mobjects. use_override = False can "- f" be used as keyword argument to prevent animation overriding."+ f" be used as keyword argument to prevent animation overriding.",)return animreturn super().__new__(cls)@@ -141,7 +141,7 @@ class Animation:("CONFIG has been removed from ManimCommunity.","Please use keyword arguments instead.",- )+ ),)def _typecheck_input(self, mobject: Union[Mobject, None]) -> None:@@ -418,7 +418,7 @@ class Animation:def prepare_animation(- anim: Union["Animation", "mobject._AnimationBuilder"]+ anim: Union["Animation", "mobject._AnimationBuilder"],) -> "Animation":r"""Returns either an unchanged animation, or the animation builtfrom a passed animation factory.diff --git a/manim/animation/composition.py b/manim/animation/composition.pyindex ec23a4fc8..8c444cd63 100644--- a/manim/animation/composition.py+++ b/manim/animation/composition.py@@ -37,7 +37,7 @@ class AnimationGroup(Animation):self.group = groupif self.group is None:mobjects = remove_list_redundancies(- [anim.mobject for anim in self.animations]+ [anim.mobject for anim in self.animations],)if config["renderer"] == "opengl":self.group = OpenGLGroup(*mobjects)diff --git a/manim/animation/creation.py b/manim/animation/creation.pyindex 137d86650..83ddc54d3 100644--- a/manim/animation/creation.py+++ b/manim/animation/creation.py@@ -121,7 +121,10 @@ class ShowPartial(Animation):super().__init__(mobject, **kwargs)def interpolate_submobject(- self, submobject: Mobject, starting_submobject: Mobject, alpha: float+ self,+ submobject: Mobject,+ starting_submobject: Mobject,+ alpha: float,) -> None:submobject.pointwise_become_partial(starting_submobject, *self._get_bounds(alpha)@@ -254,7 +257,11 @@ class DrawBorderThenFill(Animation):return [*super().get_all_mobjects(), self.outline]def interpolate_submobject(- self, submobject: Mobject, starting_submobject: Mobject, outline, alpha: float+ self,+ submobject: Mobject,+ starting_submobject: Mobject,+ outline,+ alpha: float,) -> None: # Fixme: not matching the parent class? What is outline doing here?index: intsubalpha: int@@ -294,7 +301,9 @@ class Write(DrawBorderThenFill):run_time: Optional[float] = kwargs.pop("run_time", None)lag_ratio: Optional[float] = kwargs.pop("lag_ratio", None)run_time, lag_ratio = self._set_default_config_from_length(- vmobject, run_time, lag_ratio+ vmobject,+ run_time,+ lag_ratio,)self.reverse = reversesuper().__init__(@@ -374,7 +383,9 @@ class Unwrite(Write):run_time: Optional[float] = kwargs.pop("run_time", None)lag_ratio: Optional[float] = kwargs.pop("lag_ratio", None)run_time, lag_ratio = self._set_default_config_from_length(- vmobject, run_time, lag_ratio+ vmobject,+ run_time,+ lag_ratio,)super().__init__(vmobject,diff --git a/manim/animation/indication.py b/manim/animation/indication.pyindex 8a7beaeb1..5de30a048 100644--- a/manim/animation/indication.py+++ b/manim/animation/indication.py@@ -464,7 +464,10 @@ class ApplyWave(Homotopy):return (1 - 2 * wave_func(t * ripples)) * (1 - 2 * ((phase) % 2))def homotopy(- x: float, y: float, z: float, t: float+ x: float,+ y: float,+ z: float,+ t: float,) -> Tuple[float, float, float]:upper = interpolate(0, 1 + time_width, t)lower = upper - time_width@@ -536,7 +539,10 @@ class Wiggle(Animation):return self.mobject.get_center()def interpolate_submobject(- self, submobject: "Mobject", starting_submobject: "Mobject", alpha: float+ self,+ submobject: "Mobject",+ starting_submobject: "Mobject",+ alpha: float,) -> None:submobject.points[:, :] = starting_submobject.pointssubmobject.scale(@@ -606,11 +612,15 @@ class Circumscribe(Succession):):if shape is Rectangle:frame = SurroundingRectangle(- mobject, color, buff, stroke_width=stroke_width+ mobject,+ color,+ buff,+ stroke_width=stroke_width,)elif shape is Circle:frame = Circle(color=color, stroke_width=stroke_width).surround(- mobject, buffer_factor=1+ mobject,+ buffer_factor=1,)radius = frame.width / 2frame.scale((radius + buff) / radius)diff --git a/manim/animation/movement.py b/manim/animation/movement.pyindex 2f7c40e7e..0c2c4f5b7 100644--- a/manim/animation/movement.py+++ b/manim/animation/movement.py@@ -42,7 +42,10 @@ class Homotopy(Animation):return lambda p: self.homotopy(*p, t)def interpolate_submobject(- self, submobject: "Mobject", starting_submobject: "Mobject", alpha: float+ self,+ submobject: "Mobject",+ starting_submobject: "Mobject",+ alpha: float,) -> None:submobject.points = starting_submobject.pointssubmobject.apply_function(@@ -52,7 +55,10 @@ class Homotopy(Animation):class SmoothedVectorizedHomotopy(Homotopy):def interpolate_submobject(- self, submobject: "Mobject", starting_submobject: "Mobject", alpha: float+ self,+ submobject: "Mobject",+ starting_submobject: "Mobject",+ alpha: float,) -> None:Homotopy.interpolate_submobject(self, submobject, starting_submobject, alpha)submobject.make_smooth()@@ -67,7 +73,10 @@ class ComplexHomotopy(Homotopy):"""def homotopy(- x: float, y: float, z: float, t: float+ x: float,+ y: float,+ z: float,+ t: float,) -> Tuple[float, float, float]:c = complex_homotopy(complex(x, y), t)return (c.real, c.imag, z)diff --git a/manim/animation/transform.py b/manim/animation/transform.pyindex 6af46a8f4..fda24b959 100644--- a/manim/animation/transform.py+++ b/manim/animation/transform.py@@ -83,7 +83,8 @@ class Transform(Animation):def path_func(self,) -> Callable[- [Iterable[np.ndarray], Iterable[np.ndarray], float], Iterable[np.ndarray]+ [Iterable[np.ndarray], Iterable[np.ndarray], float],+ Iterable[np.ndarray],]:return self._path_func@@ -91,7 +92,8 @@ class Transform(Animation):def path_func(self,path_func: Callable[- [Iterable[np.ndarray], Iterable[np.ndarray], float], Iterable[np.ndarray]+ [Iterable[np.ndarray], Iterable[np.ndarray], float],+ Iterable[np.ndarray],],) -> None:if path_func is not None:@@ -245,7 +247,7 @@ class MoveToTarget(Transform):def check_validity_of_input(self, mobject: Mobject) -> None:if not hasattr(mobject, "target"):raise ValueError(- "MoveToTarget called on mobject" "without attribute 'target'"+ "MoveToTarget called on mobject" "without attribute 'target'",)@@ -276,7 +278,7 @@ class ApplyMethod(Transform):if not inspect.ismethod(method):raise ValueError("Whoops, looks like you accidentally invoked "- "the method you want to animate"+ "the method you want to animate",)assert isinstance(method.__self__, (Mobject, OpenGLMobject))@@ -364,7 +366,7 @@ class ApplyFunction(Transform):target = self.function(self.mobject.copy())if not isinstance(target, (Mobject, OpenGLMobject)):raise TypeError(- "Functions passed to ApplyFunction must return object of type Mobject"+ "Functions passed to ApplyFunction must return object of type Mobject",)return targetdiff --git a/manim/animation/transform_matching_parts.py b/manim/animation/transform_matching_parts.pyindex 7906841bb..971b66b0e 100644--- a/manim/animation/transform_matching_parts.py+++ b/manim/animation/transform_matching_parts.py@@ -111,7 +111,7 @@ class TransformMatchingAbstractBase(AnimationGroup):target_map.pop(key2, None)if len(key_mapped_source) > 0:anims.append(- FadeTransformPieces(key_mapped_source, key_mapped_target, **kwargs)+ FadeTransformPieces(key_mapped_source, key_mapped_target, **kwargs),)fade_source = group_type()@@ -130,7 +130,7 @@ class TransformMatchingAbstractBase(AnimationGroup):else:anims.append(FadeOut(fade_source, target_position=fade_target, **kwargs))anims.append(- FadeIn(fade_target.copy(), target_position=fade_target, **kwargs)+ FadeIn(fade_target.copy(), target_position=fade_target, **kwargs),)super().__init__(*anims)diff --git a/manim/camera/camera.py b/manim/camera/camera.pyindex 0ec36833e..41df1e2b7 100644--- a/manim/camera/camera.py+++ b/manim/camera/camera.py@@ -249,10 +249,12 @@ class Camera:self.background = self.background.astype(self.pixel_array_dtype)else:background_rgba = color_to_int_rgba(- self.background_color, self.background_opacity+ self.background_color,+ self.background_opacity,)self.background = np.zeros(- (height, width, self.n_channels), dtype=self.pixel_array_dtype+ (height, width, self.n_channels),+ dtype=self.pixel_array_dtype,)self.background[:, :] = background_rgba@@ -345,6 +347,7 @@ class Camera:coords_to_colors_func : functionThe function whose input is an (x,y) pair of coordinates andwhose return values must be the colors for that point+Returns-------np.array@@ -396,7 +399,10 @@ class Camera:####def get_mobjects_to_display(- self, mobjects, include_submobjects=True, excluded_mobjects=None+ self,+ mobjects,+ include_submobjects=True,+ excluded_mobjects=None,):"""Used to get the list of mobjects to displaywith the camera.@@ -417,11 +423,14 @@ class Camera:"""if include_submobjects:mobjects = extract_mobject_family_members(- mobjects, use_z_index=self.use_z_index, only_those_with_points=True+ mobjects,+ use_z_index=self.use_z_index,+ only_those_with_points=True,)if excluded_mobjects:all_excluded = extract_mobject_family_members(- excluded_mobjects, use_z_index=self.use_z_index+ excluded_mobjects,+ use_z_index=self.use_z_index,)mobjects = list_difference_update(mobjects, all_excluded)return mobjects@@ -546,7 +555,10 @@ class Camera:fh = self.frame_heightfc = self.frame_centersurface = cairo.ImageSurface.create_for_data(- pixel_array, cairo.FORMAT_ARGB32, pw, ph+ pixel_array,+ cairo.FORMAT_ARGB32,+ pw,+ ph,)ctx = cairo.Context(surface)ctx.scale(pw, ph)@@ -558,7 +570,7 @@ class Camera:-fdiv(ph, fh),(pw / 2) - fc[0] * fdiv(pw, fw),(ph / 2) + fc[1] * fdiv(ph, fh),- )+ ),)self.cache_cairo_context(pixel_array, ctx)return ctx@@ -581,7 +593,8 @@ class Camera:self.display_multiple_background_colored_vmobjects(batch, pixel_array)else:self.display_multiple_non_background_colored_vmobjects(- batch, pixel_array+ batch,+ pixel_array,)def display_multiple_non_background_colored_vmobjects(self, vmobjects, pixel_array):@@ -648,7 +661,7 @@ class Camera:ctx.new_sub_path()start = subpath[0]ctx.move_to(*start[:2])- for p0, p1, p2, p3 in quads:+ for _p0, p1, p2, p3 in quads:ctx.curve_to(*p1[:2], *p2[:2], *p3[:2])if vmobject.consider_points_equals_2d(subpath[0], subpath[-1]):ctx.close_path()@@ -727,13 +740,15 @@ class Camera:if width == 0:return selfself.set_cairo_context_color(- ctx, self.get_stroke_rgbas(vmobject, background=background), vmobject+ ctx,+ self.get_stroke_rgbas(vmobject, background=background),+ vmobject,)ctx.set_line_width(width* self.cairo_line_width_multiple# This ensures lines have constant width as you zoom in on them.- * (self.frame_width / self.frame_width)+ * (self.frame_width / self.frame_width),)ctx.stroke_preserve()return self@@ -847,6 +862,7 @@ class Camera:The thickness of each point of the PMobjectpixel_array : np.arrayThe pixel array to modify.+"""if len(points) == 0:return@@ -910,7 +926,8 @@ class Camera:pixel_width = max(int(pdist([ul_coords, ur_coords])), 1)pixel_height = max(int(pdist([ul_coords, dl_coords])), 1)sub_image = sub_image.resize(- (pixel_width, pixel_height), resample=image_mobject.resampling_algorithm+ (pixel_width, pixel_height),+ resample=image_mobject.resampling_algorithm,)# Rotate@@ -918,14 +935,17 @@ class Camera:adjusted_angle = -int(360 * angle / TAU)if adjusted_angle != 0:sub_image = sub_image.rotate(- adjusted_angle, resample=image_mobject.resampling_algorithm, expand=1+ adjusted_angle,+ resample=image_mobject.resampling_algorithm,+ expand=1,)# TODO, there is no accounting for a shear...# Paste into an image as large as the camera's pixel arrayfull_image = Image.fromarray(- np.zeros((self.pixel_height, self.pixel_width)), mode="RGBA"+ np.zeros((self.pixel_height, self.pixel_width)),+ mode="RGBA",)new_ul_coords = center_coords - np.array(sub_image.size) / 2new_ul_coords = new_ul_coords.astype(int)@@ -964,7 +984,8 @@ class Camera:The Image to overlay."""pixel_array[:, :] = np.array(- Image.alpha_composite(self.get_image(pixel_array), image), dtype="uint8"+ Image.alpha_composite(self.get_image(pixel_array), image),+ dtype="uint8",)def adjust_out_of_range_points(self, points):@@ -988,14 +1009,18 @@ class Camera:violators = points[violator_indices, :]violator_norms = norms[violator_indices]reshaped_norms = np.repeat(- violator_norms.reshape((len(violator_norms), 1)), points.shape[1], 1+ violator_norms.reshape((len(violator_norms), 1)),+ points.shape[1],+ 1,)rescaled = self.max_allowable_norm * violators / reshaped_normspoints[violator_indices] = rescaledreturn pointsdef transform_points_pre_display(- self, mobject, points+ self,+ mobject,+ points,): # TODO: Write more detailed docstrings for this method.# NOTE: There seems to be an unused argument `mobject`.@@ -1008,7 +1033,9 @@ class Camera:return pointsdef points_to_pixel_coords(- self, mobject, points+ self,+ mobject,+ points,): # TODO: Write more detailed docstrings for this method.points = self.transform_points_pre_display(mobject, points)shifted_points = points - self.frame_center@@ -1127,7 +1154,8 @@ class Camera:::-1].transpose(1, 2, 0)uncentered_space_coords = fdiv(- uncentered_pixel_coords * full_space_dims, full_pixel_dims+ uncentered_pixel_coords * full_space_dims,+ full_pixel_dims,)# Could structure above line's computation slightly differently, but figured (without much# thought) multiplying by frame_shape first, THEN dividing by pixel_shape, is probably@@ -1162,7 +1190,11 @@ class BackgroundColoredVMobjectDisplayer:self.pixel_array[:, :] = 0def resize_background_array(- self, background_array, new_width, new_height, mode="RGBA"+ self,+ background_array,+ new_width,+ new_height,+ mode="RGBA",):"""Resizes the pixel array representing the background.@@ -1254,7 +1286,8 @@ class BackgroundColoredVMobjectDisplayer:background_array = self.get_background_array(image)pixel_array = self.pixel_arrayself.camera.display_multiple_non_background_colored_vmobjects(- batch, pixel_array+ batch,+ pixel_array,)new_array = np.array((background_array * pixel_array.astype("float") / 255),diff --git a/manim/camera/mapping_camera.py b/manim/camera/mapping_camera.pyindex 4f014d194..03e92bb67 100644--- a/manim/camera/mapping_camera.py+++ b/manim/camera/mapping_camera.py@@ -32,7 +32,8 @@ class MappingCamera(Camera):def points_to_pixel_coords(self, points):return Camera.points_to_pixel_coords(- self, np.apply_along_axis(self.mapping_func, 1, points)+ self,+ np.apply_along_axis(self.mapping_func, 1, points),)def capture_mobjects(self, mobjects, **kwargs):@@ -74,7 +75,7 @@ class OldMultiCamera(Camera):+ camera_with_start_positions[0].pixel_width,"end_y": camera_with_start_positions[1][0]+ camera_with_start_positions[0].pixel_height,- }+ },)for camera_with_start_positions in cameras_with_start_positions]diff --git a/manim/camera/three_d_camera.py b/manim/camera/three_d_camera.pyindex eab7b1b2e..fb8a6771e 100644--- a/manim/camera/three_d_camera.py+++ b/manim/camera/three_d_camera.py@@ -121,7 +121,9 @@ class ThreeDCamera(Camera):return rgbasdef get_stroke_rgbas(- self, vmobject, background=False+ self,+ vmobject,+ background=False,): # NOTE : DocStrings From parentreturn self.modified_rgbas(vmobject, vmobject.get_stroke_rgbas(background))@@ -333,7 +335,9 @@ class ThreeDCamera(Camera):return self.project_points(point.reshape((1, 3)))[0, :]def transform_points_pre_display(- self, mobject, points+ self,+ mobject,+ points,): # TODO: Write Docstrings for this Method.points = super().transform_points_pre_display(mobject, points)fixed_orientation = mobject in self.fixed_orientation_mobjectsdiff --git a/manim/camera/webgl_camera.py b/manim/camera/webgl_camera.pyindex 5d07560b5..fdcc0a123 100644--- a/manim/camera/webgl_camera.py+++ b/manim/camera/webgl_camera.py@@ -23,7 +23,7 @@ class WebGLCamera(Camera):"style": vmobject.get_style(simple=True),"id": id(vmobject),"needs_redraw": needs_redraw,- }+ },)def reset(self):diff --git a/manim/cli/cfg/group.py b/manim/cli/cfg/group.pyindex 0d7756c4e..8e6ceb14b 100644--- a/manim/cli/cfg/group.py+++ b/manim/cli/cfg/group.py@@ -138,7 +138,8 @@ def cfg(ctx):def write(level: str = None, openfile: bool = False) -> None:config_paths = config_file_paths()console.print(- "[yellow bold]Manim Configuration File Writer[/yellow bold]", justify="center"+ "[yellow bold]Manim Configuration File Writer[/yellow bold]",+ justify="center",)USER_CONFIG_MSG = f"""A configuration file at [yellow]{config_paths[1]}[/yellow] has been created with your required changes.@@ -182,17 +183,21 @@ To save your config please save that file and place it in your current working draise Exception("""Not enough values in input.You may have added a new entry to default.cfg, in which case you will have to-modify write_cfg_subcmd_input to account for it."""+modify write_cfg_subcmd_input to account for it.""",)if temp:while temp and not _is_expected_datatype(- temp, default[key], bool(style)+ temp,+ default[key],+ bool(style),):console.print(- f"[red bold]Invalid {desc}. Try again.[/red bold]"+ f"[red bold]Invalid {desc}. Try again.[/red bold]",)console.print(- f"Enter the {desc} for {key}:", style=style, end=""+ f"Enter the {desc} for {key}:",+ style=style,+ end="",)temp = input()else:@@ -259,7 +264,7 @@ Are you sure you want to continue? (y/n)""",style="red bold",end="",)- proceed = True if input().lower() == "y" else False+ proceed = input().lower() == "y"else:proceed = Trueif proceed:diff --git a/manim/cli/new/group.py b/manim/cli/new/group.pyindex e93075c09..297a9c01e 100644--- a/manim/cli/new/group.py+++ b/manim/cli/new/group.py@@ -32,7 +32,7 @@ def select_resolution():resolution_options = []for quality in QUALITIES.items():resolution_options.append(- (quality[1]["pixel_height"], quality[1]["pixel_width"])+ (quality[1]["pixel_height"], quality[1]["pixel_width"]),)resolution_options.pop()choice = click.prompt(@@ -100,7 +100,7 @@ def project(default_settings, **args):if project_name.is_dir():console.print(- f"\nFolder [red]{project_name}[/red] exists. Please type another name\n"+ f"\nFolder [red]{project_name}[/red] exists. Please type another name\n",)else:project_name.mkdir()diff --git a/manim/cli/plugins/commands.py b/manim/cli/plugins/commands.pyindex 3d926ca22..b9a70959a 100644--- a/manim/cli/plugins/commands.py+++ b/manim/cli/plugins/commands.py@@ -18,7 +18,11 @@ from ...plugins.plugins_flags import list_pluginshelp="Manages Manim plugins.",)@click.option(- "-l", "--list", "list_available", is_flag=True, help="List available plugins."+ "-l",+ "--list",+ "list_available",+ is_flag=True,+ help="List available plugins.",)def plugins(list_available):if list_available:diff --git a/manim/cli/render/commands.py b/manim/cli/render/commands.pyindex cd065d9d3..d40da4735 100644--- a/manim/cli/render/commands.py+++ b/manim/cli/render/commands.py@@ -44,13 +44,13 @@ def render(if args["use_opengl_renderer"]:logger.warning(- "--use_opengl_renderer is deprecated, please use --renderer=opengl instead!"+ "--use_opengl_renderer is deprecated, please use --renderer=opengl instead!",)args["renderer"] = "opengl"if args["use_webgl_renderer"]:logger.warning(- "--use_webgl_renderer is deprecated, please use --renderer=webgl instead!"+ "--use_webgl_renderer is deprecated, please use --renderer=webgl instead!",)args["renderer"] = "webgl"@@ -68,7 +68,7 @@ def render(if args["show_in_file_browser"]:logger.warning(- "The short form of show_in_file_browser is deprecated and will be moved to support --format."+ "The short form of show_in_file_browser is deprecated and will be moved to support --format.",)class ClickArgs:@@ -124,7 +124,7 @@ def render(except ModuleNotFoundError:console.print("Dependencies for the WebGL render are missing. Run "- "pip install manim[webgl_renderer] to install them."+ "pip install manim[webgl_renderer] to install them.",)error_console.print_exception()sys.exit(1)@@ -149,10 +149,10 @@ def render(stable = req_info.json()["info"]["version"]if stable != __version__:console.print(- f"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available."+ f"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available.",)console.print(- "You should consider upgrading via [yellow]pip install -U manim[/yellow]"+ "You should consider upgrading via [yellow]pip install -U manim[/yellow]",)except requests.exceptions.HTTPError:logger.debug(f"HTTP Error: {warn_prompt}")diff --git a/manim/cli/render/output_options.py b/manim/cli/render/output_options.pyindex 079594b7d..69ed56d89 100644--- a/manim/cli/render/output_options.py+++ b/manim/cli/render/output_options.py@@ -30,7 +30,10 @@ output_options = option_group(help="Path to store rendered videos and latex.",),option(- "--log_dir", type=click.Path(), help="Path to store render logs.", default=None+ "--log_dir",+ type=click.Path(),+ help="Path to store render logs.",+ default=None,),option("--log_to_file",diff --git a/manim/grpc/gen/frameserver_pb2.py b/manim/grpc/gen/frameserver_pb2.pyindex 777826de0..c226411e5 100644--- a/manim/grpc/gen/frameserver_pb2.py+++ b/manim/grpc/gen/frameserver_pb2.py@@ -1417,7 +1417,7 @@ FetchSceneDataResponse = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _FETCHSCENEDATARESPONSE,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.FetchSceneDataResponse)},)@@ -1428,7 +1428,7 @@ Scene = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _SCENE,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Scene)},)@@ -1443,7 +1443,7 @@ Animation = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _ANIMATION_ATTRIBUTETWEENDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Animation.AttributeTweenData)},),@@ -1452,12 +1452,12 @@ Animation = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _ANIMATION_MOBJECTTWEENDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Animation.MobjectTweenData)},),"DESCRIPTOR": _ANIMATION,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Animation)},)@@ -1470,7 +1470,7 @@ Updater = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _UPDATER,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Updater)},)@@ -1481,7 +1481,7 @@ FrameRequest = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _FRAMEREQUEST,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.FrameRequest)},)@@ -1492,7 +1492,7 @@ Style = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _STYLE,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Style)},)@@ -1503,7 +1503,7 @@ Point = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _POINT,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.Point)},)@@ -1514,7 +1514,7 @@ MobjectData = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _MOBJECTDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.MobjectData)},)@@ -1525,7 +1525,7 @@ VMobjectData = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _VMOBJECTDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.VMobjectData)},)@@ -1536,7 +1536,7 @@ ImageMobjectData = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _IMAGEMOBJECTDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.ImageMobjectData)},)@@ -1547,7 +1547,7 @@ FrameData = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _FRAMEDATA,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.FrameData)},)@@ -1558,7 +1558,7 @@ FrameResponse = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _FRAMERESPONSE,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.FrameResponse)},)@@ -1569,7 +1569,7 @@ EmptyRequest = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _EMPTYREQUEST,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.EmptyRequest)},)@@ -1580,7 +1580,7 @@ EmptyResponse = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _EMPTYRESPONSE,- "__module__": "frameserver_pb2"+ "__module__": "frameserver_pb2",# @@protoc_insertion_point(class_scope:frameserver.EmptyResponse)},)diff --git a/manim/grpc/gen/frameserver_pb2_grpc.py b/manim/grpc/gen/frameserver_pb2_grpc.pyindex 0d683732c..cdfe6234d 100644--- a/manim/grpc/gen/frameserver_pb2_grpc.py+++ b/manim/grpc/gen/frameserver_pb2_grpc.py@@ -71,7 +71,8 @@ def add_FrameServerServicer_to_server(servicer, server):),}generic_handler = grpc.method_handlers_generic_handler(- "frameserver.FrameServer", rpc_method_handlers+ "frameserver.FrameServer",+ rpc_method_handlers,)server.add_generic_rpc_handlers((generic_handler,))diff --git a/manim/grpc/gen/renderserver_pb2.py b/manim/grpc/gen/renderserver_pb2.pyindex f37653bee..aad9d3b11 100644--- a/manim/grpc/gen/renderserver_pb2.py+++ b/manim/grpc/gen/renderserver_pb2.py@@ -294,7 +294,7 @@ UpdateSceneDataRequest = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _UPDATESCENEDATAREQUEST,- "__module__": "renderserver_pb2"+ "__module__": "renderserver_pb2",# @@protoc_insertion_point(class_scope:renderserver.UpdateSceneDataRequest)},)@@ -305,7 +305,7 @@ Scene = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _SCENE,- "__module__": "renderserver_pb2"+ "__module__": "renderserver_pb2",# @@protoc_insertion_point(class_scope:renderserver.Scene)},)@@ -316,7 +316,7 @@ Animation = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _ANIMATION,- "__module__": "renderserver_pb2"+ "__module__": "renderserver_pb2",# @@protoc_insertion_point(class_scope:renderserver.Animation)},)@@ -327,7 +327,7 @@ EmptyRequest = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _EMPTYREQUEST,- "__module__": "renderserver_pb2"+ "__module__": "renderserver_pb2",# @@protoc_insertion_point(class_scope:renderserver.EmptyRequest)},)@@ -338,7 +338,7 @@ EmptyResponse = _reflection.GeneratedProtocolMessageType((_message.Message,),{"DESCRIPTOR": _EMPTYRESPONSE,- "__module__": "renderserver_pb2"+ "__module__": "renderserver_pb2",# @@protoc_insertion_point(class_scope:renderserver.EmptyResponse)},)diff --git a/manim/grpc/gen/renderserver_pb2_grpc.py b/manim/grpc/gen/renderserver_pb2_grpc.pyindex 02bdd8d24..0c031b8da 100644--- a/manim/grpc/gen/renderserver_pb2_grpc.py+++ b/manim/grpc/gen/renderserver_pb2_grpc.py@@ -39,7 +39,8 @@ def add_RenderServerServicer_to_server(servicer, server):),}generic_handler = grpc.method_handlers_generic_handler(- "renderserver.RenderServer", rpc_method_handlers+ "renderserver.RenderServer",+ rpc_method_handlers,)server.add_generic_rpc_handlers((generic_handler,))diff --git a/manim/grpc/impl/frame_server_impl.py b/manim/grpc/impl/frame_server_impl.pyindex 356048168..b3e4b24eb 100644--- a/manim/grpc/impl/frame_server_impl.py+++ b/manim/grpc/impl/frame_server_impl.py@@ -81,7 +81,8 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):request.first_request or self.previous_scene != requested_scene):previous_mobjects = extract_mobject_family_members(- self.previous_scene.mobjects, only_those_with_points=True+ self.previous_scene.mobjects,+ only_those_with_points=True,)# Remove everything from the previous scene.ids_to_remove = [@@ -95,7 +96,8 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):mobjects_to_add = [serialize_mobject(mobject)for mobject in extract_mobject_family_members(- requested_scene.mobjects, only_those_with_points=True+ requested_scene.mobjects,+ only_those_with_points=True,)if not isinstance(mobject, ValueTracker)]@@ -111,7 +113,8 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):flickered_mobject_ids = [mob.original_idfor mob in extract_mobject_family_members(- animation.mobject, only_those_with_points=True+ animation.mobject,+ only_those_with_points=True,)]else:@@ -119,14 +122,15 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):# Add offset vector to submobjects.root_mobject_center = animation.mobject.get_center()for updated_mobject in extract_mobject_family_members(- animation.mobject, only_those_with_points=True+ animation.mobject,+ only_those_with_points=True,):mobject_tween_data_list.append(frameserver_pb2.Animation.MobjectTweenData(id=updated_mobject.original_id,root_mobject_offset=updated_mobject.get_center()- root_mobject_center,- )+ ),)animation_proto = frameserver_pb2.Animation(name=animation.__class__.__name__,@@ -152,10 +156,11 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):flickered_mobject_ids=[mob.original_idfor mob in extract_mobject_family_members(- updated_mobject, only_those_with_points=True+ updated_mobject,+ only_those_with_points=True,)- ]- )+ ],+ ),)breakelse:@@ -172,10 +177,11 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):[serialize_mobject(mobject)for mobject in extract_mobject_family_members(- animation.mobject, only_those_with_points=True+ animation.mobject,+ only_those_with_points=True,)if not isinstance(mobject, ValueTracker)- ]+ ],)for (updated_mobject,@@ -188,15 +194,18 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):[serialize_mobject(mobject)for mobject in extract_mobject_family_members(- updated_mobject, only_those_with_points=True+ updated_mobject,+ only_those_with_points=True,)if not isinstance(mobject, ValueTracker)- ]+ ],)resp = frameserver_pb2.FrameResponse(frame_data=frameserver_pb2.FrameData(- remove=ids_to_remove, add=mobjects_to_add, update=update_data+ remove=ids_to_remove,+ add=mobjects_to_add,+ update=update_data,),scene_finished=scene_finished,animations=animations,@@ -250,7 +259,8 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):self.exception = Nonetry:self.scene_class = scene_classes_from_file(- self.input_file_path, require_single_scene=True+ self.input_file_path,+ require_single_scene=True,)self.generate_keyframe_data()except Exception as e:@@ -288,10 +298,13 @@ class FrameServer(frameserver_pb2_grpc.FrameServerServicer):request.scene.background_color = "#000000"else:lines = traceback.format_exception(- None, self.exception, self.exception.__traceback__+ None,+ self.exception,+ self.exception.__traceback__,)request = renderserver_pb2.UpdateSceneDataRequest(- has_exception=True, exception="\n".join(lines)+ has_exception=True,+ exception="\n".join(lines),)stub.UpdateSceneData(request)@@ -309,7 +322,7 @@ def generate_attribute_tween_data(animation):attribute="position",start_data=animation.starting_mobject.get_center(),end_data=animation.target_mobject.get_center(),- )+ ),)else:return None@@ -372,7 +385,7 @@ def serialize_mobject(mobject):mob_proto.image_mobject_data.path = mobject.path[len(assets_dir_path) + 1 :]else:logger.info(- f"Expected path {mobject.path} to be under the assets dir ({assets_dir_path})"+ f"Expected path {mobject.path} to be under the assets dir ({assets_dir_path})",)mob_proto.image_mobject_data.height = mobject.heightmob_proto.image_mobject_data.width = mobject.width@@ -386,7 +399,8 @@ def serialize_mobject(mobject):def get(input_file_path):server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))frameserver_pb2_grpc.add_FrameServerServicer_to_server(- FrameServer(server, input_file_path), server+ FrameServer(server, input_file_path),+ server,)server.add_insecure_port("localhost:50051")return serverdiff --git a/manim/grpc/proto/frameserver.proto b/manim/grpc/proto/frameserver.protoindex 400a85075..17151fd3a 100644--- a/manim/grpc/proto/frameserver.proto+++ b/manim/grpc/proto/frameserver.proto@@ -8,7 +8,7 @@ service FrameServer {// Returns a list of the names and durations of all animations in the scene.rpc FetchSceneData (EmptyRequest) returns (FetchSceneDataResponse);-+// Returns when the manim script changesrpc ScriptUpdated (EmptyRequest) returns (EmptyResponse);}diff --git a/manim/gui/gui.py b/manim/gui/gui.pyindex a49ed6a8a..aebc1ef87 100644--- a/manim/gui/gui.py+++ b/manim/gui/gui.py@@ -58,7 +58,8 @@ def configure_pygui(renderer, widgets, update=True):dpg.add_separator()if len(widgets) != 0:with dpg.collapsing_header(- label=f"{config['scene_names'][0]} widgets", default_open=True+ label=f"{config['scene_names'][0]} widgets",+ default_open=True,):for widget_config in widgets:widget_config_copy = widget_config.copy()diff --git a/manim/mobject/changing.py b/manim/mobject/changing.pyindex 91352e5ed..4aad0bebc 100644--- a/manim/mobject/changing.py+++ b/manim/mobject/changing.py@@ -138,7 +138,9 @@ class TracedPath(VMobject, metaclass=ConvertToOpenGL):"""@deprecated_params(- params="min_distance_to_new_point", since="v0.10.0", until="v0.12.0"+ params="min_distance_to_new_point",+ since="v0.10.0",+ until="v0.12.0",)def __init__(self,diff --git a/manim/mobject/coordinate_systems.py b/manim/mobject/coordinate_systems.pyindex 59536cf2d..0ab16e65a 100644--- a/manim/mobject/coordinate_systems.py+++ b/manim/mobject/coordinate_systems.py@@ -302,11 +302,7 @@ class CoordinateSystem:The label."""- if (- isinstance(label_tex, float)- or isinstance(label_tex, int)- or isinstance(label_tex, str)- ):+ if isinstance(label_tex, (float, int, str)):label_tex = MathTex(label_tex)return label_tex@@ -393,7 +389,8 @@ class CoordinateSystem:def add_coordinates(self,*axes_numbers: Union[- Optional[Iterable[float]], Union[Dict[float, Union[str, float, "Mobject"]]]+ Optional[Iterable[float]],+ Union[Dict[float, Union[str, float, "Mobject"]]],],**kwargs,):@@ -992,7 +989,7 @@ class CoordinateSystem:self.coords_to_point(x + width_scale_factor * dx, y_point),graph_point,],- )+ ),))@@ -1085,7 +1082,10 @@ class CoordinateSystem:).set_opacity(opacity=opacity)def angle_of_tangent(- self, x: float, graph: "ParametricFunction", dx: float = 1e-8+ self,+ x: float,+ graph: "ParametricFunction",+ dx: float = 1e-8,) -> float:"""Returns the angle to the x-axis of the tangentto the plotted curve at a particular x-value.@@ -1311,20 +1311,24 @@ class CoordinateSystem:if dx_label is not None:group.dx_label.next_to(- group.dx_line, np.sign(dx) * DOWN, buff=group.dx_label.height / 2+ group.dx_line,+ np.sign(dx) * DOWN,+ buff=group.dx_label.height / 2,)group.dx_label.set_color(group.dx_line.get_color())if dy_label is not None:group.df_label.next_to(- group.df_line, np.sign(dx) * RIGHT, buff=group.df_label.height / 2+ group.df_line,+ np.sign(dx) * RIGHT,+ buff=group.df_label.height / 2,)group.df_label.set_color(group.df_line.get_color())if include_secant_line:group.secant_line = Line(p1, p2, color=secant_line_color)group.secant_line.scale_in_place(- secant_line_length / group.secant_line.get_length()+ secant_line_length / group.secant_line.get_length(),)group.add(group.secant_line)return group@@ -1443,7 +1447,8 @@ class CoordinateSystem:T_label_group = VGroup()triangle = RegularPolygon(n=3, start_angle=np.pi / 2, stroke_width=0).set_fill(- color=triangle_color, opacity=1+ color=triangle_color,+ opacity=1,)triangle.height = triangle_sizetriangle.move_to(self.coords_to_point(x_val, 0), UP)@@ -1453,7 +1458,9 @@ class CoordinateSystem:T_label_group.add(t_label)v_line = self.get_vertical_line(- self.i2gp(x_val, graph), color=line_color, line_func=line_func+ self.i2gp(x_val, graph),+ color=line_color,+ line_func=line_func,)T_label_group.add(triangle, v_line)@@ -1515,10 +1522,12 @@ class Axes(VGroup, CoordinateSystem, metaclass=ConvertToOpenGL):)self.x_axis_config = merge_dicts_recursively(- self.axis_config, self.x_axis_config+ self.axis_config,+ self.x_axis_config,)self.y_axis_config = merge_dicts_recursively(- self.axis_config, self.y_axis_config+ self.axis_config,+ self.y_axis_config,)self.x_axis = self._create_axis(self.x_range, self.x_axis_config, self.x_length)@@ -1832,7 +1841,8 @@ class ThreeDAxes(Axes):self.z_axis_config = {}self._update_default_configs((self.z_axis_config,), (z_axis_config,))self.z_axis_config = merge_dicts_recursively(- self.axis_config, self.z_axis_config+ self.axis_config,+ self.z_axis_config,)self.z_normal = z_normal@@ -1852,7 +1862,7 @@ class ThreeDAxes(Axes):self.add(z_axis)self.z_axis = z_axis- if not config.renderer == "opengl":+ if config.renderer != "opengl":self._add_3d_pieces()self._set_axis_shading()@@ -2299,7 +2309,7 @@ class PolarPlane(Axes):self.azimuth_units = azimuth_unitselse:raise ValueError(- "Invalid azimuth units. Expected one of: PI radians, TAU radians, degrees, gradians or None."+ "Invalid azimuth units. Expected one of: PI radians, TAU radians, degrees, gradians or None.",)if azimuth_direction in ["CW", "CCW"]:@@ -2552,7 +2562,7 @@ class PolarPlane(Axes):self.get_right()[0]* np.sin(d * (i * TAU) + self.azimuth_offset),0,- ]+ ],),}for i in a_values@@ -2560,7 +2570,8 @@ class PolarPlane(Axes):if self.azimuth_units == "PI radians" or self.azimuth_units == "TAU radians":a_tex = [self.get_radian_label(- i["label"], font_size=self.azimuth_label_font_size+ i["label"],+ font_size=self.azimuth_label_font_size,).next_to(i["point"],direction=i["point"],@@ -2598,7 +2609,8 @@ class PolarPlane(Axes):elif self.azimuth_units is None:a_tex = [MathTex(- f'{i["label"]:g}', font_size=self.azimuth_label_font_size+ f'{i["label"]:g}',+ font_size=self.azimuth_label_font_size,).next_to(i["point"],direction=i["point"],diff --git a/manim/mobject/functions.py b/manim/mobject/functions.pyindex 4b8d0e4eb..5c0e3c908 100644--- a/manim/mobject/functions.py+++ b/manim/mobject/functions.py@@ -77,7 +77,8 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):def generate_points(self):discontinuities = filter(- lambda t: self.t_min <= t <= self.t_max, self.discontinuities+ lambda t: self.t_min <= t <= self.t_max,+ self.discontinuities,)discontinuities = np.array(list(discontinuities))boundary_times = np.array(@@ -86,7 +87,7 @@ class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):self.t_max,*(discontinuities - self.dt),*(discontinuities + self.dt),- ]+ ],)boundary_times.sort()for t1, t2 in zip(boundary_times[0::2], boundary_times[1::2]):diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.pyindex e8b934bd3..488680652 100644--- a/manim/mobject/geometry.py+++ b/manim/mobject/geometry.py@@ -179,7 +179,7 @@ class TipableVMobject(VMobject, metaclass=ConvertToOpenGL):anchor = self.get_end()angles = cartesian_to_spherical(handle - anchor)tip.rotate(- angles[2] - PI - tip.tip_angle+ angles[2] - PI - tip.tip_angle,) # Rotates the tip along the azimuthalaxis = [np.sin(angles[2]),@@ -187,7 +187,8 @@ class TipableVMobject(VMobject, metaclass=ConvertToOpenGL):0,] # Obtains the perpendicular of the tiptip.rotate(- -angles[1] + PI / 2, axis=axis+ -angles[1] + PI / 2,+ axis=axis,) # Rotates the tip along the vertical wrt the axistip.shift(anchor - tip.tip_point)return tip@@ -327,7 +328,7 @@ class Arc(TipableVMobject):angle=self.angle,start_angle=self.start_angle,n_components=self.num_components,- )+ ),)self.scale(self.radius, about_point=ORIGIN)self.shift(self.arc_center)@@ -342,7 +343,7 @@ class Arc(TipableVMobject):start_angle + angle,2 * n_components + 1,)- ]+ ],)theta = angle / n_componentssamples[1::2] /= np.cos(theta / 2)@@ -358,9 +359,11 @@ class Arc(TipableVMobject):[np.cos(a) * RIGHT + np.sin(a) * UPfor a in np.linspace(- self.start_angle, self.start_angle + self.angle, self.num_components+ self.start_angle,+ self.start_angle + self.angle,+ self.num_components,)- ]+ ],)# Figure out which control points will give the# Appropriate tangent lines to the circle@@ -441,7 +444,7 @@ class ArcBetweenPoints(Arc):if radius < halfdist:raise ValueError("""ArcBetweenPoints called with a radius that is- smaller than half the distance between the points."""+ smaller than half the distance between the points.""",)arc_height = radius - math.sqrt(radius ** 2 - halfdist ** 2)angle = math.acos((radius - arc_height) / radius) * sign@@ -957,7 +960,10 @@ class Line(TipableVMobject):def generate_points(self):self.set_points_by_ends(- start=self.start, end=self.end, buff=self.buff, path_arc=self.path_arc+ start=self.start,+ end=self.end,+ buff=self.buff,+ path_arc=self.path_arc,)def set_points_by_ends(self, start, end, buff=0, path_arc=0):@@ -1140,7 +1146,8 @@ class DashedLine(Line):**kwargs,):self.dash_spacing = kwargs.pop(- "dash_spacing", None+ "dash_spacing",+ None,) # Unused param, remove with deprecation warningself.dash_length = dash_lengthself.dashed_ratio = dashed_ratio@@ -1166,7 +1173,8 @@ class DashedLine(Line):# Minimum number of dashes has to be 2return max(- 2, int(np.ceil((self.get_length() / self.dash_length) * self.dashed_ratio))+ 2,+ int(np.ceil((self.get_length() / self.dash_length) * self.dashed_ratio)),)def get_start(self) -> np.ndarray:@@ -1557,7 +1565,10 @@ class Vector(Arrow):super().__init__(ORIGIN, direction, buff=buff, **kwargs)def coordinate_label(- self, integer_labels: bool = True, n_dim: int = 2, color: str = WHITE+ self,+ integer_labels: bool = True,+ n_dim: int = 2,+ color: str = WHITE,):"""Creates a label based on the coordinates of the vector.@@ -1737,7 +1748,7 @@ class Polygram(VMobject, metaclass=ConvertToOpenGL):self.start_new_path(first_vertex)self.add_points_as_corners(- [*(np.array(vertex) for vertex in vertices), first_vertex]+ [*(np.array(vertex) for vertex in vertices), first_vertex],)def get_vertices(self) -> np.ndarray:@@ -1973,7 +1984,9 @@ class RegularPolygram(Polygram):# polygon vertices.def gen_polygon_vertices(start_angle):reg_vertices, start_angle = regular_vertices(- num_vertices, radius=radius, start_angle=start_angle+ num_vertices,+ radius=radius,+ start_angle=start_angle,)vertices = []@@ -2108,7 +2121,7 @@ class Star(Polygon):if density <= 0 or density >= n / 2:raise ValueError(- f"Incompatible density {density} for number of points {n}"+ f"Incompatible density {density} for number of points {n}",)outer_angle = TAU * density / n@@ -2119,10 +2132,14 @@ class Star(Polygon):inner_radius = outer_radius / (np.cos(inner_angle) * inverse_x)outer_vertices, self.start_angle = regular_vertices(- n, radius=outer_radius, start_angle=start_angle+ n,+ radius=outer_radius,+ start_angle=start_angle,)inner_vertices, _ = regular_vertices(- n, radius=inner_radius, start_angle=self.start_angle + inner_angle+ n,+ radius=inner_radius,+ start_angle=self.start_angle + inner_angle,)vertices = []@@ -2350,7 +2367,7 @@ class ArcPolygonFromArcs(VMobject, metaclass=ConvertToOpenGL):def __init__(self, *arcs, **kwargs):if not all(isinstance(m, (Arc, ArcBetweenPoints)) for m in arcs):raise ValueError(- "All ArcPolygon submobjects must be of type Arc/ArcBetweenPoints"+ "All ArcPolygon submobjects must be of type Arc/ArcBetweenPoints",)super().__init__(**kwargs)# Adding the arcs like this makes ArcPolygonFromArcs double as a VGroup.@@ -2952,7 +2969,8 @@ class Angle(VMobject, metaclass=ConvertToOpenGL):self.dot_distance = dot_distanceself.elbow = elbowinter = line_intersection(- [line1.get_start(), line1.get_end()], [line2.get_start(), line2.get_end()]+ [line1.get_start(), line1.get_end()],+ [line2.get_start(), line2.get_end()],)if radius is None:@@ -2982,7 +3000,7 @@ class Angle(VMobject, metaclass=ConvertToOpenGL):)angle_mobject = Elbow(**kwargs)angle_mobject.set_points_as_corners(- [anchor_angle_1, anchor_middle, anchor_angle_2]+ [anchor_angle_1, anchor_middle, anchor_angle_2],)else:angle_1 = angle_of_vector(anchor_angle_1 - inter)diff --git a/manim/mobject/graph.py b/manim/mobject/graph.pyindex 7a817eefe..f2f67a844 100644--- a/manim/mobject/graph.py+++ b/manim/mobject/graph.py@@ -64,14 +64,14 @@ def _determine_graph_layout(elif layout == "partite":if partitions is None or len(partitions) == 0:raise ValueError(- "The partite layout requires the 'partitions' parameter to contain the partition of the vertices"+ "The partite layout requires the 'partitions' parameter to contain the partition of the vertices",)partition_count = len(partitions)for i in range(partition_count):for v in partitions[i]:if nx_graph.nodes[v] is None:raise ValueError(- "The partition must contain arrays of vertices in the graph"+ "The partition must contain arrays of vertices in the graph",)nx_graph.nodes[v]["subset"] = i# Add missing vertices to their own side@@ -93,7 +93,7 @@ def _determine_graph_layout(else:raise ValueError(f"The layout '{layout}' is neither a recognized automatic layout, "- "nor a vertex placement dictionary."+ "nor a vertex placement dictionary.",)@@ -132,7 +132,7 @@ def _tree_layout(else:for i in range(new_row_length):result[new_row[i]] = np.array(- [-1 + 2 * i / (new_row_length - 1), current_height, 0]+ [-1 + 2 * i / (new_row_length - 1), current_height, 0],)_recursive_position_for_row(@@ -144,7 +144,11 @@ def _tree_layout()_recursive_position_for_row(- G, result, two_rows_before=[], last_row=[root_vertex], current_height=1+ G,+ result,+ two_rows_before=[],+ last_row=[root_vertex],+ current_height=1,)height = max(map(lambda v: result[v][1], result))@@ -507,7 +511,7 @@ class Graph(VMobject, metaclass=ConvertToOpenGL):if vertex in self.vertices:raise ValueError(- f"Vertex identifier '{vertex}' is already used for a vertex in this graph."+ f"Vertex identifier '{vertex}' is already used for a vertex in this graph.",)self._graph.add_node(vertex)@@ -601,7 +605,7 @@ class Graph(VMobject, metaclass=ConvertToOpenGL):assert isinstance(vertex_config, dict)base_vertex_config = copy(self.default_vertex_config)base_vertex_config.update(- {key: val for key, val in vertex_config.items() if key not in vertices}+ {key: val for key, val in vertex_config.items() if key not in vertices},)vertex_config = {v: (vertex_config[v] if v in vertex_config else copy(base_vertex_config))@@ -649,7 +653,7 @@ class Graph(VMobject, metaclass=ConvertToOpenGL):"""if vertex not in self.vertices:raise ValueError(- f"The graph does not contain a vertex with identifier '{vertex}'"+ f"The graph does not contain a vertex with identifier '{vertex}'",)self._graph.remove_node(vertex)@@ -796,7 +800,9 @@ class Graph(VMobject, metaclass=ConvertToOpenGL):added_mobjects = sum((self._add_edge(- edge, edge_type=edge_type, edge_config=edge_config[edge]+ edge,+ edge_type=edge_type,+ edge_config=edge_config[edge],).submobjectsfor edge in edges),diff --git a/manim/mobject/logo.py b/manim/mobject/logo.pyindex 4519ae60a..09c076033 100644--- a/manim/mobject/logo.py+++ b/manim/mobject/logo.py@@ -145,7 +145,10 @@ class ManimBanner(VGroup):return AnimationGroup(UpdateFromAlphaFunc(- self.shapes, spiral_updater, run_time=run_time, rate_func=ease_out_sine+ self.shapes,+ spiral_updater,+ run_time=run_time,+ rate_func=ease_out_sine,),FadeIn(self.M, run_time=run_time / 2),lag_ratio=0.1,@@ -257,6 +260,9 @@ class ManimBanner(VGroup):rate_func=ease_in_out_cubic,),UpdateFromAlphaFunc(- self, slide_back, run_time=run_time * 1 / 3, rate_func=smooth+ self,+ slide_back,+ run_time=run_time * 1 / 3,+ rate_func=smooth,),)diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.pyindex 4acc99220..6fc6a841f 100644--- a/manim/mobject/matrix.py+++ b/manim/mobject/matrix.py@@ -532,7 +532,10 @@ class MobjectMatrix(Matrix):def get_det_text(- matrix, determinant=None, background_rect=False, initial_scale_factor=2+ matrix,+ determinant=None,+ background_rect=False,+ initial_scale_factor=2,):r"""Helper function to create determinant.diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.pyindex b41195ed1..a49b0d747 100644--- a/manim/mobject/mobject.py+++ b/manim/mobject/mobject.py@@ -41,6 +41,7 @@ from ..utils.color import (color_gradient,interpolate_color,)+from ..utils.deprecation import deprecatedfrom ..utils.exceptions import MultiAnimationOverrideExceptionfrom ..utils.iterables import list_update, remove_list_redundanciesfrom ..utils.paths import straight_path@@ -89,7 +90,8 @@ class Mobject:super().__init_subclass__(**kwargs)cls.animation_overrides: Dict[- Type["Animation"], Callable[["Mobject"], "Animation"]+ Type["Animation"],+ Callable[["Mobject"], "Animation"],] = {}cls._add_intrinsic_animation_overrides()@@ -109,7 +111,8 @@ class Mobject:@classmethoddef animation_override_for(- cls, animation_class: Type["Animation"]+ cls,+ animation_class: Type["Animation"],) -> "Optional[Callable[[Mobject, ...], Animation]]":"""Returns the function defining a specific animation override for this class.@@ -174,7 +177,7 @@ class Mobject:f"The animation {animation_class.__name__} for "f"{cls.__name__} is overridden by more than one method: "f"{cls.animation_overrides[animation_class].__qualname__} and "- f"{override_func.__qualname__}."+ f"{override_func.__qualname__}.",)@property@@ -684,7 +687,7 @@ class Mobject:"""Saves an image of only this :class:`Mobject` at its position to a pngfile."""self.get_image().save(- Path(config.get_dir("video_dir")).joinpath((name or str(self)) + ".png")+ Path(config.get_dir("video_dir")).joinpath((name or str(self)) + ".png"),)def copy(self: T) -> T:@@ -781,10 +784,7 @@ class Mobject::meth:`get_time_based_updaters`"""- for updater in self.updaters:- if "dt" in get_parameters(updater):- return True- return False+ return any("dt" in get_parameters(updater) for updater in self.updaters)def get_updaters(self) -> List[Updater]:"""Return all updaters.@@ -1253,7 +1253,10 @@ class Mobject:# above methodsdef apply_points_function_about_point(- self, func, about_point=None, about_edge=None+ self,+ func,+ about_point=None,+ about_edge=None,):if about_point is None:if about_edge is None:@@ -1536,7 +1539,10 @@ class Mobject:return selfdef move_to(- self, point_or_mobject, aligned_edge=ORIGIN, coor_mask=np.array([1, 1, 1])+ self,+ point_or_mobject,+ aligned_edge=ORIGIN,+ coor_mask=np.array([1, 1, 1]),):"""Move center of the :class:`~.Mobject` to certain coordinate."""if isinstance(point_or_mobject, Mobject):@@ -1555,13 +1561,19 @@ class Mobject:self.stretch_to_fit_height(mobject.height)else:self.rescale_to_fit(- mobject.length_over_dim(dim_to_match), dim_to_match, stretch=False+ mobject.length_over_dim(dim_to_match),+ dim_to_match,+ stretch=False,)self.shift(mobject.get_center() - self.get_center())return selfdef surround(- self, mobject: "Mobject", dim_to_match=0, stretch=False, buff=MED_SMALL_BUFF+ self,+ mobject: "Mobject",+ dim_to_match=0,+ stretch=False,+ buff=MED_SMALL_BUFF,):self.replace(mobject, dim_to_match, stretch)length = mobject.length_over_dim(dim_to_match)@@ -1662,10 +1674,17 @@ class Mobject:return selfdef set_colors_by_radial_gradient(- self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK+ self,+ center=None,+ radius=1,+ inner_color=WHITE,+ outer_color=BLACK,):self.set_submobject_colors_by_radial_gradient(- center, radius, inner_color, outer_color+ center,+ radius,+ inner_color,+ outer_color,)return self@@ -1683,7 +1702,11 @@ class Mobject:return selfdef set_submobject_colors_by_radial_gradient(- self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK+ self,+ center=None,+ radius=1,+ inner_color=WHITE,+ outer_color=BLACK,):if center is None:center = self.get_center()@@ -1805,7 +1828,9 @@ class Mobject:return resultfor dim in range(self.dim):result[dim] = self.get_extremum_along_dim(- all_points, dim=dim, key=direction[dim]+ all_points,+ dim=dim,+ key=direction[dim],)return result@@ -1880,9 +1905,14 @@ class Mobject:def length_over_dim(self, dim):"""Measure the length of an :class:`~.Mobject` in a certain direction."""- return self.reduce_across_dimension(- np.max, np.max, dim- ) - self.reduce_across_dimension(np.min, np.min, dim)+ return (+ self.reduce_across_dimension(+ np.max,+ np.max,+ dim,+ )+ - self.reduce_across_dimension(np.min, np.min, dim)+ )def get_coord(self, dim, direction=ORIGIN):"""Meant to generalize ``get_x``, ``get_y`` and ``get_z``"""@@ -2223,10 +2253,18 @@ class Mobject:return alignmentsrow_alignments = init_alignments(- row_alignments, rows, {"u": UP, "c": ORIGIN, "d": DOWN}, "row", RIGHT+ row_alignments,+ rows,+ {"u": UP, "c": ORIGIN, "d": DOWN},+ "row",+ RIGHT,)col_alignments = init_alignments(- col_alignments, cols, {"l": LEFT, "c": ORIGIN, "r": RIGHT}, "col", UP+ col_alignments,+ cols,+ {"l": LEFT, "c": ORIGIN, "r": RIGHT},+ "col",+ UP,)# Now row_alignment[r] + col_alignment[c] is the alignment in cell [r][c]@@ -2242,7 +2280,7 @@ class Mobject:}if flow_order not in mapper:raise ValueError(- 'flow_order must be one of the following values: "dr", "rd", "ld" "dl", "ru", "ur", "lu", "ul".'+ 'flow_order must be one of the following values: "dr", "rd", "ld" "dl", "ru", "ur", "lu", "ul".',)flow_order = mapper[flow_order]@@ -2552,7 +2590,7 @@ class Mobject:if self.has_no_points():caller_name = sys._getframe(1).f_code.co_nameraise Exception(- f"Cannot call Mobject.{caller_name} for a Mobject with no points"+ f"Cannot call Mobject.{caller_name} for a Mobject with no points",)# About z-index@@ -2636,7 +2674,7 @@ class _AnimationBuilder:def __call__(self, **kwargs):if self.cannot_pass_args:raise ValueError(- "Animation arguments must be passed before accessing methods and can only be passed once"+ "Animation arguments must be passed before accessing methods and can only be passed once",)self.anim_args = kwargs@@ -2652,7 +2690,7 @@ class _AnimationBuilder:if (self.is_chaining and has_overridden_animation) or self.overridden_animation:raise NotImplementedError("Method chaining is currently not supported for "- "overridden animations"+ "overridden animations",)def update_target(*method_args, **method_kwargs):diff --git a/manim/mobject/number_line.py b/manim/mobject/number_line.pyindex fbe120721..a8b2d569c 100644--- a/manim/mobject/number_line.py+++ b/manim/mobject/number_line.py@@ -331,7 +331,8 @@ class NumberLine(Line):**number_config,) -> DecimalNumber:number_config = merge_dicts_recursively(- self.decimal_number_config, number_config+ self.decimal_number_config,+ number_config,)if direction is None:direction = self.label_direction@@ -422,7 +423,7 @@ class NumberLine(Line):The label."""- if isinstance(label_tex, float) or isinstance(label_tex, int):+ if isinstance(label_tex, (float, int)):label_tex = MathTex(label_tex)elif isinstance(label_tex, str):label_tex = Tex(label_tex)diff --git a/manim/mobject/numbers.py b/manim/mobject/numbers.pyindex 8d9baa343..2dc04df68 100644--- a/manim/mobject/numbers.py+++ b/manim/mobject/numbers.py@@ -90,7 +90,7 @@ class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):"font_size": font_size,"stroke_width": stroke_width,"fill_opacity": fill_opacity,- }+ },)self.set_submobjects_from_number(number)@@ -123,7 +123,7 @@ class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):# Add non-numerical bitsif self.show_ellipsis:self.add(- self.string_to_mob("\\dots", SingleStringMathTex, color=self.color)+ self.string_to_mob("\\dots", SingleStringMathTex, color=self.color),)if self.unit is not None:@@ -131,7 +131,8 @@ class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):self.add(self.unit_sign)self.arrange(- buff=self.digit_buff_per_font_unit * self._font_size, aligned_edge=DOWN+ buff=self.digit_buff_per_font_unit * self._font_size,+ aligned_edge=DOWN,)# Handle alignment of parts that should be aligned@@ -204,7 +205,7 @@ class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):str(config["num_decimal_places"]),"f","}",- ]+ ],)def get_complex_formatter(self):@@ -213,7 +214,7 @@ class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):self.get_formatter(field_name="0.real"),self.get_formatter(field_name="0.imag", include_sign=True),"i",- ]+ ],)def set_value(self, number: float):@@ -400,13 +401,15 @@ class Variable(VMobject, metaclass=ConvertToOpenGL):if var_type == DecimalNumber:self.value = DecimalNumber(- self.tracker.get_value(), num_decimal_places=num_decimal_places+ self.tracker.get_value(),+ num_decimal_places=num_decimal_places,)elif var_type == Integer:self.value = Integer(self.tracker.get_value())self.value.add_updater(lambda v: v.set_value(self.tracker.get_value())).next_to(- self.label, RIGHT+ self.label,+ RIGHT,)super().__init__(**kwargs)diff --git a/manim/mobject/opengl_geometry.py b/manim/mobject/opengl_geometry.pyindex f71e096d2..f0c26407b 100644--- a/manim/mobject/opengl_geometry.py+++ b/manim/mobject/opengl_geometry.py@@ -219,7 +219,7 @@ class OpenGLArc(OpenGLTipableVMobject):angle=self.angle,start_angle=self.start_angle,n_components=self.n_components,- )+ ),)# To maintain proper orientation for fill shaders.self.scale(self.radius, about_point=ORIGIN)@@ -235,7 +235,7 @@ class OpenGLArc(OpenGLTipableVMobject):start_angle + angle,2 * n_components + 1,)- ]+ ],)theta = angle / n_componentssamples[1::2] /= np.cos(theta / 2)@@ -541,14 +541,17 @@ class OpenGLDashedLine(OpenGLLine):dashed_ratio = self.dashed_rationum_dashes = self.calculate_num_dashes(dashed_ratio)dashes = OpenGLDashedVMobject(- self, num_dashes=num_dashes, dashed_ratio=dashed_ratio+ self,+ num_dashes=num_dashes,+ dashed_ratio=dashed_ratio,)self.clear_points()self.add(*dashes)def calculate_num_dashes(self, dashed_ratio):return max(- 2, int(np.ceil((self.get_length() / self.dash_length) * dashed_ratio))+ 2,+ int(np.ceil((self.get_length() / self.dash_length) * dashed_ratio)),)def get_start(self):@@ -688,7 +691,9 @@ class OpenGLArrow(OpenGLLine):def reset_points_around_ends(self):self.set_points_by_ends(- self.get_start(), self.get_end(), path_arc=self.path_arc+ self.get_start(),+ self.get_end(),+ path_arc=self.path_arc,)return selfdiff --git a/manim/mobject/opengl_mobject.py b/manim/mobject/opengl_mobject.pyindex 70bb96f8b..8d32d5f43 100644--- a/manim/mobject/opengl_mobject.py+++ b/manim/mobject/opengl_mobject.py@@ -285,7 +285,11 @@ class OpenGLMobject:return self.point_from_proportion(0.5)def apply_points_function(- self, func, about_point=None, about_edge=ORIGIN, works_on_bounding_box=False+ self,+ func,+ about_point=None,+ about_edge=ORIGIN,+ works_on_bounding_box=False,):if about_point is None and about_edge is not None:about_point = self.get_bounding_box_point(about_edge)@@ -349,7 +353,7 @@ class OpenGLMobject:for mob in self.get_family()[1:]if mob.has_points()),- ]+ ],)if len(all_points) == 0:return np.zeros((3, self.dim))@@ -654,10 +658,18 @@ class OpenGLMobject:return alignmentsrow_alignments = init_alignments(- row_alignments, rows, {"u": UP, "c": ORIGIN, "d": DOWN}, "row", RIGHT+ row_alignments,+ rows,+ {"u": UP, "c": ORIGIN, "d": DOWN},+ "row",+ RIGHT,)col_alignments = init_alignments(- col_alignments, cols, {"l": LEFT, "c": ORIGIN, "r": RIGHT}, "col", UP+ col_alignments,+ cols,+ {"l": LEFT, "c": ORIGIN, "r": RIGHT},+ "col",+ UP,)# Now row_alignment[r] + col_alignment[c] is the alignment in cell [r][c]@@ -673,7 +685,7 @@ class OpenGLMobject:}if flow_order not in mapper:raise ValueError(- 'flow_order must be one of the following values: "dr", "rd", "ld" "dl", "ru", "ur", "lu", "ul".'+ 'flow_order must be one of the following values: "dr", "rd", "ld" "dl", "ru", "ur", "lu", "ul".',)flow_order = mapper[flow_order]@@ -1047,7 +1059,7 @@ class OpenGLMobject:+ np.dot(alphas.reshape((len(alphas), 1)),np.array(direction).reshape((1, mob.dim)),- )+ ),)return self@@ -1096,7 +1108,7 @@ class OpenGLMobject:else:target_aligner = mobtarget_point = target_aligner.get_bounding_box_point(- aligned_edge + direction+ aligned_edge + direction,)else:target_point = mobject_or_point@@ -1194,7 +1206,10 @@ class OpenGLMobject:return selfdef move_to(- self, point_or_mobject, aligned_edge=ORIGIN, coor_mask=np.array([1, 1, 1])+ self,+ point_or_mobject,+ aligned_edge=ORIGIN,+ coor_mask=np.array([1, 1, 1]),):if isinstance(point_or_mobject, OpenGLMobject):target = point_or_mobject.get_bounding_box_point(aligned_edge)@@ -1213,7 +1228,9 @@ class OpenGLMobject:self.rescale_to_fit(mobject.length_over_dim(i), i, stretch=True)else:self.rescale_to_fit(- mobject.length_over_dim(dim_to_match), dim_to_match, stretch=False+ mobject.length_over_dim(dim_to_match),+ dim_to_match,+ stretch=False,)self.shift(mobject.get_center() - self.get_center())return self@@ -1410,8 +1427,8 @@ class OpenGLMobject:corner_vect,out=np.zeros(len(direction)),where=((corner_vect) != 0),- )- )+ ),+ ),)def get_top(self):@@ -1647,7 +1664,9 @@ class OpenGLMobject:self.data[key][:] = func(mobject1.data[key], mobject2.data[key], alpha)for key in self.uniforms:self.uniforms[key] = interpolate(- mobject1.uniforms[key], mobject2.uniforms[key], alpha+ mobject1.uniforms[key],+ mobject2.uniforms[key],+ alpha,)return self@@ -1690,7 +1709,9 @@ class OpenGLMobject:def lock_matching_data(self, mobject1, mobject2):for sm, sm1, sm2 in zip(- self.get_family(), mobject1.get_family(), mobject2.get_family()+ self.get_family(),+ mobject1.get_family(),+ mobject2.get_family(),):keys = sm.data.keys() & sm1.data.keys() & sm2.data.keys()sm.lock_data(@@ -1698,8 +1719,8 @@ class OpenGLMobject:filter(lambda key: np.all(sm1.data[key] == sm2.data[key]),keys,- )- )+ ),+ ),)return self@@ -1760,7 +1781,11 @@ class OpenGLMobject:return selfdef set_color_by_xyz_func(- self, glsl_snippet, min_value=-5.0, max_value=5.0, colormap="viridis"+ self,+ glsl_snippet,+ min_value=-5.0,+ max_value=5.0,+ colormap="viridis",):"""Pass in a glsl expression in terms of x, y and z which returns@@ -1777,7 +1802,7 @@ class OpenGLMobject:float(min_value),float(max_value),get_colormap_code(rgb_list),- )+ ),)return self@@ -1825,7 +1850,8 @@ class OpenGLMobject:d_len = len(self.data[data_key])if d_len != 1 and d_len != len(array):self.data[data_key] = resize_with_interpolation(- self.data[data_key], len(array)+ self.data[data_key],+ len(array),)return self@@ -1999,7 +2025,7 @@ class _AnimationBuilder:def __call__(self, **kwargs):if self.cannot_pass_args:raise ValueError(- "Animation arguments must be passed before accessing methods and can only be passed once"+ "Animation arguments must be passed before accessing methods and can only be passed once",)self.anim_args = kwargs@@ -2015,7 +2041,7 @@ class _AnimationBuilder:if (self.is_chaining and has_overridden_animation) or self.overridden_animation:raise NotImplementedError("Method chaining is currently not supported for "- "overridden animations"+ "overridden animations",)def update_target(*method_args, **method_kwargs):diff --git a/manim/mobject/polyhedra.py b/manim/mobject/polyhedra.pyindex 6ecf66138..947e23b32 100644--- a/manim/mobject/polyhedra.py+++ b/manim/mobject/polyhedra.py@@ -124,7 +124,8 @@ class Polyhedron(VGroup):return edgesdef create_faces(- self, face_coords: List[List[Union[List, np.ndarray]]]+ self,+ face_coords: List[List[Union[List, np.ndarray]]],) -> "VGroup":"""Creates VGroup of faces from a list of face coordinates."""face_group = VGroup()diff --git a/manim/mobject/probability.py b/manim/mobject/probability.pyindex 0552ab99c..1cbffc473 100644--- a/manim/mobject/probability.py+++ b/manim/mobject/probability.py@@ -119,7 +119,12 @@ class SampleSpace(Rectangle):self.add(self.vertical_parts)def get_subdivision_braces_and_labels(- self, parts, labels, direction, buff=SMALL_BUFF, min_num_quads=1+ self,+ parts,+ labels,+ direction,+ buff=SMALL_BUFF,+ min_num_quads=1,):label_mobs = VGroup()braces = VGroup()diff --git a/manim/mobject/svg/brace.py b/manim/mobject/svg/brace.pyindex 3b59e3986..e84831548 100644--- a/manim/mobject/svg/brace.py+++ b/manim/mobject/svg/brace.py@@ -93,11 +93,13 @@ class Brace(SVGPathMobject):right = mobject.get_corner(DOWN + RIGHT)target_width = right[0] - left[0]linear_section_length = max(- 0, (target_width * sharpness - default_min_width) / 2+ 0,+ (target_width * sharpness - default_min_width) / 2,)path = path_string_template.format(- linear_section_length, -linear_section_length+ linear_section_length,+ -linear_section_length,)SVGPathMobject.__init__(@@ -179,7 +181,7 @@ class BraceLabel(VMobject, metaclass=ConvertToOpenGL):obj = self.get_group_class()(*obj)self.brace = Brace(obj, brace_direction, buff, **kwargs)- if isinstance(text, tuple) or isinstance(text, list):+ if isinstance(text, (tuple, list)):self.label = self.label_constructor(font_size=font_size, *text, **kwargs)else:self.label = self.label_constructor(str(text), font_size=font_size)diff --git a/manim/mobject/svg/code_mobject.py b/manim/mobject/svg/code_mobject.pyindex cb53f552a..ec841478d 100644--- a/manim/mobject/svg/code_mobject.py+++ b/manim/mobject/svg/code_mobject.py@@ -215,7 +215,7 @@ class Code(VGroup):self.code_string = codeelse:raise ValueError(- "Neither a code file nor a code string have been specified."+ "Neither a code file nor a code string have been specified.",)if isinstance(self.style, str):self.style = self.style.lower()@@ -269,7 +269,7 @@ class Code(VGroup):buttons = VGroup(red_button, yellow_button, green_button)buttons.shift(UP * (height / 2 - 0.1 * 2 - 0.05)- + LEFT * (width / 2 - 0.1 * 5 - self.corner_radius / 2 - 0.05)+ + LEFT * (width / 2 - 0.1 * 5 - self.corner_radius / 2 - 0.05),)self.background_mobject = VGroup(rect, buttons)@@ -380,16 +380,19 @@ class Code(VGroup):if self.generate_html_file:os.makedirs(- os.path.join("assets", "codes", "generated_html_files"), exist_ok=True+ os.path.join("assets", "codes", "generated_html_files"),+ exist_ok=True,)- file = open(+ with open(os.path.join(- "assets", "codes", "generated_html_files", self.file_name + ".html"+ "assets",+ "codes",+ "generated_html_files",+ self.file_name + ".html",),"w",- )- file.write(self.html_string)- file.close()+ ) as file:+ file.write(self.html_string)def gen_code_json(self):"""Function to background_color, generate code_json and tab_spaces from html_string.@@ -413,7 +416,8 @@ class Code(VGroup):self.html_string = self.html_string.replace("</" + " " * i, "</")for i in range(10, -1, -1):self.html_string = self.html_string.replace(- "</span>" + " " * i, " " * i + "</span>"+ "</span>" + " " * i,+ " " * i + "</span>",)self.html_string = self.html_string.replace("background-color:", "background:")@@ -440,7 +444,7 @@ class Code(VGroup):start_point = lines[line_index].find("<")starting_string = lines[line_index][:start_point]indentation_chars_count = lines[line_index][:start_point].count(- self.indentation_chars+ self.indentation_chars,)if (starting_string.__len__()@@ -538,7 +542,13 @@ class Code(VGroup):def hilite_me(- code, language, style, insert_line_no, divstyles, file_path, line_no_from+ code,+ language,+ style,+ insert_line_no,+ divstyles,+ file_path,+ line_no_from,):"""Function to highlight code from string to html.@@ -575,7 +585,7 @@ def hilite_me(html = highlight(code, lexer, formatter)elif language is None:raise ValueError(- "The code language has to be specified when rendering a code string"+ "The code language has to be specified when rendering a code string",)else:html = highlight(code, get_lexer_by_name(language, **{}), formatter)@@ -612,6 +622,7 @@ def insert_line_numbers_in_html(html, line_no_from):format_lines = "%" + str(len(str(numbers[-1]))) + "i"lines = "\n".join(format_lines % i for i in numbers)html = html.replace(- pre_open, "<table><tr><td>" + pre_open + lines + "</pre></td><td>" + pre_open+ pre_open,+ "<table><tr><td>" + pre_open + lines + "</pre></td><td>" + pre_open,)return htmldiff --git a/manim/mobject/svg/opengl_tex_mobject.py b/manim/mobject/svg/opengl_tex_mobject.pyindex fb3d902e8..a79d49e40 100644--- a/manim/mobject/svg/opengl_tex_mobject.py+++ b/manim/mobject/svg/opengl_tex_mobject.py@@ -414,7 +414,8 @@ class OpenGLMathTex(OpenGLSingleStringMathTex):def break_up_tex_strings(self, tex_strings):substrings_to_isolate = op.add(- self.substrings_to_isolate, list(self.tex_to_color_map.keys())+ self.substrings_to_isolate,+ list(self.tex_to_color_map.keys()),)split_list = split_string_list_to_isolate_substrings(tex_strings, *substrings_to_isolatediff --git a/manim/mobject/svg/opengl_text_mobject.py b/manim/mobject/svg/opengl_text_mobject.pyindex 789822a19..aace5b26e 100644--- a/manim/mobject/svg/opengl_text_mobject.py+++ b/manim/mobject/svg/opengl_text_mobject.py@@ -148,7 +148,7 @@ class OpenGLParagraph(OpenGLVGroup):char_index_counter : char_index_counter+ lines_str_list[line_index].__len__()+ 1- ]+ ],)char_index_counter += lines_str_list[line_index].__len__() + 1self.lines = []@@ -160,7 +160,7 @@ class OpenGLParagraph(OpenGLVGroup):self.lines_initial_positions.append(self.lines[0][line_no].get_center())self.lines.append([])self.lines[1].extend(- [self.alignment for _ in range(chars_lines_text_list.__len__())]+ [self.alignment for _ in range(chars_lines_text_list.__len__())],)OpenGLVGroup.__init__(self, *(self.lines[0][i] for i in range(self.lines[0].__len__())), **config@@ -226,7 +226,7 @@ class OpenGLParagraph(OpenGLVGroup):self.lines[1] = [None for _ in range(self.lines[0].__len__())]for line_no in range(0, self.lines[0].__len__()):self[line_no].move_to(- self.get_center() + self.lines_initial_positions[line_no]+ self.get_center() + self.lines_initial_positions[line_no],)return self@@ -255,7 +255,7 @@ class OpenGLParagraph(OpenGLVGroup):self.lines[1][line_no] = alignmentif self.lines[1][line_no] == "center":self[line_no].move_to(- np.array([self.get_center()[0], self[line_no].get_center()[1], 0])+ np.array([self.get_center()[0], self[line_no].get_center()[1], 0]),)elif self.lines[1][line_no] == "right":self[line_no].move_to(@@ -264,8 +264,8 @@ class OpenGLParagraph(OpenGLVGroup):self.get_right()[0] - self[line_no].width / 2,self[line_no].get_center()[1],0,- ]- )+ ],+ ),)elif self.lines[1][line_no] == "left":self[line_no].move_to(@@ -274,8 +274,8 @@ class OpenGLParagraph(OpenGLVGroup):self.get_left()[0] + self[line_no].width / 2,self[line_no].get_center()[1],0,- ]- )+ ],+ ),)@@ -514,7 +514,7 @@ class OpenGLText(OpenGLSVGMobject):space.move_to(self.submobjects[submobjects_char_index].get_center())else:space.move_to(- self.submobjects[submobjects_char_index - 1].get_center()+ self.submobjects[submobjects_char_index - 1].get_center(),)chars.add(space)else:@@ -931,7 +931,7 @@ class OpenGLMarkupText(OpenGLSVGMobject):colormap = self.extract_color_tags()if len(colormap) > 0:logger.warning(- 'Using <color> tags in MarkupText is deprecated. Please use <span foreground="..."> instead.'+ 'Using <color> tags in MarkupText is deprecated. Please use <span foreground="..."> instead.',)gradientmap = self.extract_gradient_tags()@@ -939,7 +939,7 @@ class OpenGLMarkupText(OpenGLSVGMobject):raise ValueError(f"Pango cannot parse your markup in {self.text}. ""Please check for typos, unmatched tags or unescaped "- "special chars like < and &."+ "special chars like < and &.",)if self.line_spacing == -1:@@ -1095,7 +1095,7 @@ class OpenGLMarkupText(OpenGLSVGMobject):"to": tag.group(2),"start_offset": start_offset,"end_offset": end_offset,- }+ },)self.text = re.sub("<gradient[^>]+>(.+?)</gradient>", r"\1", self.text, 0, re.S)return gradientmap@@ -1137,7 +1137,7 @@ class OpenGLMarkupText(OpenGLSVGMobject):"color": tag.group(1),"start_offset": start_offset,"end_offset": end_offset,- }+ },)self.text = re.sub("<color[^>]+>(.+?)</color>", r"\1", self.text, 0, re.S)return colormapdiff --git a/manim/mobject/svg/style_utils.py b/manim/mobject/svg/style_utils.pyindex 067fec095..4647e0018 100644--- a/manim/mobject/svg/style_utils.py+++ b/manim/mobject/svg/style_utils.py@@ -30,7 +30,8 @@ SVG_DEFAULT_ATTRIBUTES: Dict[str, str] = {def cascade_element_style(- element: MinidomElement, inherited: Dict[str, str]+ element: MinidomElement,+ inherited: Dict[str, str],) -> Dict[str, str]:"""Collect the element's style attributes based upon both its inheritance and its own attributes.diff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.pyindex bbd8a4824..a94b1a424 100644--- a/manim/mobject/svg/svg_mobject.py+++ b/manim/mobject/svg/svg_mobject.py@@ -40,6 +40,7 @@ class SVGMobject(VMobject, metaclass=ConvertToOpenGL):class Sample(Scene):def construct(self):self.play(FadeIn(SVGMobject("manim-logo-sidebar.svg")))+Parameters--------file_name : :class:`str`@@ -183,7 +184,9 @@ class SVGMobject(VMobject, metaclass=ConvertToOpenGL):result += it.chain(*(self.get_mobjects_from(- child, style, within_defs=within_defs or is_defs+ child,+ style,+ within_defs=within_defs or is_defs,)for child in element.childNodes)@@ -272,12 +275,14 @@ class SVGMobject(VMobject, metaclass=ConvertToOpenGL):A float representing the attribute string value."""stripped_attr = "".join(- [char for char in attr if char in string.digits + ".-e"]+ [char for char in attr if char in string.digits + ".-e"],)return float(stripped_attr)def use_to_mobjects(- self, use_element: MinidomElement, local_style: Dict+ self,+ use_element: MinidomElement,+ local_style: Dict,) -> List[VMobject]:"""Converts a SVG <use> element to a collection of VMobjects.@@ -543,7 +548,8 @@ class SVGMobject(VMobject, metaclass=ConvertToOpenGL):# TODO: handle rotate, skewX and skewY# for now adding a warning messagelogger.warning(- "Handling of %s transform is not supported yet!", op_name+ "Handling of %s transform is not supported yet!",+ op_name,)def flatten(self, input_list):diff --git a/manim/mobject/svg/svg_path.py b/manim/mobject/svg/svg_path.pyindex 4a871a9ba..0de275484 100644--- a/manim/mobject/svg/svg_path.py+++ b/manim/mobject/svg/svg_path.py@@ -121,7 +121,15 @@ def elliptical_arc_to_cubic_bezier(x1, y1, rx, ry, phi, fA, fS, x2, y2):# Convert from endpoint to center parameterization.cx, cy, theta1, dtheta = get_elliptical_arc_center_parameters(- x1, y1, rx, ry, phi, fA, fS, x2, y2+ x1,+ y1,+ rx,+ ry,+ phi,+ fA,+ fS,+ x2,+ y2,)# For a given arc we should "chop" it up into segments if it is too big@@ -257,7 +265,7 @@ class SVGPathMobject(VMobject, metaclass=ConvertToOpenGL):zip(re.findall(pattern, self.path_string),re.split(pattern, self.path_string)[1:],- )+ ),)# Which mobject should new points be added toprev_command = None@@ -291,7 +299,10 @@ class SVGPathMobject(VMobject, metaclass=ConvertToOpenGL):# Produce the (absolute) coordinates of the controls and handlesnew_points = self.string_to_points(- command, is_relative, coord_string, start_point+ command,+ is_relative,+ coord_string,+ start_point,)if command == "M": # moveto@@ -322,7 +333,9 @@ class SVGPathMobject(VMobject, metaclass=ConvertToOpenGL):for i in range(0, len(new_points), 2):new_handle = 2 * start_point - prev_handleself.add_cubic_bezier_curve_to(- new_handle, new_points[i], new_points[i + 1]+ new_handle,+ new_points[i],+ new_points[i + 1],)start_point = new_points[i + 1]prev_handle = new_points[i]diff --git a/manim/mobject/svg/tex_mobject.py b/manim/mobject/svg/tex_mobject.pyindex b58b1def5..3bce3c030 100644--- a/manim/mobject/svg/tex_mobject.py+++ b/manim/mobject/svg/tex_mobject.py@@ -299,8 +299,8 @@ class MathTex(SingleStringMathTex):compilation error. If you didn't use the double bracesplit intentionally, add spaces between the braces toavoid the automatic splitting: {{ ... }} --> { { ... } }.- """- )+ """,+ ),)raise compilation_errorself.set_color_by_tex_to_color_map(self.tex_to_color_map)@@ -323,9 +323,10 @@ class MathTex(SingleStringMathTex):[f"({re.escape(ss)})"for ss in it.chain(- self.substrings_to_isolate, self.tex_to_color_map.keys()+ self.substrings_to_isolate,+ self.tex_to_color_map.keys(),)- ]+ ],)pattern = "|".join(patterns)if pattern:diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.pyindex 06333bf39..e36765680 100644--- a/manim/mobject/svg/text_mobject.py+++ b/manim/mobject/svg/text_mobject.py@@ -159,7 +159,7 @@ class Paragraph(VGroup):char_index_counter : char_index_counter+ lines_str_list[line_index].__len__()+ 1- ]+ ],)char_index_counter += lines_str_list[line_index].__len__() + 1self.lines = []@@ -171,7 +171,7 @@ class Paragraph(VGroup):self.lines_initial_positions.append(self.lines[0][line_no].get_center())self.lines.append([])self.lines[1].extend(- [self.alignment for _ in range(chars_lines_text_list.__len__())]+ [self.alignment for _ in range(chars_lines_text_list.__len__())],)self.add(*self.lines[0])self.move_to(np.array([0, 0, 0]))@@ -235,7 +235,7 @@ class Paragraph(VGroup):self.lines[1] = [None for _ in range(self.lines[0].__len__())]for line_no in range(0, self.lines[0].__len__()):self[line_no].move_to(- self.get_center() + self.lines_initial_positions[line_no]+ self.get_center() + self.lines_initial_positions[line_no],)return self@@ -264,7 +264,7 @@ class Paragraph(VGroup):self.lines[1][line_no] = alignmentif self.lines[1][line_no] == "center":self[line_no].move_to(- np.array([self.get_center()[0], self[line_no].get_center()[1], 0])+ np.array([self.get_center()[0], self[line_no].get_center()[1], 0]),)elif self.lines[1][line_no] == "right":self[line_no].move_to(@@ -273,8 +273,8 @@ class Paragraph(VGroup):self.get_right()[0] - self[line_no].width / 2,self[line_no].get_center()[1],0,- ]- )+ ],+ ),)elif self.lines[1][line_no] == "left":self[line_no].move_to(@@ -283,8 +283,8 @@ class Paragraph(VGroup):self.get_left()[0] + self[line_no].width / 2,self[line_no].get_center()[1],0,- ]- )+ ],+ ),)@@ -562,7 +562,7 @@ class Text(SVGMobject):space.move_to(self.submobjects[submobjects_char_index].get_center())else:space.move_to(- self.submobjects[submobjects_char_index - 1].get_center()+ self.submobjects[submobjects_char_index - 1].get_center(),)chars.add(space)else:@@ -1078,7 +1078,7 @@ class MarkupText(SVGMobject):colormap = self.extract_color_tags()if len(colormap) > 0:logger.warning(- 'Using <color> tags in MarkupText is deprecated. Please use <span foreground="..."> instead.'+ 'Using <color> tags in MarkupText is deprecated. Please use <span foreground="..."> instead.',)gradientmap = self.extract_gradient_tags()validate_error = MarkupUtils.validate(self.text)@@ -1263,7 +1263,7 @@ class MarkupText(SVGMobject):"to": tag.group(2),"start_offset": start_offset,"end_offset": end_offset,- }+ },)self.text = re.sub("<gradient[^>]+>(.+?)</gradient>", r"\1", self.text, 0, re.S)return gradientmap@@ -1305,7 +1305,7 @@ class MarkupText(SVGMobject):"color": tag.group(1),"start_offset": start_offset,"end_offset": end_offset,- }+ },)self.text = re.sub("<color[^>]+>(.+?)</color>", r"\1", self.text, 0, re.S)return colormapdiff --git a/manim/mobject/table.py b/manim/mobject/table.pyindex ce2fd3ee8..367a4603a 100644--- a/manim/mobject/table.py+++ b/manim/mobject/table.py@@ -157,7 +157,8 @@ class Table(VGroup):include_background_rectangle: bool = False,background_rectangle_color: Color = BLACK,element_to_mobject: Callable[- [Union[float, str, "VMobject"]], "VMobject"+ [Union[float, str, "VMobject"]],+ "VMobject",] = Paragraph,element_to_mobject_config: dict = {},arrange_in_grid_config: dict = {},@@ -247,7 +248,8 @@ class Table(VGroup):self.add_background_rectangle(color=self.background_rectangle_color)def _table_to_mob_table(- self, table: Iterable[Iterable[Union[float, str, "VMobject"]]]+ self,+ table: Iterable[Iterable[Union[float, str, "VMobject"]]],) -> List:"""Initilaizes the entries of ``table`` as :class:`~.VMobject`.@@ -562,7 +564,8 @@ class Table(VGroup):return selfdef get_entries(- self, pos: Optional[Sequence[int]] = None+ self,+ pos: Optional[Sequence[int]] = None,) -> Union[VMobject, VGroup]:"""Return the individual entries of the table (including labels) or one specific entryif the parameter, ``pos``, is set.@@ -613,7 +616,8 @@ class Table(VGroup):return self.elementsdef get_entries_without_labels(- self, pos: Optional[Sequence[int]] = None+ self,+ pos: Optional[Sequence[int]] = None,) -> Union[VMobject, VGroup]:"""Return the individual entries of the table (without labels) or one specific entryif the parameter, ``pos``, is set.diff --git a/manim/mobject/three_dimensions.py b/manim/mobject/three_dimensions.pyindex e0108aa50..c34162625 100644--- a/manim/mobject/three_dimensions.py+++ b/manim/mobject/three_dimensions.py@@ -151,7 +151,7 @@ class Surface(VGroup, metaclass=ConvertToOpenGL):[u2, v2, 0],[u1, v2, 0],[u1, v1, 0],- ]+ ],)faces.add(face)face.u_index = i@@ -227,7 +227,9 @@ class Surface(VGroup, metaclass=ConvertToOpenGL):pivot_max = axes.z_range[1]pivot_frequency = (pivot_max - pivot_min) / (len(new_colors) - 1)pivots = np.arange(- start=pivot_min, stop=pivot_max + pivot_frequency, step=pivot_frequency+ start=pivot_min,+ stop=pivot_max + pivot_frequency,+ step=pivot_frequency,)for mob in self.family_members_with_points():@@ -244,7 +246,9 @@ class Surface(VGroup, metaclass=ConvertToOpenGL):)color_index = min(color_index, 1)mob_color = interpolate_color(- new_colors[i - 1], new_colors[i], color_index+ new_colors[i - 1],+ new_colors[i],+ color_index,)if config.renderer == "opengl":mob.set_color(mob_color, recurse=False)@@ -323,7 +327,7 @@ class Sphere(Surface):def func(self, u, v):return self.radius * np.array(- [np.cos(u) * np.sin(v), np.sin(u) * np.sin(v), -np.cos(v)]+ [np.cos(u) * np.sin(v), np.sin(u) * np.sin(v), -np.cos(v)],)@@ -515,7 +519,7 @@ class Cone(Surface):r * np.sin(self.theta) * np.cos(phi),r * np.sin(self.theta) * np.sin(phi),r * np.cos(self.theta),- ]+ ],)def _rotate_to_direction(self):diff --git a/manim/mobject/types/dot_cloud.py b/manim/mobject/types/dot_cloud.pyindex bbdee7d06..6468f7eb9 100644--- a/manim/mobject/types/dot_cloud.py+++ b/manim/mobject/types/dot_cloud.py@@ -24,7 +24,9 @@ class DotCloud(OpenGLPMobject):for r in np.arange(self.epsilon, self.radius, self.epsilon)# Num is equal to int(stop - start)/ (step + 1) reformulated.for theta in np.linspace(- 0, 2 * np.pi, num=int(2 * np.pi * (r + self.epsilon) / self.epsilon)+ 0,+ 2 * np.pi,+ num=int(2 * np.pi * (r + self.epsilon) / self.epsilon),)],dtype=np.float32,diff --git a/manim/mobject/types/image_mobject.py b/manim/mobject/types/image_mobject.pyindex 0a4957ebf..9d9d90ba9 100644--- a/manim/mobject/types/image_mobject.py+++ b/manim/mobject/types/image_mobject.py@@ -78,7 +78,7 @@ class AbstractImageMobject(Mobject):"resampling_algorithm has to be an int, one of the values defined in ""RESAMPLING_ALGORITHMS or a Pillow resampling filter constant. ""Available algorithms: 'bicubic', 'nearest', 'box', 'bilinear', "- "'hamming', 'lanczos'."+ "'hamming', 'lanczos'.",)def reset_points(self):@@ -88,7 +88,7 @@ class AbstractImageMobject(Mobject):UP + LEFT,UP + RIGHT,DOWN + LEFT,- ]+ ],)self.center()h, w = self.get_pixel_array().shape[:2]@@ -196,7 +196,8 @@ class ImageMobject(AbstractImageMobject):pa = pa.repeat(3, axis=2)if pa.shape[2] == 3:alphas = 255 * np.ones(- list(pa.shape[:2]) + [1], dtype=self.pixel_array_dtype+ list(pa.shape[:2]) + [1],+ dtype=self.pixel_array_dtype,)pa = np.append(pa, alphas, axis=2)self.pixel_array = pa@@ -265,13 +266,19 @@ class ImageMobject(AbstractImageMobject):f"Mobject 2 ({mobject2}) : {mobject2.pixel_array.shape}")self.fill_opacity = interpolate(- mobject1.fill_opacity, mobject2.fill_opacity, alpha+ mobject1.fill_opacity,+ mobject2.fill_opacity,+ alpha,)self.stroke_opacity = interpolate(- mobject1.stroke_opacity, mobject2.stroke_opacity, alpha+ mobject1.stroke_opacity,+ mobject2.stroke_opacity,+ alpha,)self.pixel_array = interpolate(- mobject1.pixel_array, mobject2.pixel_array, alpha+ mobject1.pixel_array,+ mobject2.pixel_array,+ alpha,).astype(self.pixel_array_dtype)def get_style(self):@@ -318,5 +325,7 @@ class ImageMobjectFromCamera(AbstractImageMobject):f"Mobject 2 ({mobject2}) : {mobject2.pixel_array.shape}")self.pixel_array = interpolate(- mobject1.pixel_array, mobject2.pixel_array, alpha+ mobject1.pixel_array,+ mobject2.pixel_array,+ alpha,).astype(self.pixel_array_dtype)diff --git a/manim/mobject/types/opengl_point_cloud_mobject.py b/manim/mobject/types/opengl_point_cloud_mobject.pyindex 6a568405e..af5f60e3c 100644--- a/manim/mobject/types/opengl_point_cloud_mobject.py+++ b/manim/mobject/types/opengl_point_cloud_mobject.py@@ -76,12 +76,16 @@ class OpenGLPMobject(OpenGLMobject):def set_color_by_gradient(self, *colors):self.rgbas = np.array(- list(map(color_to_rgba, color_gradient(*colors, self.get_num_points())))+ list(map(color_to_rgba, color_gradient(*colors, self.get_num_points()))),)return selfdef set_colors_by_radial_gradient(- self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK+ self,+ center=None,+ radius=1,+ inner_color=WHITE,+ outer_color=BLACK,):start_rgba, end_rgba = list(map(color_to_rgba, [inner_color, outer_color]))if center is None:@@ -91,7 +95,9 @@ class OpenGLPMobject(OpenGLMobject):alphas = np.linalg.norm(distances, axis=1) / radiusmob.rgbas = np.array(- np.array([interpolate(start_rgba, end_rgba, alpha) for alpha in alphas])+ np.array(+ [interpolate(start_rgba, end_rgba, alpha) for alpha in alphas],+ ),)return selfdiff --git a/manim/mobject/types/opengl_surface.py b/manim/mobject/types/opengl_surface.pyindex 4130a67a7..01d8b9194 100644--- a/manim/mobject/types/opengl_surface.py+++ b/manim/mobject/types/opengl_surface.py@@ -140,11 +140,15 @@ class OpenGLSurface(OpenGLMobject):np.vstack([self.get_partial_points_array(- arr.copy(), a, b, (nu, nv, 3), axis=axis+ arr.copy(),+ a,+ b,+ (nu, nv, 3),+ axis=axis,)for arr in smobject.get_surface_points_and_nudged_points()- ]- )+ ],+ ),)return self@@ -158,18 +162,26 @@ class OpenGLSurface(OpenGLMobject):upper_index, upper_residue = integer_interpolate(0, max_index, b)if axis == 0:points[:lower_index] = interpolate(- points[lower_index], points[lower_index + 1], lower_residue+ points[lower_index],+ points[lower_index + 1],+ lower_residue,)points[upper_index + 1 :] = interpolate(- points[upper_index], points[upper_index + 1], upper_residue+ points[upper_index],+ points[upper_index + 1],+ upper_residue,)else:shape = (nu, 1, resolution[2])points[:, :lower_index] = interpolate(- points[:, lower_index], points[:, lower_index + 1], lower_residue+ points[:, lower_index],+ points[:, lower_index + 1],+ lower_residue,).reshape(shape)points[:, upper_index + 1 :] = interpolate(- points[:, upper_index], points[:, upper_index + 1], upper_residue+ points[:, upper_index],+ points[:, upper_index + 1],+ upper_residue,).reshape(shape)return points.reshape((nu * nv, *resolution[2:]))@@ -255,7 +267,9 @@ class OpenGLSurface(OpenGLMobject):pivot_max = axes.z_range[1]pivot_frequency = (pivot_max - pivot_min) / (len(new_colors) - 1)pivots = np.arange(- start=pivot_min, stop=pivot_max + pivot_frequency, step=pivot_frequency+ start=pivot_min,+ stop=pivot_max + pivot_frequency,+ step=pivot_frequency,)for mob in self.family_members_with_points():@@ -273,7 +287,9 @@ class OpenGLSurface(OpenGLMobject):)color_index = min(color_index, 1)mob_color = interpolate_color(- new_colors[i - 1], new_colors[i], color_index+ new_colors[i - 1],+ new_colors[i],+ color_index,)mob.set_color(mob_color, recurse=False)@@ -344,7 +360,7 @@ class OpenGLTexturedSurface(OpenGLSurface):[u, v]for u in np.linspace(0, 1, nu)for v in np.linspace(1, 0, nv) # Reverse y-direction- ]+ ],)def init_colors(self):diff --git a/manim/mobject/types/opengl_vectorized_mobject.py b/manim/mobject/types/opengl_vectorized_mobject.pyindex cd3da8772..494f4c649 100644--- a/manim/mobject/types/opengl_vectorized_mobject.py+++ b/manim/mobject/types/opengl_vectorized_mobject.py@@ -156,7 +156,12 @@ class OpenGLVMobject(OpenGLMobject):return selfdef set_stroke(- self, color=None, width=None, opacity=None, background=None, recurse=True+ self,+ color=None,+ width=None,+ opacity=None,+ background=None,+ recurse=True,):self.set_rgba_array(color, opacity, "stroke_rgba", recurse)@@ -335,7 +340,10 @@ class OpenGLVMobject(OpenGLMobject):def add_cubic_bezier_curve(self, anchor1, handle1, handle2, anchor2):new_points = get_quadratic_approximation_of_cubic(- anchor1, handle1, handle2, anchor2+ anchor1,+ handle1,+ handle2,+ anchor2,)self.append_points(new_points)@@ -345,7 +353,10 @@ class OpenGLVMobject(OpenGLMobject):"""self.throw_error_if_no_points()quadratic_approx = get_quadratic_approximation_of_cubic(- self.get_last_point(), handle1, handle2, anchor+ self.get_last_point(),+ handle1,+ handle2,+ anchor,)if self.has_new_path_started():self.append_points(quadratic_approx[1:])@@ -418,7 +429,7 @@ class OpenGLVMobject(OpenGLMobject):[partial_quadratic_bezier_points(tup, a1, a2)for a1, a2 in zip(alphas, alphas[1:])- ]+ ],)else:new_points.append(tup)@@ -454,12 +465,15 @@ class OpenGLVMobject(OpenGLMobject):new_subpath = np.array(subpath)if mode == "approx_smooth":new_subpath[1::nppc] = get_smooth_quadratic_bezier_handle_points(- anchors+ anchors,)elif mode == "true_smooth":h1, h2 = get_smooth_cubic_bezier_handle_points(anchors)new_subpath = get_quadratic_approximation_of_cubic(- anchors[:-1], h1, h2, anchors[1:]+ anchors[:-1],+ h1,+ h2,+ anchors[1:],)elif mode == "jagged":new_subpath[1::nppc] = 0.5 * (anchors[:-1] + anchors[1:])@@ -563,7 +577,9 @@ class OpenGLVMobject(OpenGLMobject):return bezier(self.get_nth_curve_points(n))def get_nth_curve_function_with_length(- self, n: int, sample_points: Optional[int] = None+ self,+ n: int,+ sample_points: Optional[int] = None,) -> Tuple[Callable[[float], np.ndarray], float]:"""Returns the expression of the nth curve along with its (approximate) length.@@ -708,8 +724,8 @@ class OpenGLVMobject(OpenGLMobject):self.get_start_anchors(),self.get_end_anchors(),)- )- )+ ),+ ),)def get_points_without_null_curves(self, atol=1e-9):@@ -741,7 +757,7 @@ class OpenGLVMobject(OpenGLMobject):return np.sum(lengthfor _, length in self.get_curve_functions_with_lengths(- sample_points=sample_points_per_curve+ sample_points=sample_points_per_curve,))@@ -762,15 +778,15 @@ class OpenGLVMobject(OpenGLMobject):return 0.5 * np.array([sum(- (p0[:, 1] + p1[:, 1]) * (p1[:, 2] - p0[:, 2])+ (p0[:, 1] + p1[:, 1]) * (p1[:, 2] - p0[:, 2]),), # Add up (y1 + y2)*(z2 - z1)sum(- (p0[:, 2] + p1[:, 2]) * (p1[:, 0] - p0[:, 0])+ (p0[:, 2] + p1[:, 2]) * (p1[:, 0] - p0[:, 0]),), # Add up (z1 + z2)*(x2 - x1)sum(- (p0[:, 0] + p1[:, 0]) * (p1[:, 1] - p0[:, 1])+ (p0[:, 0] + p1[:, 0]) * (p1[:, 1] - p0[:, 1]),), # Add up (x1 + x2)*(y2 - y1)- ]+ ],)def get_direction(self):@@ -922,7 +938,9 @@ class OpenGLVMobject(OpenGLMobject):return selfif lower_index == upper_index:tup = partial_quadratic_bezier_points(- vm_points[i1:i2], lower_residue, upper_residue+ vm_points[i1:i2],+ lower_residue,+ upper_residue,)new_points[:i1] = tup[0]new_points[i1:i4] = tup@@ -930,10 +948,14 @@ class OpenGLVMobject(OpenGLMobject):new_points[nppc:] = new_points[nppc - 1]else:low_tup = partial_quadratic_bezier_points(- vm_points[i1:i2], lower_residue, 1+ vm_points[i1:i2],+ lower_residue,+ 1,)high_tup = partial_quadratic_bezier_points(- vm_points[i3:i4], 0, upper_residue+ vm_points[i3:i4],+ 0,+ upper_residue,)new_points[0:i1] = low_tup[0]new_points[i1:i2] = low_tup@@ -999,7 +1021,7 @@ class OpenGLVMobject(OpenGLMobject):indices[0::3],indices[1::3][concave_parts],indices[2::3][end_of_loop],- ]+ ],)inner_vert_indices.sort()rings = np.arange(1, len(inner_vert_indices) + 1)[inner_vert_indices % 3 == 2]@@ -1025,7 +1047,7 @@ class OpenGLVMobject(OpenGLMobject):new_points = np.empty((0, 3))for mob in self.family_members_with_points():new_points = np.concatenate((new_points, mob.points), axis=0)- if not np.all(new_points == old_points):+ if not np.array_equal(new_points, old_points):self.refresh_triangulation()self.refresh_unit_normal()@@ -1250,7 +1272,8 @@ class OpenGLDashedVMobject(OpenGLVMobject):self.add(*(vmobject.get_subcurve(- i * (dash_len + void_len), i * (dash_len + void_len) + dash_len+ i * (dash_len + void_len),+ i * (dash_len + void_len) + dash_len,)for i in range(n))diff --git a/manim/mobject/types/point_cloud_mobject.py b/manim/mobject/types/point_cloud_mobject.pyindex b291fbef0..bac458c13 100644--- a/manim/mobject/types/point_cloud_mobject.py+++ b/manim/mobject/types/point_cloud_mobject.py@@ -97,12 +97,16 @@ class PMobject(Mobject, metaclass=ConvertToOpenGL):def set_color_by_gradient(self, *colors):self.rgbas = np.array(- list(map(color_to_rgba, color_gradient(*colors, len(self.points))))+ list(map(color_to_rgba, color_gradient(*colors, len(self.points)))),)return selfdef set_colors_by_radial_gradient(- self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK+ self,+ center=None,+ radius=1,+ inner_color=WHITE,+ outer_color=BLACK,):start_rgba, end_rgba = list(map(color_to_rgba, [inner_color, outer_color]))if center is None:@@ -112,7 +116,9 @@ class PMobject(Mobject, metaclass=ConvertToOpenGL):alphas = np.linalg.norm(distances, axis=1) / radiusmob.rgbas = np.array(- np.array([interpolate(start_rgba, end_rgba, alpha) for alpha in alphas])+ np.array(+ [interpolate(start_rgba, end_rgba, alpha) for alpha in alphas],+ ),)return self@@ -135,7 +141,7 @@ class PMobject(Mobject, metaclass=ConvertToOpenGL):for mob in self.family_members_with_points():num_points = self.get_num_points()mob.apply_over_attr_arrays(- lambda arr: arr[np.arange(0, num_points, factor)]+ lambda arr: arr[np.arange(0, num_points, factor)],)return self@@ -176,7 +182,7 @@ class PMobject(Mobject, metaclass=ConvertToOpenGL):def align_points_with_larger(self, larger_mobject):assert isinstance(larger_mobject, PMobject)self.apply_over_attr_arrays(- lambda a: stretch_array_to_length(a, larger_mobject.get_num_points())+ lambda a: stretch_array_to_length(a, larger_mobject.get_num_points()),)def get_point_mobject(self, center=None):@@ -191,7 +197,7 @@ class PMobject(Mobject, metaclass=ConvertToOpenGL):mobject1.get_stroke_width(),mobject2.get_stroke_width(),alpha,- )+ ),)return self@@ -251,12 +257,10 @@ class PGroup(PMobject):"""def __init__(self, *pmobs, **kwargs):- if not all(- [isinstance(m, PMobject) or isinstance(m, OpenGLPMobject) for m in pmobs]- ):+ if not all([isinstance(m, (PMobject, OpenGLPMobject)) for m in pmobs]):raise ValueError("All submobjects must be of type PMobject or OpenGLPMObject"- " if using the opengl renderer"+ " if using the opengl renderer",)super().__init__(**kwargs)self.add(*pmobs)@@ -325,9 +329,11 @@ class PointCloudDot(Mobject1D):for r in np.arange(self.epsilon, self.radius, self.epsilon)# Num is equal to int(stop - start)/ (step + 1) reformulated.for theta in np.linspace(- 0, 2 * np.pi, num=int(2 * np.pi * (r + self.epsilon) / self.epsilon)+ 0,+ 2 * np.pi,+ num=int(2 * np.pi * (r + self.epsilon) / self.epsilon),)- ]+ ],)diff --git a/manim/mobject/types/vectorized_mobject.py b/manim/mobject/types/vectorized_mobject.pyindex 26d7a4f37..06c74740a 100644--- a/manim/mobject/types/vectorized_mobject.py+++ b/manim/mobject/types/vectorized_mobject.py@@ -152,7 +152,7 @@ class VMobject(Mobject):colors = list(tuplify(color))opacities = list(tuplify(opacity))rgbas = np.array(- [color_to_rgba(c, o) for c, o in zip(*make_even(colors, opacities))]+ [color_to_rgba(c, o) for c, o in zip(*make_even(colors, opacities))],)sheen_factor = self.get_sheen_factor()@@ -238,7 +238,12 @@ class VMobject(Mobject):return selfdef set_stroke(- self, color=None, width=None, opacity=None, background=False, family=True+ self,+ color=None,+ width=None,+ opacity=None,+ background=False,+ family=True,):if family:for submobject in self.submobjects:@@ -297,7 +302,9 @@ class VMobject(Mobject):)if sheen_factor:self.set_sheen(- factor=sheen_factor, direction=sheen_direction, family=family+ factor=sheen_factor,+ direction=sheen_direction,+ family=family,)if background_image:self.color_using_background_image(background_image)@@ -363,7 +370,8 @@ class VMobject(Mobject):self.set_fill(opacity=factor * self.get_fill_opacity(), family=False)self.set_stroke(opacity=factor * self.get_stroke_opacity(), family=False)self.set_background_stroke(- opacity=factor * self.get_stroke_opacity(background=True), family=False+ opacity=factor * self.get_stroke_opacity(background=True),+ family=False,)super().fade(darkness, family)return self@@ -483,7 +491,9 @@ class VMobject(Mobject):if family:for submob in self.get_family():submob.sheen_direction = rotate_vector(- submob.sheen_direction, angle, axis+ submob.sheen_direction,+ angle,+ axis,)else:self.sheen_direction = rotate_vector(self.sheen_direction, angle, axis)@@ -539,7 +549,7 @@ class VMobject(Mobject):direction = self.get_sheen_direction()c = self.get_center()bases = np.array(- [self.get_edge_center(vect) - c for vect in [RIGHT, UP, OUT]]+ [self.get_edge_center(vect) - c for vect in [RIGHT, UP, OUT]],).transpose()offset = np.dot(bases, direction)return (c - offset, c + offset)@@ -565,7 +575,6 @@ class VMobject(Mobject):submob.z_index_group = selfreturn self- # Pointsdef set_points(self, points):self.points = np.array(points)return self@@ -624,13 +633,20 @@ class VMobject(Mobject):return selfdef add_cubic_bezier_curve(- self, anchor1: np.ndarray, handle1: np.ndarray, handle2: np.ndarray, anchor2+ self,+ anchor1: np.ndarray,+ handle1: np.ndarray,+ handle2: np.ndarray,+ anchor2,) -> None:# TODO, check the len(self.points) % 4 == 0?self.append_points([anchor1, handle1, handle2, anchor2])def add_cubic_bezier_curve_to(- self, handle1: np.ndarray, handle2: np.ndarray, anchor: np.ndarray+ self,+ handle1: np.ndarray,+ handle2: np.ndarray,+ anchor: np.ndarray,) -> None:"""Add cubic bezier curve to the path.@@ -653,7 +669,9 @@ class VMobject(Mobject):self.append_points([self.get_last_point()] + new_points)def add_quadratic_bezier_curve_to(- self, handle: np.ndarray, anchor: np.ndarray+ self,+ handle: np.ndarray,+ anchor: np.ndarray,) -> "VMobject":"""Add Quadratic bezier curve to the path."""# How does one approximate a quadratic with a cubic?@@ -943,7 +961,9 @@ class VMobject(Mobject):return self.get_cubic_bezier_tuples_from_points(self.points)def _gen_subpaths_from_points(- self, points: np.ndarray, filter_func: typing.Callable[[int], bool]+ self,+ points: np.ndarray,+ filter_func: typing.Callable[[int], bool],) -> typing.Tuple:"""Given an array of points defining the bezier curves of the vmobject, return subpaths formed by these points.Here, Two bezier curves form a path if at least two of their anchors are evaluated True by the relation defined by filter_func.@@ -979,7 +999,7 @@ class VMobject(Mobject):self._gen_subpaths_from_points(points,lambda n: not self.consider_points_equals(points[n - 1], points[n]),- )+ ),)def gen_subpaths_from_points_2d(self, points):@@ -1033,7 +1053,9 @@ class VMobject(Mobject):return bezier(self.get_nth_curve_points(n))def get_nth_curve_length(- self, n: int, sample_points: Optional[int] = None+ self,+ n: int,+ sample_points: Optional[int] = None,) -> float:"""Returns the (approximate) length of the nth curve.@@ -1055,7 +1077,9 @@ class VMobject(Mobject):return lengthdef get_nth_curve_function_with_length(- self, n: int, sample_points: Optional[int] = None+ self,+ n: int,+ sample_points: Optional[int] = None,) -> typing.Tuple[typing.Callable[[float], np.ndarray], float]:"""Returns the expression of the nth curve along with its (approximate) length.@@ -1165,7 +1189,7 @@ class VMobject(Mobject):curves_and_lengths = tuple(self.get_curve_functions_with_lengths())- target_length = alpha * np.sum(length for _, length in curves_and_lengths)+ target_length = alpha * sum(length for _, length in curves_and_lengths)current_length = 0for curve, length in curves_and_lengths:@@ -1220,7 +1244,8 @@ class VMobject(Mobject):control_points = self.get_nth_curve_points(n)length = self.get_nth_curve_length(n)proportions_along_bezier = proportions_along_bezier_curve_for_point(- point, control_points+ point,+ control_points,)if len(proportions_along_bezier) > 0:proportion_along_nth_curve = max(proportions_along_bezier)@@ -1280,7 +1305,7 @@ class VMobject(Mobject):if self.points.shape[0] == 1:return self.pointsreturn np.array(- list(it.chain(*zip(self.get_start_anchors(), self.get_end_anchors())))+ list(it.chain(*zip(self.get_start_anchors(), self.get_end_anchors()))),)def get_points_defining_boundary(self):@@ -1301,10 +1326,10 @@ class VMobject(Mobject):The length of the :class:`VMobject`."""- return np.sum(+ return sum(lengthfor _, length in self.get_curve_functions_with_lengths(- sample_points=sample_points_per_curve+ sample_points=sample_points_per_curve,))@@ -1421,7 +1446,9 @@ class VMobject(Mobject):alphas = np.linspace(0, 1, sf + 1)for a1, a2 in zip(alphas, alphas[1:]):new_points = np.append(- new_points, partial_bezier_points(quad, a1, a2), axis=0+ new_points,+ partial_bezier_points(quad, a1, a2),+ axis=0,)return new_points@@ -1465,7 +1492,10 @@ class VMobject(Mobject):setattr(self, attr, getattr(mobject2, attr))def pointwise_become_partial(- self, vmobject: "VMobject", a: float, b: float+ self,+ vmobject: "VMobject",+ a: float,+ b: float,) -> "VMobject":"""Given two bounds a and b, transforms the points of the self vmobject into the points of the vmobjectpassed as parameter with respect to the bounds. Points here stand for control points of the bezier curves (anchors and handles)@@ -1502,17 +1532,19 @@ class VMobject(Mobject):if lower_index == upper_index:self.append_points(partial_bezier_points(- bezier_quads[lower_index], lower_residue, upper_residue- )+ bezier_quads[lower_index],+ lower_residue,+ upper_residue,+ ),)else:self.append_points(- partial_bezier_points(bezier_quads[lower_index], lower_residue, 1)+ partial_bezier_points(bezier_quads[lower_index], lower_residue, 1),)for quad in bezier_quads[lower_index + 1 : upper_index]:self.append_points(quad)self.append_points(- partial_bezier_points(bezier_quads[upper_index], 0, upper_residue)+ partial_bezier_points(bezier_quads[upper_index], 0, upper_residue),)return self@@ -2215,7 +2247,8 @@ class DashedVMobject(VMobject, metaclass=ConvertToOpenGL):self.add(*(vmobject.get_subcurve(- i * (dash_len + void_len), i * (dash_len + void_len) + dash_len+ i * (dash_len + void_len),+ i * (dash_len + void_len) + dash_len,)for i in range(n))diff --git a/manim/mobject/vector_field.py b/manim/mobject/vector_field.pyindex cc77548f7..7558101d1 100644--- a/manim/mobject/vector_field.py+++ b/manim/mobject/vector_field.py@@ -91,7 +91,9 @@ class VectorField(VGroup):max_color_scheme_value,)alpha = inverse_interpolate(- min_color_scheme_value, max_color_scheme_value, color_value+ min_color_scheme_value,+ max_color_scheme_value,+ color_value,)alpha *= len(self.rgbs) - 1c1 = self.rgbs[int(alpha)]@@ -108,7 +110,8 @@ class VectorField(VGroup):@staticmethoddef shift_func(- func: Callable[[np.ndarray], np.ndarray], shift_vector: np.ndarray+ func: Callable[[np.ndarray], np.ndarray],+ shift_vector: np.ndarray,) -> Callable[[np.ndarray], np.ndarray]:"""Shift a vector field function.@@ -129,7 +132,8 @@ class VectorField(VGroup):@staticmethoddef scale_func(- func: Callable[[np.ndarray], np.ndarray], scalar: float+ func: Callable[[np.ndarray], np.ndarray],+ scalar: float,) -> Callable[[np.ndarray], np.ndarray]:"""Scale a vector field function.@@ -164,7 +168,11 @@ class VectorField(VGroup):return lambda p: func(p * scalar)def nudge(- self, mob: Mobject, dt: float = 1, substeps: int = 1, pointwise: bool = False+ self,+ mob: Mobject,+ dt: float = 1,+ substeps: int = 1,+ pointwise: bool = False,) -> "VectorField":"""Nudge a :class:`~.Mobject` along the vector field.@@ -235,7 +243,7 @@ class VectorField(VGroup):return step_size / 6.0 * (k_1 + 2.0 * k_2 + 2.0 * k_3 + k_4)step_size = dt / substeps- for i in range(substeps):+ for _ in range(substeps):if pointwise:mob.apply_function(lambda p: p + runge_kutta(self, p, step_size))else:@@ -243,7 +251,10 @@ class VectorField(VGroup):return selfdef nudge_submobjects(- self, dt: float = 1, substeps: int = 1, pointwise: bool = False+ self,+ dt: float = 1,+ substeps: int = 1,+ pointwise: bool = False,) -> "VectorField":"""Apply a nudge along the vector field to all submobjects.@@ -269,7 +280,9 @@ class VectorField(VGroup):return selfdef get_nudge_updater(- self, speed: float = 1, pointwise: bool = False+ self,+ speed: float = 1,+ pointwise: bool = False,) -> Callable[[Mobject, float], Mobject]:"""Get an update function to move a :class:`~.Mobject` along the vector field.@@ -290,7 +303,9 @@ class VectorField(VGroup):return lambda mob, dt: self.nudge(mob, dt * speed, pointwise=pointwise)def start_submobject_movement(- self, speed: float = 1, pointwise: bool = False+ self,+ speed: float = 1,+ pointwise: bool = False,) -> "VectorField":"""Start continuously moving all submobjects along the vector field.@@ -312,7 +327,8 @@ class VectorField(VGroup):self.stop_submobject_movement()self.submob_movement_updater = lambda mob, dt: mob.nudge_submobjects(- dt * speed, pointwise=pointwise+ dt * speed,+ pointwise=pointwise,)self.add_updater(self.submob_movement_updater)return self@@ -351,7 +367,7 @@ class VectorField(VGroup):"""if self.single_color:raise ValueError(- "There is no point in generating an image if the vector field uses a single color."+ "There is no point in generating an image if the vector field uses a single color.",)ph = int(config["pixel_height"] / sampling_rate)pw = int(config["pixel_width"] / sampling_rate)@@ -522,7 +538,7 @@ class ArrowVectorField(VectorField):"""output = np.array(self.func(point))norm = np.linalg.norm(output)- if not norm == 0:+ if norm != 0:output *= self.length_func(norm) / normvect = Vector(output, **self.vector_config)vect.shift(point)@@ -679,7 +695,7 @@ class StreamLines(VectorField):for n in range(self.n_repeats)for x in np.arange(self.x_min, self.x_max + self.delta_x, self.delta_x)for y in np.arange(self.y_min, self.y_max + self.delta_y, self.delta_y)- ]+ ],)def outside_box(p):@@ -695,13 +711,14 @@ class StreamLines(VectorField):self.background_img = self.get_colored_background_image()for point in start_points:points = [point]- for step in range(max_steps):+ for _ in range(max_steps):last_point = points[-1]new_point = last_point + dt * func(last_point)if outside_box(new_point):breakpoints.append(new_point)- if step == 0:+ step = max_steps+ if not step:continueline = VMobject()line.duration = step * dt@@ -921,10 +938,12 @@ class StreamLines(VectorField):animations.append(Succession(UpdateFromAlphaFunc(- line, hide_and_wait, run_time=-line.time / self.flow_speed+ line,+ hide_and_wait,+ run_time=-line.time / self.flow_speed,),create,- )+ ),)self.remove(line.anim.mobject)line.anim.finish()@@ -933,10 +952,12 @@ class StreamLines(VectorField):animations.append(Succession(UpdateFromAlphaFunc(- line, finish_updater_cycle, run_time=remaining_time+ line,+ finish_updater_cycle,+ run_time=remaining_time,),create,- )+ ),)return AnimationGroup(*animations)diff --git a/manim/renderer/cairo_renderer.py b/manim/renderer/cairo_renderer.pyindex fc7da7a95..2c619208c 100644--- a/manim/renderer/cairo_renderer.py+++ b/manim/renderer/cairo_renderer.py@@ -101,7 +101,10 @@ class CairoRenderer:hash_current_animation = f"uncached_{self.num_plays:05}"else:hash_current_animation = get_hash_from_play_call(- scene, self.camera, scene.animations, scene.mobjects+ scene,+ self.camera,+ scene.animations,+ scene.mobjects,)if self.file_writer.is_already_cached(hash_current_animation):logger.info(@@ -230,7 +233,9 @@ class CairoRenderer:self.camera.get_image().show()def save_static_frame_data(- self, scene, static_mobjects: typing.Iterable[Mobject]+ self,+ scene,+ static_mobjects: typing.Iterable[Mobject],) -> typing.Iterable[Mobject]:"""Compute and save the static frame, that will be reused at each frame to avoid to unecesseraly computerstatic mobjects.@@ -264,13 +269,17 @@ class CairoRenderer:"""if config["save_last_frame"]:self.skip_animations = True- if config["from_animation_number"]:- if self.num_plays < config["from_animation_number"]:- self.skip_animations = True- if config["upto_animation_number"]:- if self.num_plays > config["upto_animation_number"]:- self.skip_animations = True- raise EndSceneEarlyException()+ if (+ config["from_animation_number"]+ and self.num_plays < config["from_animation_number"]+ ):+ self.skip_animations = True+ if (+ config["upto_animation_number"]+ and self.num_plays > config["upto_animation_number"]+ ):+ self.skip_animations = True+ raise EndSceneEarlyException()def scene_finished(self, scene):# If no animations in scene, render an image insteaddiff --git a/manim/renderer/opengl_renderer.py b/manim/renderer/opengl_renderer.pyindex 8ef16274a..5cadf7c3a 100644--- a/manim/renderer/opengl_renderer.py+++ b/manim/renderer/opengl_renderer.py@@ -57,12 +57,12 @@ class OpenGLCamera(OpenGLMobject):if self.orthographic:self.projection_matrix = opengl.orthographic_projection_matrix()self.unformatted_projection_matrix = opengl.orthographic_projection_matrix(- format=False+ format=False,)else:self.projection_matrix = opengl.perspective_projection_matrix()self.unformatted_projection_matrix = opengl.perspective_projection_matrix(- format=False+ format=False,)if frame_shape is None:@@ -254,7 +254,8 @@ class OpenGLRenderer:self.context = moderngl.create_context(standalone=True)except Exception:self.context = moderngl.create_context(- standalone=True, backend="egl"+ standalone=True,+ backend="egl",)self.frame_buffer_object = self.get_frame_buffer_object(self.context, 0)self.frame_buffer_object.use()@@ -313,7 +314,8 @@ class OpenGLRenderer:# Set uniforms.for name, value in it.chain(- shader_wrapper.uniforms.items(), self.perspective_uniforms.items()+ shader_wrapper.uniforms.items(),+ self.perspective_uniforms.items(),):try:shader.set_uniform(name, value)@@ -322,7 +324,8 @@ class OpenGLRenderer:try:shader.set_uniform("u_view_matrix", self.scene.camera.get_view_matrix())shader.set_uniform(- "u_projection_matrix", self.scene.camera.projection_matrix+ "u_projection_matrix",+ self.scene.camera.projection_matrix,)except KeyError:pass@@ -366,13 +369,17 @@ class OpenGLRenderer:the number of animations that need to be played, andraises an EndSceneEarlyException if they don't correspond."""- if config["from_animation_number"]:- if self.num_plays < config["from_animation_number"]:- self.skip_animations = True- if config["upto_animation_number"]:- if self.num_plays > config["upto_animation_number"]:- self.skip_animations = True- raise EndSceneEarlyException()+ if (+ config["from_animation_number"]+ and self.num_plays < config["from_animation_number"]+ ):+ self.skip_animations = True+ if (+ config["upto_animation_number"]+ and self.num_plays > config["upto_animation_number"]+ ):+ self.skip_animations = True+ raise EndSceneEarlyException()@handle_caching_play@handle_play_like_call@@ -461,7 +468,8 @@ class OpenGLRenderer:samples=samples,),depth_attachment=context.depth_renderbuffer(- (pixel_width, pixel_height), samples=samples+ (pixel_width, pixel_height),+ samples=samples,),)diff --git a/manim/renderer/opengl_renderer_window.py b/manim/renderer/opengl_renderer_window.pyindex 962ae087d..7cc888333 100644--- a/manim/renderer/opengl_renderer_window.py+++ b/manim/renderer/opengl_renderer_window.py@@ -28,7 +28,7 @@ class Window(PygletWindow):# by default window_height = 9/16 * window_widthwindow_height = int(- window_width * config.frame_height // config.frame_width+ window_width * config.frame_height // config.frame_width,)size = (window_width, window_height)else:@@ -61,7 +61,9 @@ class Window(PygletWindow):super().on_mouse_scroll(x, y, x_offset, y_offset)point = self.renderer.pixel_coords_to_space_coords(x, y)offset = self.renderer.pixel_coords_to_space_coords(- x_offset, y_offset, relative=True+ x_offset,+ y_offset,+ relative=True,)self.renderer.scene.on_mouse_scroll(point, offset)@@ -89,12 +91,12 @@ class Window(PygletWindow):# x,y for integers x and yif len(custom_position) == 1:raise ValueError(- "window_position must specify both Y and X positions (Y/X -> UR). Also accepts LEFT/RIGHT/ORIGIN/UP/DOWN."+ "window_position must specify both Y and X positions (Y/X -> UR). Also accepts LEFT/RIGHT/ORIGIN/UP/DOWN.",)# in the form Y/X (UR)- if custom_position == "LEFT" or custom_position == "RIGHT":+ if custom_position in ["LEFT", "RIGHT"]:custom_position = "O" + custom_position[0]- elif custom_position == "UP" or custom_position == "DOWN":+ elif custom_position in ["UP", "DOWN"]:custom_position = custom_position[0] + "O"elif custom_position == "ORIGIN":custom_position = "O" * 2diff --git a/manim/renderer/shader.py b/manim/renderer/shader.pyindex 73262212f..dd7205729 100644--- a/manim/renderer/shader.py+++ b/manim/renderer/shader.py@@ -28,12 +28,14 @@ def get_shader_code_from_file(file_path):with open(file_path) as f:source = f.read()include_lines = re.finditer(- r"^#include (?P<include_path>.*\.glsl)$", source, flags=re.MULTILINE+ r"^#include (?P<include_path>.*\.glsl)$",+ source,+ flags=re.MULTILINE,)for match in include_lines:include_path = match.group("include_path")included_code = get_shader_code_from_file(- os.path.join(file_path.parent / include_path)+ os.path.join(file_path.parent / include_path),)source = source.replace(match.group(0), included_code)file_path_to_code_map[file_path] = source@@ -50,7 +52,7 @@ def filter_attributes(unfiltered_attributes, attributes):dtype_name,unfiltered_attributes.dtype[i].subdtype[0].str,unfiltered_attributes.dtype[i].shape,- )+ ),)filtered_attributes = np.zeros(@@ -107,7 +109,7 @@ class Object3D:for child in children:if child.parent is not None:raise Exception(- "Attempt to add child that's already added to another Object3D"+ "Attempt to add child that's already added to another Object3D",)self.remove(*children, current_children_only=False)self.children.extend(children)@@ -119,7 +121,7 @@ class Object3D:for child in children:if child.parent != self:raise Exception(- "Attempt to remove child that isn't added to this Object3D"+ "Attempt to remove child that isn't added to this Object3D",)self.children = list(filter(lambda child: child not in children, self.children))for child in children:@@ -269,7 +271,7 @@ class Mesh(Object3D):else:raise Exception("Mesh requires either attributes and a Shader or a Geometry and a "- "Material"+ "Material",)self.use_depth_test = use_depth_testself.primitive = primitive@@ -292,7 +294,8 @@ class Mesh(Object3D):def set_uniforms(self, renderer):self.shader.set_uniform(- "u_model_matrix", opengl.matrix_to_shader_input(self.model_matrix)+ "u_model_matrix",+ opengl.matrix_to_shader_input(self.model_matrix),)self.shader.set_uniform("u_view_matrix", renderer.camera.get_view_matrix())self.shader.set_uniform(@@ -429,7 +432,8 @@ class FullScreenQuad(Mesh):)shader.set_uniform("u_model_view_matrix", opengl.view_matrix())shader.set_uniform(- "u_projection_matrix", opengl.orthographic_projection_matrix()+ "u_projection_matrix",+ opengl.orthographic_projection_matrix(),)super().__init__(shader, attributes)diff --git a/manim/renderer/shader_wrapper.py b/manim/renderer/shader_wrapper.pyindex 5b845c508..045f8781e 100644--- a/manim/renderer/shader_wrapper.py+++ b/manim/renderer/shader_wrapper.py@@ -71,7 +71,7 @@ class ShaderWrapper:self.vert_data is not None,self.program_code["vertex_shader"] is not None,self.program_code["fragment_shader"] is not None,- ]+ ],)def get_id(self):@@ -92,7 +92,7 @@ class ShaderWrapper:self.depth_test,self.render_primitive,],- )+ ),)def refresh_id(self):@@ -104,13 +104,13 @@ class ShaderWrapper:"".join(self.program_code[f"{name}_shader"] or ""for name in ("vertex", "geometry", "fragment")- )+ ),)def init_program_code(self):def get_code(name):return get_shader_code_from_file(- os.path.join(self.shader_folder, f"{name}.glsl")+ os.path.join(self.shader_folder, f"{name}.glsl"),)self.program_code = {@@ -124,7 +124,7 @@ class ShaderWrapper:def replace_code(self, old, new):code_map = self.program_code- for (name, code) in code_map.items():+ for (name, _code) in code_map.items():if code_map[name] is None:continuecode_map[name] = re.sub(old, new, code_map[name])@@ -146,7 +146,7 @@ class ShaderWrapper:self.vert_data = np.hstack(data_list)else:self.vert_data = np.hstack(- [self.vert_data, *(sw.vert_data for sw in shader_wrappers)]+ [self.vert_data, *(sw.vert_data for sw in shader_wrappers)],)return self@@ -177,11 +177,13 @@ def get_shader_code_from_file(filename):# passing to ctx.program for compiling# Replace "#INSERT " lines with relevant codeinsertions = re.findall(- r"^#include ../include/.*\.glsl$", result, flags=re.MULTILINE+ r"^#include ../include/.*\.glsl$",+ result,+ flags=re.MULTILINE,)for line in insertions:inserted_code = get_shader_code_from_file(- os.path.join("inserts", line.replace("#include ../include/", ""))+ os.path.join("inserts", line.replace("#include ../include/", "")),)result = result.replace(line, inserted_code)filename_to_code_map[filename] = resultdiff --git a/manim/renderer/shaders/include/NOTE.md b/manim/renderer/shaders/include/NOTE.mdindex 45f0c1388..5aada430b 100644--- a/manim/renderer/shaders/include/NOTE.md+++ b/manim/renderer/shaders/include/NOTE.md@@ -1,4 +1,4 @@-There seems to be no analog to #include in C++ for OpenGL shaders. While there are other options for sharing code between shaders, a lot of them aren't great, especially if the goal is to have all the logic for which specific bits of code to share handled in the shader file itself. So the way manim currently works is to replace any line which looks like+There seems to be no analog to #include in C++ for OpenGL shaders. While there are other options for sharing code between shaders, a lot of them aren't great, especially if the goal is to have all the logic for which specific bits of code to share handled in the shader file itself. So the way manim currently works is to replace any line which looks like#INSERT <file_name>diff --git a/manim/renderer/shaders/include/add_light.glsl b/manim/renderer/shaders/include/add_light.glslindex f0f32c8d9..cc6291994 100644--- a/manim/renderer/shaders/include/add_light.glsl+++ b/manim/renderer/shaders/include/add_light.glsl@@ -17,7 +17,7 @@ vec4 add_light(vec4 color,}// TODO, read this in as a uniform?- float camera_distance = 6;+ float camera_distance = 6;// Assume everything has already been rotated such that camera is in the z-directionvec3 to_camera = vec3(0, 0, camera_distance) - point;vec3 to_light = light_coords - point;diff --git a/manim/renderer/shaders/include/finalize_color.glsl b/manim/renderer/shaders/include/finalize_color.glslindex 7324fc155..26b10376a 100644--- a/manim/renderer/shaders/include/finalize_color.glsl+++ b/manim/renderer/shaders/include/finalize_color.glsl@@ -23,7 +23,7 @@ vec4 add_light(vec4 color,}// TODO, read this in as a uniform?- float camera_distance = 6;+ float camera_distance = 6;// Assume everything has already been rotated such that camera is in the z-directionvec3 to_camera = vec3(0, 0, camera_distance) - point;vec3 to_light = light_coords - point;diff --git a/manim/renderer/shaders/include/quadratic_bezier_distance.glsl b/manim/renderer/shaders/include/quadratic_bezier_distance.glslindex 7f2c5d5dd..847fa4ab6 100644--- a/manim/renderer/shaders/include/quadratic_bezier_distance.glsl+++ b/manim/renderer/shaders/include/quadratic_bezier_distance.glsl@@ -56,7 +56,7 @@ int cubic_solve(float a, float b, float c, float d, out float roots[3]){int n_valid_roots = 0;for(int i = 0; i < 3; i++){float r = all_roots[i];- if(3*r*r + 2*b*r + c > 0){+ if(3*r*r + 2*b*r + c > 0){roots[n_valid_roots] = r;n_valid_roots++;}@@ -98,7 +98,7 @@ float min_dist_to_curve(vec2 p, vec2 b2, float degree){float d = -p.x;float roots[3];- int n = cubic_solve(a, b, c, d, roots);+ int n = cubic_solve(a, b, c, d, roots);// At most 2 roots will have been populated.float d0 = dist_to_point_on_curve(p, roots[0], b2);if(n == 1) return d0;diff --git a/manim/renderer/shaders/inserts/NOTE.md b/manim/renderer/shaders/inserts/NOTE.mdindex 45f0c1388..5aada430b 100644--- a/manim/renderer/shaders/inserts/NOTE.md+++ b/manim/renderer/shaders/inserts/NOTE.md@@ -1,4 +1,4 @@-There seems to be no analog to #include in C++ for OpenGL shaders. While there are other options for sharing code between shaders, a lot of them aren't great, especially if the goal is to have all the logic for which specific bits of code to share handled in the shader file itself. So the way manim currently works is to replace any line which looks like+There seems to be no analog to #include in C++ for OpenGL shaders. While there are other options for sharing code between shaders, a lot of them aren't great, especially if the goal is to have all the logic for which specific bits of code to share handled in the shader file itself. So the way manim currently works is to replace any line which looks like#INSERT <file_name>diff --git a/manim/renderer/shaders/inserts/add_light.glsl b/manim/renderer/shaders/inserts/add_light.glslindex f0f32c8d9..cc6291994 100644--- a/manim/renderer/shaders/inserts/add_light.glsl+++ b/manim/renderer/shaders/inserts/add_light.glsl@@ -17,7 +17,7 @@ vec4 add_light(vec4 color,}// TODO, read this in as a uniform?- float camera_distance = 6;+ float camera_distance = 6;// Assume everything has already been rotated such that camera is in the z-directionvec3 to_camera = vec3(0, 0, camera_distance) - point;vec3 to_light = light_coords - point;diff --git a/manim/renderer/shaders/inserts/finalize_color.glsl b/manim/renderer/shaders/inserts/finalize_color.glslindex 7324fc155..26b10376a 100644--- a/manim/renderer/shaders/inserts/finalize_color.glsl+++ b/manim/renderer/shaders/inserts/finalize_color.glsl@@ -23,7 +23,7 @@ vec4 add_light(vec4 color,}// TODO, read this in as a uniform?- float camera_distance = 6;+ float camera_distance = 6;// Assume everything has already been rotated such that camera is in the z-directionvec3 to_camera = vec3(0, 0, camera_distance) - point;vec3 to_light = light_coords - point;diff --git a/manim/renderer/shaders/inserts/quadratic_bezier_distance.glsl b/manim/renderer/shaders/inserts/quadratic_bezier_distance.glslindex 7f2c5d5dd..847fa4ab6 100644--- a/manim/renderer/shaders/inserts/quadratic_bezier_distance.glsl+++ b/manim/renderer/shaders/inserts/quadratic_bezier_distance.glsl@@ -56,7 +56,7 @@ int cubic_solve(float a, float b, float c, float d, out float roots[3]){int n_valid_roots = 0;for(int i = 0; i < 3; i++){float r = all_roots[i];- if(3*r*r + 2*b*r + c > 0){+ if(3*r*r + 2*b*r + c > 0){roots[n_valid_roots] = r;n_valid_roots++;}@@ -98,7 +98,7 @@ float min_dist_to_curve(vec2 p, vec2 b2, float degree){float d = -p.x;float roots[3];- int n = cubic_solve(a, b, c, d, roots);+ int n = cubic_solve(a, b, c, d, roots);// At most 2 roots will have been populated.float d0 = dist_to_point_on_curve(p, roots[0], b2);if(n == 1) return d0;diff --git a/manim/renderer/shaders/quadratic_bezier_fill/geom.glsl b/manim/renderer/shaders/quadratic_bezier_fill/geom.glslindex dcb4ab364..eef64b29d 100644--- a/manim/renderer/shaders/quadratic_bezier_fill/geom.glsl+++ b/manim/renderer/shaders/quadratic_bezier_fill/geom.glsl@@ -131,4 +131,3 @@ void main(){}// Don't emit any vertices for bezier_degree 0}-diff --git a/manim/renderer/shaders/true_dot/geom.glsl b/manim/renderer/shaders/true_dot/geom.glslindex ba407e124..934499cc0 100644--- a/manim/renderer/shaders/true_dot/geom.glsl+++ b/manim/renderer/shaders/true_dot/geom.glsl@@ -24,7 +24,7 @@ void main() {color = v_color[0];point_radius = v_point_radius[0];center = v_point[0].xy;-+point_radius = v_point_radius[0] / max(1.0 - v_point[0].z / focal_distance / frame_shape.y, 0.0);float rpa = point_radius + anti_alias_width;diff --git a/manim/renderer/shaders/vectorized_mobject_stroke/frag.glsl b/manim/renderer/shaders/vectorized_mobject_stroke/frag.glslindex 13deca223..2eca6f163 100644--- a/manim/renderer/shaders/vectorized_mobject_stroke/frag.glsl+++ b/manim/renderer/shaders/vectorized_mobject_stroke/frag.glsl@@ -16,11 +16,11 @@ float testCross(vec2 a, vec2 b, vec2 p) {// Determine which side we're on (using barycentric parameterization)float signBezier(vec2 A, vec2 B, vec2 C, vec2 p)-{+{vec2 a = C - A, b = B - A, c = p - A;vec2 bary = vec2(c.x*b.y-b.x*c.y,a.x*c.y-c.x*a.y) / (a.x*b.y-b.x*a.y);vec2 d = vec2(bary.y * 0.5, 0.0) + 1.0 - bary.x - bary.y;- return mix(sign(d.x * d.x - d.y), mix(-1.0, 1.0,+ return mix(sign(d.x * d.x - d.y), mix(-1.0, 1.0,step(testCross(A, B, p) * testCross(B, C, p), 0.0)),step((d.x - d.y), 0.0)) * testCross(A, C, B);}@@ -32,7 +32,7 @@ vec3 solveCubic(float a, float b, float c)float q = a * (2.0*a*a - 9.0*b) / 27.0 + c;float d = q*q + 4.0*p3 / 27.0;float offset = -a / 3.0;- if(d >= 0.0) {+ if(d >= 0.0) {float z = sqrt(d);vec2 x = (vec2(z, -z) - q) / 2.0;vec2 uv = sign(x)*pow(abs(x), vec2(1.0/3.0));@@ -45,10 +45,10 @@ vec3 solveCubic(float a, float b, float c)// Find the signed distance from a point to a bezier curvefloat sdBezier(vec2 A, vec2 B, vec2 C, vec2 p)-{+{B = mix(B + vec2(1e-4), B, abs(sign(B * 2.0 - A - C)));vec2 a = B - A, b = A - B * 2.0 + C, c = a * 2.0, d = A - p;- vec3 k = vec3(3.*dot(a,b),2.*dot(a,a)+dot(d,b),dot(d,a)) / dot(b,b);+ vec3 k = vec3(3.*dot(a,b),2.*dot(a,a)+dot(d,b),dot(d,a)) / dot(b,b);vec3 t = clamp(solveCubic(k.x, k.y, k.z), 0.0, 1.0);vec2 pos = A + (c + b*t.x)*t.x;float dis = length(pos - p);@@ -63,7 +63,7 @@ float sdBezier(vec2 A, vec2 B, vec2 C, vec2 p)float dLine(vec2 p1, vec2 p2, vec2 x) {vec4 colA = vec4(clamp (5.0 - length (x - p1), 0.0, 1.0));vec4 colB = vec4(clamp (5.0 - length (x - p2), 0.0, 1.0));-+vec2 a_p1 = x - p1;vec2 p2_p1 = p2 - p1;float h = clamp (dot (a_p1, p2_p1) / dot (p2_p1, p2_p1), 0.0, 1.0);diff --git a/manim/renderer/shaders/vectorized_mobject_stroke/vert.glsl b/manim/renderer/shaders/vectorized_mobject_stroke/vert.glslindex 5551eed14..63982ee71 100644--- a/manim/renderer/shaders/vectorized_mobject_stroke/vert.glsl+++ b/manim/renderer/shaders/vectorized_mobject_stroke/vert.glsl@@ -55,7 +55,7 @@ vec4 bboxBezier(in vec2 p0, in vec2 p1, in vec2 p2) {mi = min(mi, q);ma = max(ma, q);}-+return vec4(mi, ma);}diff --git a/manim/renderer/vectorized_mobject_rendering.py b/manim/renderer/vectorized_mobject_rendering.pyindex fde06d2da..1d022486b 100644--- a/manim/renderer/vectorized_mobject_rendering.py+++ b/manim/renderer/vectorized_mobject_rendering.py@@ -24,7 +24,7 @@ def build_matrix_lists(mob):mobject_to_hierarchical_matrix[child] = child_hierarchical_matrixif child.has_points():matrix_to_mobject_list[tuple(child_hierarchical_matrix.ravel())].append(- child+ child,)dfs.append(child)return matrix_to_mobject_list@@ -63,7 +63,9 @@ def render_mobject_fills_with_matrix(renderer, model_matrix, mobjects):end_offset = write_offset + mobject_triangulation.shape[0]attributes[write_offset:end_offset] = mobject_triangulationattributes["in_color"][write_offset:end_offset] = np.repeat(- submob.fill_rgba, mobject_triangulation.shape[0], axis=0+ submob.fill_rgba,+ mobject_triangulation.shape[0],+ axis=0,)write_offset = end_offset@@ -71,7 +73,7 @@ def render_mobject_fills_with_matrix(renderer, model_matrix, mobjects):fill_shader.set_uniform("u_model_view_matrix",opengl.matrix_to_shader_input(- renderer.camera.get_view_matrix(format=False) @ model_matrix+ renderer.camera.get_view_matrix(format=False) @ model_matrix,),)fill_shader.set_uniform(@@ -127,7 +129,7 @@ def triangulate_mobject(mob):indices[0::3],indices[1::3][concave_parts],indices[2::3][end_of_loop],- ]+ ],)inner_vert_indices.sort()rings = np.arange(1, len(inner_vert_indices) + 1)[inner_vert_indices % 3 == 2]@@ -146,7 +148,7 @@ def triangulate_mobject(mob):concave_triangle_indices,convex_triangle_indices,inner_tri_indices,- ]+ ],)]texture_coords = np.tile(@@ -209,10 +211,13 @@ def render_mobject_strokes_with_matrix(renderer, model_matrix, mobjects):points[write_offset:end_offset] = submob.pointscolors[write_offset:end_offset] = np.repeat(- submob.stroke_rgba, submob.points.shape[0], axis=0+ submob.stroke_rgba,+ submob.points.shape[0],+ axis=0,)widths[write_offset:end_offset] = np.repeat(- submob.stroke_width, submob.points.shape[0]+ submob.stroke_width,+ submob.points.shape[0],)write_offset = end_offset@@ -255,14 +260,14 @@ def render_mobject_strokes_with_matrix(renderer, model_matrix, mobjects):],(len(points) // 3, 1),),- )+ ),)shader = Shader(renderer.context, "vectorized_mobject_stroke")shader.set_uniform("u_model_view_matrix",opengl.matrix_to_shader_input(- renderer.camera.get_view_matrix(format=False) @ model_matrix+ renderer.camera.get_view_matrix(format=False) @ model_matrix,),)shader.set_uniform("u_projection_matrix", renderer.scene.camera.projection_matrix)diff --git a/manim/renderer/webgl_renderer.py b/manim/renderer/webgl_renderer.pyindex 3b1b6ef3b..4ad5a8e6c 100644--- a/manim/renderer/webgl_renderer.py+++ b/manim/renderer/webgl_renderer.py@@ -1,4 +1,5 @@import copy+from dataclasses import dataclassfrom manim import configdiff --git a/manim/scene/scene.py b/manim/scene/scene.pyindex ec1d5d68e..c94238726 100644--- a/manim/scene/scene.py+++ b/manim/scene/scene.py@@ -175,7 +175,7 @@ class Scene:raise Exception(f"{free_variable_name} is referenced from an updater ""but is not an attribute of the Scene, which isn't "- "allowed."+ "allowed.",)# Add the cloned object's name to the free variable list.@@ -184,7 +184,7 @@ class Scene:# Add a cell containing the cloned object's reference to the# closure list.cloned_closure.append(- types.CellType(clone_from_id[id(free_variable_value)])+ types.CellType(clone_from_id[id(free_variable_value)]),)cloned_updater = types.FunctionType(@@ -231,7 +231,7 @@ class Scene:or config["save_last_frame"]):logger.info(- f"Rendered {str(self)}\nPlayed {self.renderer.num_plays} animations"+ f"Rendered {str(self)}\nPlayed {self.renderer.num_plays} animations",)# If preview open up the render after rendering.@@ -340,7 +340,7 @@ class Scene:bool"""return self.always_update_mobjects or any(- [mob.has_time_based_updater() for mob in self.get_mobject_family_members()]+ [mob.has_time_based_updater() for mob in self.get_mobject_family_members()],)def get_top_level_mobjects(self):@@ -381,7 +381,8 @@ class Scene:return family_memberselse:return extract_mobject_family_members(- self.mobjects, use_z_index=self.renderer.camera.use_z_index+ self.mobjects,+ use_z_index=self.renderer.camera.use_z_index,)def add(self, *mobjects):@@ -418,7 +419,8 @@ class Scene:self.mobjects += mobjectsif self.moving_mobjects:self.restructure_mobjects(- to_remove=mobjects, mobject_list_name="moving_mobjects"+ to_remove=mobjects,+ mobject_list_name="moving_mobjects",)self.moving_mobjects += mobjectsreturn self@@ -453,10 +455,11 @@ class Scene:else:mobjects_to_remove.append(mobject_or_mesh)self.mobjects = restructure_list_to_exclude_certain_family_members(- self.mobjects, mobjects_to_remove+ self.mobjects,+ mobjects_to_remove,)self.meshes = list(- filter(lambda mesh: mesh not in set(meshes_to_remove), self.meshes)+ filter(lambda mesh: mesh not in set(meshes_to_remove), self.meshes),)return selfelse:@@ -471,7 +474,10 @@ class Scene:self.updaters = [f for f in self.updaters if f is not func]def restructure_mobjects(- self, to_remove, mobject_list_name="mobjects", extract_families=True+ self,+ to_remove,+ mobject_list_name="mobjects",+ extract_families=True,):"""tl:wr@@ -502,7 +508,8 @@ class Scene:"""if extract_families:to_remove = extract_mobject_family_members(- to_remove, use_z_index=self.renderer.camera.use_z_index+ to_remove,+ use_z_index=self.renderer.camera.use_z_index,)_list = getattr(self, mobject_list_name)new_list = self.get_restructured_mobject_list(_list, to_remove)@@ -715,7 +722,8 @@ class Scene:use_z_index=self.renderer.camera.use_z_index,)static_mobjects = list_difference_update(- all_mobject_families, all_moving_mobject_families+ all_mobject_families,+ all_moving_mobject_families,)return all_moving_mobject_families, static_mobjects@@ -742,11 +750,11 @@ class Scene:if inspect.ismethod(arg):raise TypeError("Passing Mobject methods to Scene.play is no longer"- " supported. Use Mobject.animate instead."+ " supported. Use Mobject.animate instead.",)else:raise TypeError(- f"Unexpected argument {arg} passed to Scene.play()."+ f"Unexpected argument {arg} passed to Scene.play().",)for animation in animations:@@ -789,7 +797,8 @@ class Scene:)else:time_progression = self.get_time_progression(- duration, f"Waiting {self.renderer.num_plays}"+ duration,+ f"Waiting {self.renderer.num_plays}",)else:time_progression = self.get_time_progression(@@ -799,13 +808,17 @@ class Scene:f"Animation {self.renderer.num_plays}: ",str(animations[0]),(", etc." if len(animations) > 1 else ""),- ]+ ],),)return time_progressiondef get_time_progression(- self, run_time, description, n_iterations=None, override_skip_animations=False+ self,+ run_time,+ description,+ n_iterations=None,+ override_skip_animations=False,):"""You will hardly use this when making your own animations.@@ -924,7 +937,7 @@ class Scene:self.moving_mobjects = []self.static_mobjects = []- if not config.renderer == "opengl":+ if config.renderer != "opengl":if len(self.animations) == 1 and isinstance(self.animations[0], Wait):self.update_mobjects(dt=0) # Any problems with this?if self.should_update_mobjects():@@ -973,7 +986,8 @@ class Scene:"""self.duration = self.get_run_time(self.animations)self.time_progression = self._get_animation_time_progression(- self.animations, self.duration+ self.animations,+ self.duration,)for t in self.time_progression:self.update_to_time(t)@@ -1300,10 +1314,12 @@ class Scene:camera_position = self.camera.get_position()camera_y_axis = self.camera.model_matrix[:3, 1]axis_of_rotation = space_ops.normalize(- np.cross(camera_y_axis, camera_position)+ np.cross(camera_y_axis, camera_position),)rotation_matrix = space_ops.rotation_matrix(- d_point[1], axis_of_rotation, homogeneous=True+ d_point[1],+ axis_of_rotation,+ homogeneous=True,)maximum_polar_angle = self.camera.maximum_polar_angle@@ -1318,21 +1334,24 @@ class Scene:else 1)potential_polar_angle = sign * np.arccos(- potential_camera_location[2] / np.linalg.norm(potential_camera_location)+ potential_camera_location[2]+ / np.linalg.norm(potential_camera_location),)if minimum_polar_angle <= potential_polar_angle <= maximum_polar_angle:self.camera.model_matrix = potential_camera_model_matrixelse:sign = np.sign(camera_y_axis[2]) if camera_y_axis[2] != 0 else 1current_polar_angle = sign * np.arccos(- camera_position[2] / np.linalg.norm(camera_position)+ camera_position[2] / np.linalg.norm(camera_position),)if potential_polar_angle > maximum_polar_angle:polar_angle_delta = maximum_polar_angle - current_polar_angleelse:polar_angle_delta = minimum_polar_angle - current_polar_anglerotation_matrix = space_ops.rotation_matrix(- polar_angle_delta, axis_of_rotation, homogeneous=True+ polar_angle_delta,+ axis_of_rotation,+ homogeneous=True,)self.camera.model_matrix = rotation_matrix @ self.camera.model_matrixdiff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.pyindex 70f62f7e8..cc53402c1 100644--- a/manim/scene/scene_file_writer.py+++ b/manim/scene/scene_file_writer.py@@ -85,21 +85,23 @@ class SceneFileWriter:if config["media_dir"]:image_dir = guarantee_existence(- config.get_dir("images_dir", module_name=module_name)+ config.get_dir("images_dir", module_name=module_name),)self.image_file_path = os.path.join(- image_dir, add_extension_if_not_present(default_name, ".png")+ image_dir,+ add_extension_if_not_present(default_name, ".png"),)if write_to_movie():movie_dir = guarantee_existence(- config.get_dir("video_dir", module_name=module_name)+ config.get_dir("video_dir", module_name=module_name),)self.movie_file_path = os.path.join(movie_dir,add_extension_if_not_present(- default_name, config["movie_file_extension"]+ default_name,+ config["movie_file_extension"],),)if is_gif_format():@@ -113,7 +115,7 @@ class SceneFileWriter:"partial_movie_dir",scene_name=scene_name,module_name=module_name,- )+ ),)def add_partial_movie_file(self, hash_animation):@@ -286,7 +288,7 @@ class SceneFileWriter:if config.renderer == "opengl":renderer = frame_or_rendererself.writing_process.stdin.write(- renderer.get_raw_frame_buffer_object_data()+ renderer.get_raw_frame_buffer_object_data(),)else:frame = frame_or_renderer@@ -296,11 +298,11 @@ class SceneFileWriter:target_dir, extension = os.path.splitext(self.image_file_path)if config["zero_pad"]:Image.fromarray(frame).save(- f"{target_dir}{str(self.frame_count).zfill(config['zero_pad'])}{extension}"+ f"{target_dir}{str(self.frame_count).zfill(config['zero_pad'])}{extension}",)else:Image.fromarray(frame).save(- f"{target_dir}{self.frame_count}{extension}"+ f"{target_dir}{self.frame_count}{extension}",)self.frame_count += 1@@ -466,7 +468,8 @@ class SceneFileWriter:# Write a file partial_file_list.txt containing all partial movie# files. This is used by FFMPEG.file_list = os.path.join(- self.partial_movie_directory, "partial_movie_file_list.txt"+ self.partial_movie_directory,+ "partial_movie_file_list.txt",)logger.debug(f"Partial movie files to combine ({len(partial_movie_files)} files): %(p)s",@@ -501,7 +504,7 @@ class SceneFileWriter:if is_gif_format():if not config["output_file"]:self.gif_file_path = str(- add_version_before_extension(self.gif_file_path)+ add_version_before_extension(self.gif_file_path),)commands += ["-vf",@@ -556,7 +559,7 @@ class SceneFileWriter:os.remove(sound_file_path)self.print_file_ready_message(- self.gif_file_path if is_gif_format() else movie_file_path+ self.gif_file_path if is_gif_format() else movie_file_path,)if write_to_movie():for file_path in partial_movie_files:@@ -583,7 +586,7 @@ class SceneFileWriter:os.remove(file_to_delete)logger.info(f"The partial movie directory is full (> {config['max_files_cached']} files). Therefore, manim has removed {number_files_to_delete} file(s) used by it the longest ago."- + "You can change this behaviour by changing max_files_cached in config."+ + "You can change this behaviour by changing max_files_cached in config.",)def flush_cache_directory(self):diff --git a/manim/scene/three_d_scene.py b/manim/scene/three_d_scene.pyindex c1c99fc76..0cb21ea25 100644--- a/manim/scene/three_d_scene.py+++ b/manim/scene/three_d_scene.py@@ -136,7 +136,10 @@ class ThreeDScene(Scene):self.remove(x)def begin_3dillusion_camera_rotation(- self, rate=1, origin_theta=-60 * DEGREES, origin_phi=75 * DEGREES+ self,+ rate=1,+ origin_theta=-60 * DEGREES,+ origin_phi=75 * DEGREES,):val_tracker_theta = ValueTracker(0)@@ -221,7 +224,7 @@ class ThreeDScene(Scene):anims.append(ApplyMethod(self.renderer.camera._frame_center.move_to, frame_center, **kwargs- )+ ),)self.play(*anims + added_anims)@@ -245,7 +248,7 @@ class ThreeDScene(Scene):"""moving_mobjects = Scene.get_moving_mobjects(self, *animations)camera_mobjects = self.renderer.camera.get_value_trackers() + [- self.renderer.camera._frame_center+ self.renderer.camera._frame_center,]if any([cm in moving_mobjects for cm in camera_mobjects]):return self.mobjects@@ -327,7 +330,7 @@ class ThreeDScene(Scene):which have the same meaning as the parameters in set_camera_orientation."""config = dict(- self.default_camera_orientation_kwargs+ self.default_camera_orientation_kwargs,) # Where doe this come from?config.update(kwargs)self.set_camera_orientation(**config)diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.pyindex 11dc37938..b4b6efb84 100644--- a/manim/scene/vector_space_scene.py+++ b/manim/scene/vector_space_scene.py@@ -341,14 +341,20 @@ class VectorScene(Scene):return labeldef position_x_coordinate(- self, x_coord, x_line, vector+ self,+ x_coord,+ x_line,+ vector,): # TODO Write DocStrings for this.x_coord.next_to(x_line, -np.sign(vector[1]) * UP)x_coord.set_color(X_COLOR)return x_coorddef position_y_coordinate(- self, y_coord, y_line, vector+ self,+ y_coord,+ y_line,+ vector,): # TODO Write DocStrings for this.y_coord.next_to(y_line, np.sign(vector[0]) * RIGHT)y_coord.set_color(Y_COLOR)@@ -391,13 +397,15 @@ class VectorScene(Scene):self.wait()self.play(ApplyFunction(- lambda x: self.position_x_coordinate(x, x_line, vector), x_coord- )+ lambda x: self.position_x_coordinate(x, x_line, vector),+ x_coord,+ ),)self.play(Create(x_line))animations = [ApplyFunction(- lambda y: self.position_y_coordinate(y, y_line, vector), y_coord+ lambda y: self.position_y_coordinate(y, y_line, vector),+ y_coord,),FadeOut(array.get_brackets()),]@@ -761,7 +769,8 @@ class LinearTransformationScene(VectorScene):square = self.get_unit_square(**kwargs)if animate:self.play(- DrawBorderThenFill(square), Animation(Group(*self.moving_vectors))+ DrawBorderThenFill(square),+ Animation(Group(*self.moving_vectors)),)self.add_transformable_mobject(square)self.bring_to_front(*self.moving_vectors)@@ -1062,7 +1071,7 @@ class LinearTransformationScene(VectorScene):func = self.get_transposed_matrix_transformation(transposed_matrix)if "path_arc" not in kwargs:net_rotation = np.mean(- [angle_of_vector(func(RIGHT)), angle_of_vector(func(UP)) - np.pi / 2]+ [angle_of_vector(func(RIGHT)), angle_of_vector(func(UP)) - np.pi / 2],)kwargs["path_arc"] = net_rotationself.apply_function(func, **kwargs)diff --git a/manim/scene/zoomed_scene.py b/manim/scene/zoomed_scene.pyindex aef5a2a19..9abbb208c 100644--- a/manim/scene/zoomed_scene.py+++ b/manim/scene/zoomed_scene.py@@ -124,7 +124,8 @@ class ZoomedScene(MovingCameraScene):zoomed_display.move_to(self.zoomed_display_center)else:zoomed_display.to_corner(- self.zoomed_display_corner, buff=self.zoomed_display_corner_buff+ self.zoomed_display_corner,+ buff=self.zoomed_display_corner_buff,)self.zoomed_camera = zoomed_cameradiff --git a/manim/templates/Axes.mtp b/manim/templates/Axes.mtpindex 4cc444707..8c2b8ed9a 100644--- a/manim/templates/Axes.mtp+++ b/manim/templates/Axes.mtp@@ -8,4 +8,4 @@ class AxesTemplate(Scene):axis_config={"include_tip":False})labels = graph.get_axis_labels()- self.add(graph, labels)\ No newline at end of file+ self.add(graph, labels)diff --git a/manim/utils/bezier.py b/manim/utils/bezier.pyindex 27b28170e..800737a25 100644--- a/manim/utils/bezier.py+++ b/manim/utils/bezier.py@@ -108,7 +108,9 @@ def interpolate(start: int, end: int, alpha: float) -> float:def integer_interpolate(- start: float, end: float, alpha: float+ start: float,+ end: float,+ alpha: float,) -> typing.Tuple[int, float]:"""Alpha is a float between 0 and 1. This returns@@ -139,10 +141,16 @@ def inverse_interpolate(start: float, end: float, value: float) -> np.ndarray:def match_interpolate(- new_start: float, new_end: float, old_start: float, old_end: float, old_value: float+ new_start: float,+ new_end: float,+ old_start: float,+ old_end: float,+ old_value: float,) -> np.ndarray:return interpolate(- new_start, new_end, inverse_interpolate(old_start, old_end, old_value)+ new_start,+ new_end,+ inverse_interpolate(old_start, old_end, old_value),)@@ -291,7 +299,8 @@ def diag_to_matrix(l_and_u: typing.Tuple[int, int], diag: np.ndarray) -> np.ndarmatrix = np.zeros((dim, dim))for i in range(l + u + 1):np.fill_diagonal(- matrix[max(0, i - u) :, max(0, u - i) :], diag[i, max(0, u - i) :]+ matrix[max(0, i - u) :, max(0, u - i) :],+ diag[i, max(0, u - i) :],)return matrix@@ -416,7 +425,7 @@ def proportions_along_bezier_curve_for_point(if not all(np.shape(point) == np.shape(c_p) for c_p in control_points):raise ValueError(- f"Point {point} and Control Points {control_points} have different shapes."+ f"Point {point} and Control Points {control_points} have different shapes.",)control_points = np.array(control_points)diff --git a/manim/utils/caching.py b/manim/utils/caching.pyindex 591f02399..72ff39fb8 100644--- a/manim/utils/caching.py+++ b/manim/utils/caching.py@@ -39,7 +39,10 @@ def handle_caching_play(func):if not config["disable_caching"]:mobjects_on_scene = scene.mobjectshash_play = get_hash_from_play_call(- self, self.camera, animations, mobjects_on_scene+ self,+ self.camera,+ animations,+ mobjects_on_scene,)if self.file_writer.is_already_cached(hash_play):logger.info(diff --git a/manim/utils/color.py b/manim/utils/color.pyindex b11c1f959..d531f4bcb 100644--- a/manim/utils/color.py+++ b/manim/utils/color.py@@ -278,7 +278,7 @@ for name, value in Colors.__members__.items():# print(constants_names)-__all__ += [ # noqa: F822 # used to stop flake8 from complaining about undefined vars+__all__ += [ # used to stop flake8 from complaining about undefined vars"WHITE","GRAY_A","GREY_A",@@ -409,7 +409,8 @@ def color_to_int_rgba(color: Color, opacity: float = 1.0) -> np.ndarray:def color_gradient(- reference_colors: Iterable[Color], length_of_output: int+ reference_colors: Iterable[Color],+ length_of_output: int,) -> List[Color]:if length_of_output == 0:return reference_colors[0]diff --git a/manim/utils/config_ops.py b/manim/utils/config_ops.pyindex c95677fed..12ae00e93 100644--- a/manim/utils/config_ops.py+++ b/manim/utils/config_ops.py@@ -8,6 +8,7 @@ __all__ = [import itertools as it+from dataclasses import dataclassimport numpy as npdiff --git a/manim/utils/deprecation.py b/manim/utils/deprecation.pyindex 82f84797a..8509cc1b2 100644--- a/manim/utils/deprecation.py+++ b/manim/utils/deprecation.py@@ -36,7 +36,9 @@ def _get_callable_info(callable: Callable) -> Tuple[str, str]:def _deprecation_text_component(- since: Optional[str], until: Optional[str], message: str+ since: Optional[str],+ until: Optional[str],+ message: str,) -> str:"""Generates a text component used in deprecation messages.diff --git a/manim/utils/family.py b/manim/utils/family.pyindex ae2aac49a..2053935c0 100644--- a/manim/utils/family.py+++ b/manim/utils/family.py@@ -5,7 +5,9 @@ from ..utils.iterables import remove_list_redundanciesdef extract_mobject_family_members(- mobjects, use_z_index=False, only_those_with_points=False+ mobjects,+ use_z_index=False,+ only_those_with_points=False,):"""Returns a list of the types of mobjects and their family members present.A "family" in this context refers to a mobject, its submobjects, and their@@ -29,7 +31,7 @@ def extract_mobject_family_members(else:method = Mobject.get_familyextracted_mobjects = remove_list_redundancies(- list(it.chain(*(method(m) for m in mobjects)))+ list(it.chain(*(method(m) for m in mobjects))),)if use_z_index:return sorted(extracted_mobjects, key=lambda m: m.z_index)diff --git a/manim/utils/file_ops.py b/manim/utils/file_ops.pyindex 35cea0e2d..dfb692d45 100644--- a/manim/utils/file_ops.py+++ b/manim/utils/file_ops.py@@ -239,10 +239,10 @@ def copy_template_files(project_dir=Path("."), template_name="Default"):Name of template."""template_cfg_path = Path.resolve(- Path(__file__).parent.parent / "templates/template.cfg"+ Path(__file__).parent.parent / "templates/template.cfg",)template_scene_path = Path.resolve(- Path(__file__).parent.parent / f"templates/{template_name}.mtp"+ Path(__file__).parent.parent / f"templates/{template_name}.mtp",)if not template_cfg_path.exists():diff --git a/manim/utils/hashing.py b/manim/utils/hashing.pyindex ed9424799..b4afe9cdf 100644--- a/manim/utils/hashing.py+++ b/manim/utils/hashing.py@@ -64,7 +64,8 @@ class _Memoizer:# a method or a function.if is_method:return lambda self, obj: cls._handle_already_processed(- obj, default_function=lambda obj: func(self, obj)+ obj,+ default_function=lambda obj: func(self, obj),)return lambda obj: cls._handle_already_processed(obj, default_function=func)@@ -103,7 +104,9 @@ class _Memoizer:@classmethoddef _handle_already_processed(- cls, obj, default_function: typing.Callable[[Any], Any]+ cls,+ obj,+ default_function: typing.Callable[[Any], Any],):if (isinstance(@@ -150,11 +153,11 @@ class _Memoizer:"It looks like the scene contains a lot of sub-mobjects. Caching ""is sometimes not suited to handle such large scenes, you might ""consider disabling caching with --disable_caching to potentially "- "speed up the rendering process."+ "speed up the rendering process.",)logger.warning("You can disable this warning by setting disable_caching_warning "- "to True in your config file."+ "to True in your config file.",)cls._already_processed.add(obj_membership_sign)@@ -186,7 +189,8 @@ class _CustomEncoder(json.JSONEncoder):"""if not (isinstance(obj, ModuleType)) and isinstance(- obj, (MethodType, FunctionType)+ obj,+ (MethodType, FunctionType),):cvars = inspect.getclosurevars(obj)cvardict = {**copy.copy(cvars.globals), **copy.copy(cvars.nonlocals)}@@ -311,7 +315,10 @@ def get_json(obj):def get_hash_from_play_call(- scene_object, camera_object, animations_list, current_mobjects_list+ scene_object,+ camera_object,+ animations_list,+ current_mobjects_list,) -> str:"""Take the list of animations and a list of mobjects and output their hashes. This is meant to be used for `scene.play` function.diff --git a/manim/utils/ipython_magic.py b/manim/utils/ipython_magic.pyindex 563fcf98d..7405d62e6 100644--- a/manim/utils/ipython_magic.py+++ b/manim/utils/ipython_magic.py@@ -119,7 +119,7 @@ else:else:logger.warning("Renderer must be set to OpenGL in the configuration file "- "before importing Manim! Using cairo renderer instead."+ "before importing Manim! Using cairo renderer instead.",)config.renderer = "cairo"@@ -166,7 +166,7 @@ else:tmpfile,html_attributes=f'controls autoplay loop style="max-width: {config["media_width"]};"',embed=video_embed,- )+ ),)def add_additional_args(self, args):diff --git a/manim/utils/iterables.py b/manim/utils/iterables.pyindex 4e9e40796..716728714 100644--- a/manim/utils/iterables.py+++ b/manim/utils/iterables.py@@ -46,7 +46,7 @@ def resize_with_interpolation(nparray, length):(1 - a) * nparray[lh] + a * nparray[rh]for ci in cont_indicesfor lh, rh, a in [(int(ci), int(np.ceil(ci)), ci % 1)]- ]+ ],)diff --git a/manim/utils/module_ops.py b/manim/utils/module_ops.pyindex da663ed3f..4d093e70a 100644--- a/manim/utils/module_ops.py+++ b/manim/utils/module_ops.py@@ -15,12 +15,12 @@ def get_module(file_name: Path):if str(file_name) == "-":module = types.ModuleType("input_scenes")logger.info(- "Enter the animation's code & end with an EOF (CTRL+D on Linux/Unix, CTRL+Z on Windows):"+ "Enter the animation's code & end with an EOF (CTRL+D on Linux/Unix, CTRL+Z on Windows):",)code = sys.stdin.read()if not code.startswith("from manim import"):logger.warning(- "Didn't find an import statement for Manim. Importing automatically..."+ "Didn't find an import statement for Manim. Importing automatically...",)code = "from manim import *\n" + codelogger.info("Rendering animation from typed code...")@@ -38,7 +38,9 @@ def get_module(file_name: Path):module_name = ext.replace(os.sep, ".").split(".")[-1]warnings.filterwarnings(- "default", category=DeprecationWarning, module=module_name+ "default",+ category=DeprecationWarning,+ module=module_name,)spec = importlib.util.spec_from_file_location(module_name, file_name)@@ -95,14 +97,13 @@ def get_scenes_to_render(scene_classes):def prompt_user_for_choice(scene_classes):num_to_class = {}SceneFileWriter.force_output_as_scene_name = True- for count, scene_class in enumerate(scene_classes):- count += 1 # start with 1 instead of 0+ for count, scene_class in enumerate(scene_classes, 1):name = scene_class.__name__console.print(f"{count}: {name}", style="logging.level.info")num_to_class[count] = scene_classtry:user_input = console.input(- f"[log.message] {constants.CHOOSE_NUMBER_MESSAGE} [/log.message]"+ f"[log.message] {constants.CHOOSE_NUMBER_MESSAGE} [/log.message]",)scene_classes = [num_to_class[int(num_str)]diff --git a/manim/utils/opengl.py b/manim/utils/opengl.pyindex be4b2e3b1..fa3ac42ce 100644--- a/manim/utils/opengl.py+++ b/manim/utils/opengl.py@@ -11,7 +11,11 @@ def matrix_to_shader_input(matrix):def orthographic_projection_matrix(- width=None, height=None, near=1, far=depth + 1, format=True+ width=None,+ height=None,+ near=1,+ far=depth + 1,+ format=True,):if width is None:width = config["frame_width"]@@ -23,7 +27,7 @@ def orthographic_projection_matrix([0, 2 / height, 0, 0],[0, 0, -2 / (far - near), -(far + near) / (far - near)],[0, 0, 0, 1],- ]+ ],)if format:return matrix_to_shader_input(projection_matrix)@@ -42,7 +46,7 @@ def perspective_projection_matrix(width=None, height=None, near=2, far=50, forma[0, 2 * near / height, 0, 0],[0, 0, (far + near) / (near - far), (2 * far * near) / (near - far)],[0, 0, -1, 0],- ]+ ],)if format:return matrix_to_shader_input(projection_matrix)@@ -57,7 +61,7 @@ def translation_matrix(x=0, y=0, z=0):[0, 1, 0, y],[0, 0, 1, z],[0, 0, 0, 1],- ]+ ],)@@ -68,7 +72,7 @@ def x_rotation_matrix(x=0):[0, np.cos(x), -np.sin(x), 0],[0, np.sin(x), np.cos(x), 0],[0, 0, 0, 1],- ]+ ],)@@ -79,7 +83,7 @@ def y_rotation_matrix(y=0):[0, 1, 0, 0],[-np.sin(y), 0, np.cos(y), 0],[0, 0, 0, 1],- ]+ ],)@@ -90,7 +94,7 @@ def z_rotation_matrix(z=0):[np.sin(z), np.cos(z), 0, 0],[0, 0, 1, 0],[0, 0, 0, 1],- ]+ ],)@@ -107,7 +111,8 @@ def rotate_in_place_matrix(initial_position, x=0, y=0, z=0):def rotation_matrix(x=0, y=0, z=0):return np.matmul(- np.matmul(x_rotation_matrix(x), y_rotation_matrix(y)), z_rotation_matrix(z)+ np.matmul(x_rotation_matrix(x), y_rotation_matrix(y)),+ z_rotation_matrix(z),)@@ -118,7 +123,7 @@ def scale_matrix(scale_factor=1):[0, scale_factor, 0, 0],[0, 0, scale_factor, 0],[0, 0, 0, 1],- ]+ ],)diff --git a/manim/utils/rate_functions.py b/manim/utils/rate_functions.pyindex e0c44d436..acff41e54 100644--- a/manim/utils/rate_functions.py+++ b/manim/utils/rate_functions.py@@ -195,7 +195,8 @@ def there_and_back_with_pause(t: float, pause_ratio: float = 1.0 / 3) -> float:@unit_intervaldef running_start(- t: float, pull_factor: float = -0.5+ t: float,+ pull_factor: float = -0.5,) -> typing.Iterable: # what is func return type?return bezier([0, 0, pull_factor, pull_factor, 1, 1, 1])(t)diff --git a/manim/utils/space_ops.py b/manim/utils/space_ops.pyindex a3aeb68f6..a14e16a0d 100644--- a/manim/utils/space_ops.py+++ b/manim/utils/space_ops.py@@ -90,12 +90,14 @@ def quaternion_mult(w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2,w1 * y2 + y1 * w2 + z1 * x2 - x1 * z2,w1 * z2 + z1 * w2 + x1 * y2 - y1 * x2,- ]+ ],)def quaternion_from_angle_axis(- angle: float, axis: np.ndarray, axis_normalized: bool = False+ angle: float,+ axis: np.ndarray,+ axis_normalized: bool = False,) -> List[float]:"""Gets a quaternion from an angle and an axis.For more information, check `this Wikipedia page@@ -252,7 +254,9 @@ def rotation_matrix_transpose(angle: float, axis: np.ndarray) -> np.ndarray:def rotation_matrix(- angle: float, axis: np.ndarray, homogeneous: bool = False+ angle: float,+ axis: np.ndarray,+ homogeneous: bool = False,) -> np.ndarray:"""Rotation in R^3 about a specified axis of rotation.@@ -308,7 +312,7 @@ def z_to_vector(vector: np.ndarray) -> np.ndarray:else:theta = 0phi_down = np.array(- [[np.cos(phi), 0, np.sin(phi)], [0, 1, 0], [-np.sin(phi), 0, np.cos(phi)]]+ [[np.cos(phi), 0, np.sin(phi)], [0, 1, 0], [-np.sin(phi), 0, np.cos(phi)]],)return np.dot(rotation_about_z(theta), phi_down)@@ -533,7 +537,8 @@ def center_of_mass(points: Sequence[float]) -> np.ndarray:def midpoint(- point1: Sequence[float], point2: Sequence[float]+ point1: Sequence[float],+ point2: Sequence[float],) -> Union[float, np.ndarray]:"""Gets the midpoint of two points.@@ -695,7 +700,7 @@ def earclip_triangulation(verts: np.ndarray, ring_ends: list) -> list:# used to draw some connectionlambda i: i not in loop_connections,it.chain(*ring_group),- )+ ),)for ring_group in (attached_rings, detached_rings))@@ -763,12 +768,13 @@ def spherical_to_cartesian(r, theta, phi):r * np.cos(phi) * np.sin(theta),r * np.sin(phi) * np.sin(theta),r * np.cos(theta),- ]+ ],)def perpendicular_bisector(- line: Sequence[np.ndarray], norm_vector=OUT+ line: Sequence[np.ndarray],+ norm_vector=OUT,) -> Sequence[np.ndarray]:"""Returns a list of two points that correspondto the ends of the perpendicular bisector of thediff --git a/manim/utils/strings.py b/manim/utils/strings.pyindex 7bf49364e..9d4db3572 100644--- a/manim/utils/strings.py+++ b/manim/utils/strings.py@@ -22,7 +22,7 @@ def to_camel_case(name):c for c in part if c not in string.punctuation + string.whitespace].capitalize()for part in name.split("_")- ]+ ],)@@ -56,9 +56,9 @@ def split_string_to_isolate_substrings(full_string, *substrings_to_isolate):zip(full_string.split(substring_to_isolate),it.repeat(substring_to_isolate),- )+ ),)- )+ ),)all_substrings.pop(-1)all_substrings = [s for s in all_substrings if s != ""]@@ -78,5 +78,5 @@ def split_string_list_to_isolate_substrings(string_list, *substrings_to_isolate)split_string_to_isolate_substrings(s, *substrings_to_isolate)for s in string_list)- )+ ),)diff --git a/manim/utils/tex_file_writing.py b/manim/utils/tex_file_writing.pyindex c1724cd9b..6493c1a3d 100644--- a/manim/utils/tex_file_writing.py+++ b/manim/utils/tex_file_writing.py@@ -44,7 +44,9 @@ def tex_to_svg_file(expression, environment=None, tex_template=None):tex_template = config["tex_template"]tex_file = generate_tex_file(expression, environment, tex_template)dvi_file = compile_tex(- tex_file, tex_template.tex_compiler, tex_template.output_format+ tex_file,+ tex_template.tex_compiler,+ tex_template.output_format,)return convert_to_svg(dvi_file, tex_template.output_format)@@ -177,7 +179,10 @@ def compile_tex(tex_file, tex_compiler, output_format):tex_dir = Path(config.get_dir("tex_dir")).as_posix()if not os.path.exists(result):command = tex_compilation_command(- tex_compiler, output_format, tex_file, tex_dir+ tex_compiler,+ output_format,+ tex_file,+ tex_dir,)exit_code = os.system(command)if exit_code != 0:@@ -185,7 +190,7 @@ def compile_tex(tex_file, tex_compiler, output_format):if not Path(log_file).exists():raise RuntimeError(f"{tex_compiler} failed but did not produce a log file. "- "Check your LaTeX installation."+ "Check your LaTeX installation.",)with open(log_file) as f:log = f.readlines()@@ -197,7 +202,7 @@ def compile_tex(tex_file, tex_compiler, output_format):tex = g.readlines()for log_index in error_pos:logger.error(- f"LaTeX compilation error: {log[log_index][2:]}"+ f"LaTeX compilation error: {log[log_index][2:]}",)index_line = log_indexcontext = "Context for error:\n\n"@@ -234,7 +239,7 @@ def compile_tex(tex_file, tex_compiler, output_format):raise ValueError(f"{tex_compiler} error converting to"f" {output_format[1:]}. See log output above or"- f" the log file: {log_file}"+ f" the log file: {log_file}",)return result@@ -279,7 +284,7 @@ def convert_to_svg(dvi_file, extension, page=1):f"Your installation does not support converting {extension} files to SVG."f" Consider updating dvisvgm to at least version 2.4."f" If this does not solve the problem, please refer to our troubleshooting guide at:"- f" https://docs.manim.community/en/stable/installation/troubleshooting.html"+ f" https://docs.manim.community/en/stable/installation/troubleshooting.html",)return resultdiff --git a/manim/utils/tex_templates.py b/manim/utils/tex_templates.pyindex 15efa4f2f..0142b8142 100644--- a/manim/utils/tex_templates.py+++ b/manim/utils/tex_templates.py@@ -68,7 +68,8 @@ class TexTemplateLibrary:tex_compiler="xelatex",output_format=".xdv",preamble=_3b1b_preamble.replace(- r"\DisableLigatures{encoding = *, family = * }", r"\usepackage[UTF8]{ctex}"+ r"\DisableLigatures{encoding = *, family = * }",+ r"\usepackage[UTF8]{ctex}",),)"""An instance of the TeX template used by 3b1b when using the use_ctex flag"""@@ -170,7 +171,7 @@ lmtp.add_to_preamble(\MTgreekfont{lmtt} % no lgr lmvtt, so use lgr lmtt\Mathastext\let\varepsilon\epsilon % only \varsigma in LGR-"""+""",)@@ -182,7 +183,7 @@ fufug.add_to_preamble(\usepackage[T1]{fontenc}\usepackage[upright]{fourier}\usepackage{mathastext}-"""+""",)@@ -195,7 +196,7 @@ droidserif.add_to_preamble(\usepackage[default]{droidserif}\usepackage[LGRgreek]{mathastext}\let\varepsilon\epsilon-"""+""",)@@ -208,7 +209,7 @@ droidsans.add_to_preamble(\usepackage[default]{droidsans}\usepackage[LGRgreek]{mathastext}\let\varepsilon\epsilon-"""+""",)@@ -221,7 +222,7 @@ ncssg.add_to_preamble(\usepackage{newcent}\usepackage[symbolgreek]{mathastext}\linespread{1.1}-"""+""",)@@ -234,7 +235,7 @@ fceg.add_to_preamble(\usepackage[default]{frcursive}\usepackage[eulergreek,noplusnominus,noequal,nohbar,%nolessnomore,noasterisk]{mathastext}-"""+""",)@@ -247,7 +248,7 @@ aksg.add_to_preamble(\usepackage{aurical}\renewcommand{\rmdefault}{AuriocusKalligraphicus}\usepackage[symbolgreek]{mathastext}-"""+""",)@@ -259,7 +260,7 @@ palatinosg.add_to_preamble(\usepackage[T1]{fontenc}\usepackage{palatino}\usepackage[symbolmax,defaultmathsizes]{mathastext}-"""+""",)@@ -272,7 +273,7 @@ comfortaa.add_to_preamble(\usepackage[LGRgreek,defaultmathsizes,noasterisk]{mathastext}\let\varphi\phi\linespread{1.06}-"""+""",)@@ -283,7 +284,7 @@ ecfaugieeg.add_to_preamble(r"""\renewcommand\familydefault{fau} % emerald package\usepackage[defaultmathsizes,eulergreek]{mathastext}-"""+""",)@@ -297,7 +298,7 @@ electrumadfcm.add_to_preamble(\usepackage[lf]{electrum}\Mathastext\let\varphi\phi-"""+""",)@@ -309,7 +310,7 @@ americantypewriter.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{American Typewriter}\usepackage[defaultmathsizes]{mathastext}-"""+""",)americantypewriter.tex_compiler = "xelatex"americantypewriter.output_format = ".xdv"@@ -327,7 +328,7 @@ mpmptx.add_to_preamble(\renewcommand\familydefault\sfdefault\usepackage[defaultmathsizes]{mathastext}\renewcommand\familydefault\rmdefault-"""+""",)mpmptx.tex_compiler = "xelatex"mpmptx.output_format = ".xdv"@@ -343,7 +344,7 @@ ncssgpxm.add_to_preamble(\usepackage{newcent}\usepackage[symbolgreek,defaultmathsizes]{mathastext}\linespread{1.06}-"""+""",)@@ -357,7 +358,7 @@ vollkorntx.add_to_preamble(\usepackage[upright]{txgreeks}\usepackage{vollkorn}\usepackage[defaultmathsizes]{mathastext}-"""+""",)@@ -370,7 +371,7 @@ libertine.add_to_preamble(\usepackage{libertine}\usepackage[greek=n]{libgreek}\usepackage[noasterisk,defaultmathsizes]{mathastext}-"""+""",)@@ -384,7 +385,7 @@ slitexeg.add_to_preamble(\usepackage[eulergreek,defaultmathsizes]{mathastext}\MTEulerScale{1.06}\linespread{1.2}-"""+""",)@@ -399,12 +400,12 @@ ecfwebstertx.add_to_preamble(\usepackage{mathastext}\renewcommand{\int}{\intop\limits}\linespread{1.5}-"""+""",)ecfwebstertx.add_to_document(r"""\mathversion{bold}-"""+""",)@@ -418,7 +419,7 @@ italicromandeadff.add_to_preamble(\usepackage{romande}\usepackage[italic,defaultmathsizes,noasterisk]{mathastext}\renewcommand{\itshape}{\swashstyle}-"""+""",)@@ -430,7 +431,7 @@ applechancery.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Apple Chancery}\usepackage[defaultmathsizes]{mathastext}-"""+""",)applechancery.tex_compiler = "xelatex"applechancery.output_format = ".xdv"@@ -449,7 +450,7 @@ zapfchancery.add_to_preamble(\renewcommand\bfdefault\mddefault\usepackage[defaultmathsizes]{mathastext}\linespread{1.05}-"""+""",)@@ -461,7 +462,7 @@ italicverdana.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Verdana}\usepackage[defaultmathsizes,italic]{mathastext}-"""+""",)italicverdana.tex_compiler = "xelatex"italicverdana.output_format = ".xdv"@@ -481,12 +482,12 @@ urwzccmg.add_to_preamble(\DeclareFontShape{T1}{pzc}{m}{n}{<->ssub * pzc/mb/it}{}\usepackage{chancery}\usepackage{mathastext}-\linespread{1.05}"""+\linespread{1.05}""",)urwzccmg.add_to_document(r"""\boldmath-"""+""",)@@ -498,7 +499,7 @@ comicsansms.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Comic Sans MS}\usepackage[defaultmathsizes]{mathastext}-"""+""",)comicsansms.tex_compiler = "xelatex"comicsansms.output_format = ".xdv"@@ -513,7 +514,7 @@ italicgfsdidot.add_to_preamble(\renewcommand\rmdefault{udidot}\usepackage[LGRgreek,defaultmathsizes,italic]{mathastext}\let\varphi\phi-"""+""",)@@ -525,7 +526,7 @@ chalkduster.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Chalkduster}\usepackage[defaultmathsizes]{mathastext}-"""+""",)chalkduster.tex_compiler = "lualatex"chalkduster.output_format = ".pdf"@@ -540,7 +541,7 @@ mptx.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Minion Pro}\usepackage[defaultmathsizes]{mathastext}-"""+""",)mptx.tex_compiler = "xelatex"mptx.output_format = ".xdv"@@ -569,7 +570,7 @@ gnufsfs.add_to_preamble(\Mathastext\let\varphi\phi % no `var' phi in LGR encoding\renewcommand{\familydefault}{\rmdefault}-"""+""",)gnufsfs.tex_compiler = "xelatex"gnufsfs.output_format = ".xdv"@@ -584,7 +585,7 @@ gfsneohellenic.add_to_preamble(\usepackage[LGRgreek]{mathastext}\let\varphi\phi\linespread{1.06}-"""+""",)@@ -600,7 +601,7 @@ ecftallpaul.add_to_preamble(\renewcommand\familydefault{ftp} % emerald package\usepackage[symbol]{mathastext}\let\infty\inftypsy-"""+""",)@@ -613,7 +614,7 @@ italicdroidsans.add_to_preamble(\usepackage[default]{droidsans}\usepackage[LGRgreek,defaultmathsizes,italic]{mathastext}\let\varphi\phi-"""+""",)@@ -625,7 +626,7 @@ italicbaskerville.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Baskerville}\usepackage[defaultmathsizes,italic]{mathastext}-"""+""",)italicbaskerville.tex_compiler = "xelatex"italicbaskerville.output_format = ".xdv"@@ -640,11 +641,11 @@ ecfjdtx.add_to_preamble(\usepackage[upright]{txgreeks}\renewcommand\familydefault{fjd} % emerald package\usepackage{mathastext}-"""+""",)ecfjdtx.add_to_document(r"""\mathversion{bold}-"""+""",)@@ -658,7 +659,7 @@ aptxgm.add_to_preamble(\usepackage[upright]{txgreeks}\usepackage{antpolt}\usepackage[defaultmathsizes,nolessnomore]{mathastext}-"""+""",)@@ -670,7 +671,7 @@ papyrus.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Papyrus}\usepackage[defaultmathsizes]{mathastext}-"""+""",)papyrus.tex_compiler = "xelatex"papyrus.output_format = ".xdv"@@ -689,7 +690,7 @@ gnufstx.add_to_preamble(ItalicFont=FreeSerifItalic,BoldItalicFont=FreeSerifBoldItalic]{FreeSerif}\usepackage[defaultmathsizes]{mathastext}-"""+""",)gnufstx.tex_compiler = "xelatex"gnufstx.output_format = ".pdf"@@ -706,7 +707,7 @@ ecfscmg.add_to_preamble(\DeclareFontShape{T1}{fsk}{m}{n}{<->s*[1.315] fskmw8t}{}\renewcommand\rmdefault{fsk}\usepackage[noendash,defaultmathsizes,nohbar,defaultimath]{mathastext}-"""+""",)@@ -720,7 +721,7 @@ italiclmtpcm.add_to_preamble(\renewcommand{\familydefault}{\ttdefault}\usepackage[frenchmath]{mathastext}\linespread{1.08}-"""+""",)@@ -732,7 +733,7 @@ baskervaldadff.add_to_preamble(\usepackage[upright]{fourier}\usepackage{baskervald}\usepackage[defaultmathsizes,noasterisk]{mathastext}-"""+""",)@@ -746,7 +747,7 @@ italicdroidserifpx.add_to_preamble(\usepackage[default]{droidserif}\usepackage[LGRgreek,defaultmathsizes,italic,basic]{mathastext}\let\varphi\phi-"""+""",)@@ -760,7 +761,7 @@ biolinum.add_to_preamble(\renewcommand{\familydefault}{\sfdefault}\usepackage[greek=n,biolinum]{libgreek}\usepackage[noasterisk,defaultmathsizes]{mathastext}-"""+""",)@@ -772,7 +773,7 @@ italicvollkornf.add_to_preamble(\usepackage{fourier}\usepackage{vollkorn}\usepackage[italic,nohbar]{mathastext}-"""+""",)@@ -784,7 +785,7 @@ chalkboardse.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Chalkboard SE}\usepackage[defaultmathsizes]{mathastext}-"""+""",)chalkboardse.tex_compiler = "xelatex"chalkboardse.output_format = ".xdv"@@ -798,7 +799,7 @@ noteworthylight.add_to_preamble(\usepackage[no-math]{fontspec}\setmainfont[Mapping=tex-text]{Noteworthy Light}\usepackage[defaultmathsizes]{mathastext}-"""+""",)@@ -812,7 +813,7 @@ epigrafica.add_to_preamble(\usepackage[basic,LGRgreek,defaultmathsizes]{mathastext}\let\varphi\phi\linespread{1.2}-"""+""",)@@ -826,7 +827,7 @@ librisadff.add_to_preamble(\usepackage{libris}\renewcommand{\familydefault}{\sfdefault}\usepackage[noasterisk]{mathastext}-"""+""",)@@ -838,7 +839,7 @@ italicvanturisadff.add_to_preamble(\usepackage{fourier}\usepackage[lf]{venturis}\usepackage[italic,defaultmathsizes,noasterisk]{mathastext}-"""+""",)@@ -852,7 +853,7 @@ gfsbodoni.add_to_preamble(\usepackage[LGRgreek]{mathastext}\let\varphi\phi\linespread{1.06}-"""+""",)@@ -868,11 +869,11 @@ brushscriptxpx.add_to_preamble(\renewcommand{\mddefault}{xl}\renewcommand{\bfdefault}{xl}\usepackage[defaultmathsizes,noasterisk]{mathastext}-"""+""",)brushscriptxpx.add_to_document(r"""\boldmath-"""+""",)brushscriptxpx.tex_compiler = "xelatex"brushscriptxpx.output_format = ".xdv"@@ -887,7 +888,7 @@ urwagsg.add_to_preamble(\usepackage{avant}\renewcommand{\familydefault}{\sfdefault}\usepackage[symbolgreek,defaultmathsizes]{mathastext}-"""+""",)@@ -899,7 +900,7 @@ italictimesf.add_to_preamble(\usepackage{fourier}\renewcommand{\rmdefault}{ptm}\usepackage[italic,defaultmathsizes,noasterisk]{mathastext}-"""+""",)@@ -913,7 +914,7 @@ italichelveticaf.add_to_preamble(\usepackage{fourier}\renewcommand{\rmdefault}{phv}\usepackage[italic,defaultmathsizes,noasterisk]{mathastext}-"""+""",)diff --git a/poetry.lock b/poetry.lockindex 46b44d287..e7e3f7196 100644--- a/poetry.lock+++ b/poetry.lock@@ -57,6 +57,14 @@ dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pytest", "sphinx", "wheel", "pdocs = ["sphinx"]tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pytest"]+[[package]]+name = "astor"+version = "0.8.1"+description = "Read/rewrite/write Python ASTs"+category = "dev"+optional = false+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7"+[[package]]name = "astroid"version = "2.6.2"@@ -285,7 +293,7 @@ optional = falsepython-versions = "*"[package.extras]-test = ["flake8 (3.7.8)", "hypothesis (3.55.3)"]+test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"][[package]]name = "coverage"@@ -412,6 +420,104 @@ mccabe = ">=0.6.0,<0.7.0"pycodestyle = ">=2.7.0,<2.8.0"pyflakes = ">=2.3.0,<2.4.0"+[[package]]+name = "flake8-bugbear"+version = "21.4.3"+description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle."+category = "dev"+optional = false+python-versions = ">=3.6"++[package.dependencies]+attrs = ">=19.2.0"+flake8 = ">=3.0.0"++[package.extras]+dev = ["coverage", "black", "hypothesis", "hypothesmith"]++[[package]]+name = "flake8-builtins"+version = "1.5.3"+description = "Check for python builtins being used as variables or parameters."+category = "dev"+optional = false+python-versions = "*"++[package.dependencies]+flake8 = "*"++[package.extras]+test = ["coverage", "coveralls", "mock", "pytest", "pytest-cov"]++[[package]]+name = "flake8-comprehensions"+version = "3.6.1"+description = "A flake8 plugin to help you write better list/set/dict comprehensions."+category = "dev"+optional = false+python-versions = ">=3.6"++[package.dependencies]+flake8 = ">=3.0,<3.2.0 || >3.2.0,<4"+importlib-metadata = {version = "*", markers = "python_version < \"3.8\""}++[[package]]+name = "flake8-docstrings"+version = "1.6.0"+description = "Extension for flake8 which uses pydocstyle to check docstrings"+category = "dev"+optional = false+python-versions = "*"++[package.dependencies]+flake8 = ">=3"+pydocstyle = ">=2.1"++[[package]]+name = "flake8-plugin-utils"+version = "1.3.2"+description = "The package provides base classes and utils for flake8 plugin writing"+category = "dev"+optional = false+python-versions = ">=3.6,<4.0"++[[package]]+name = "flake8-pytest-style"+version = "1.5.0"+description = "A flake8 plugin checking common style issues or inconsistencies with pytest-based tests."+category = "dev"+optional = false+python-versions = ">=3.6,<4.0"++[package.dependencies]+flake8-plugin-utils = ">=1.3.2,<2.0.0"++[[package]]+name = "flake8-rst-docstrings"+version = "0.2.3"+description = "Python docstring reStructuredText (RST) validator"+category = "dev"+optional = false+python-versions = ">=3.3"++[package.dependencies]+flake8 = ">=3.0.0"+pygments = "*"+restructuredtext-lint = "*"++[[package]]+name = "flake8-simplify"+version = "0.14.1"+description = "flake8 plugin which checks for code that can be simplified"+category = "dev"+optional = false+python-versions = ">=3.6.1"++[package.dependencies]+astor = ">=0.1"+flake8 = ">=3.7"+importlib-metadata = {version = ">=0.9", markers = "python_version < \"3.8\""}+[[package]]name = "furo"version = "2021.6.18b36"@@ -621,7 +727,7 @@ python-versions = ">=3.6"parso = ">=0.8.0,<0.9.0"[package.extras]-qa = ["flake8 (3.8.3)", "mypy (0.782)"]+qa = ["flake8 (==3.8.3)", "mypy (==0.782)"]testing = ["Django (<3.1)", "colorama", "docopt", "pytest (<6.0.0)"][[package]]@@ -980,11 +1086,11 @@ testpath = "*"traitlets = ">=5.0"[package.extras]-all = ["pytest", "pytest-cov", "pytest-dependency", "ipykernel", "ipywidgets (>=7)", "pyppeteer (0.2.2)", "tornado (>=4.0)", "sphinx (>=1.5.1)", "sphinx-rtd-theme", "nbsphinx (>=0.2.12)", "ipython"]+all = ["pytest", "pytest-cov", "pytest-dependency", "ipykernel", "ipywidgets (>=7)", "pyppeteer (==0.2.2)", "tornado (>=4.0)", "sphinx (>=1.5.1)", "sphinx-rtd-theme", "nbsphinx (>=0.2.12)", "ipython"]docs = ["sphinx (>=1.5.1)", "sphinx-rtd-theme", "nbsphinx (>=0.2.12)", "ipython"]serve = ["tornado (>=4.0)"]-test = ["pytest", "pytest-cov", "pytest-dependency", "ipykernel", "ipywidgets (>=7)", "pyppeteer (0.2.2)"]-webpdf = ["pyppeteer (0.2.2)"]+test = ["pytest", "pytest-cov", "pytest-dependency", "ipykernel", "ipywidgets (>=7)", "pyppeteer (==0.2.2)"]+webpdf = ["pyppeteer (==0.2.2)"][[package]]name = "nbformat"@@ -1027,7 +1133,7 @@ pandas = ">=1.1"scipy = ">=1.5,<1.6.1 || >1.6.1"[package.extras]-developer = ["black (21.5b1)", "pre-commit (>=2.12)"]+developer = ["black (==21.5b1)", "pre-commit (>=2.12)"]doc = ["sphinx (>=4.0,<5.0)", "pydata-sphinx-theme (>=0.6,<1.0)", "sphinx-gallery (>=0.9,<1.0)", "numpydoc (>=1.1)", "pillow (>=8.2)", "nb2plots (>=0.6)", "texext (>=0.6.6)"]extra = ["lxml (>=4.5)", "pygraphviz (>=1.7)", "pydot (>=1.4.1)"]test = ["pytest (>=6.2)", "pytest-cov (>=2.12)", "codecov (>=2.1)"]@@ -1121,7 +1227,7 @@ optional = truepython-versions = ">=3.6"[package.extras]-qa = ["flake8 (3.8.3)", "mypy (0.782)"]+qa = ["flake8 (==3.8.3)", "mypy (==0.782)"]testing = ["docopt", "pytest (<6.0.0)"][[package]]@@ -1282,6 +1388,20 @@ category = "main"optional = falsepython-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"+[[package]]+name = "pydocstyle"+version = "6.1.1"+description = "Python docstring style checker"+category = "dev"+optional = false+python-versions = ">=3.6"++[package.dependencies]+snowballstemmer = "*"++[package.extras]+toml = ["toml"]+[[package]]name = "pydub"version = "0.25.1"@@ -1341,9 +1461,9 @@ python-versions = ">=3.6"[package.extras]crypto = ["cryptography (>=3.3.1,<4.0.0)"]-dev = ["sphinx", "sphinx-rtd-theme", "zope.interface", "cryptography (>=3.3.1,<4.0.0)", "pytest (>=6.0.0,<7.0.0)", "coverage[toml] (5.0.4)", "mypy", "pre-commit"]+dev = ["sphinx", "sphinx-rtd-theme", "zope.interface", "cryptography (>=3.3.1,<4.0.0)", "pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)", "mypy", "pre-commit"]docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"]-tests = ["pytest (>=6.0.0,<7.0.0)", "coverage[toml] (5.0.4)"]+tests = ["pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)"][[package]]name = "pylint"@@ -1374,7 +1494,7 @@ six = "*"[package.extras]docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"]-tests = ["pytest (>=3.2.1,<3.3.0 || >3.3.0)", "hypothesis (>=3.27.0)"]+tests = ["pytest (>=3.2.1,!=3.3.0)", "hypothesis (>=3.27.0)"][[package]]name = "pyobjc-core"@@ -1581,7 +1701,7 @@ idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""}urllib3 = ">=1.21.1,<1.27"[package.extras]-socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7)", "win-inet-pton"]+socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"]use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"][[package]]@@ -1596,6 +1716,17 @@ python-versions = "*"requests = ">=1.1"urllib3 = ">=1.8"+[[package]]+name = "restructuredtext-lint"+version = "1.3.2"+description = "reStructuredText linter"+category = "dev"+optional = false+python-versions = "*"++[package.dependencies]+docutils = ">=0.11,<1.0"+[[package]]name = "rich"version = "10.6.0"@@ -1730,7 +1861,7 @@ python-versions = ">=3.6"sphinx = ">=1.8"[package.extras]-code_style = ["pre-commit (2.12.1)"]+code_style = ["pre-commit (==2.12.1)"]rtd = ["sphinx", "ipython", "sphinx-book-theme"][[package]]@@ -1915,7 +2046,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4"[package.extras]brotli = ["brotlipy (>=0.6.0)"]secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"]-socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"]+socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"][[package]]name = "virtualenv"@@ -2000,7 +2131,7 @@ webgl_renderer = ["grpcio", "grpcio-tools"][metadata]lock-version = "1.1"python-versions = "^3.7"-content-hash = "077664433031d1da2ab4ab3d970c6a9c738ccab2d93b106c0db99985314a98d9"+content-hash = "a19e78b974a71cbcbb3db6cefc5ca107decfc6b48b19c4276db10ffa9f5a1f36"[metadata.files]alabaster = [@@ -2039,6 +2170,10 @@ argon2-cffi = [{file = "argon2_cffi-20.1.0-cp39-cp39-win32.whl", hash = "sha256:e2db6e85c057c16d0bd3b4d2b04f270a7467c147381e8fd73cbbe5bc719832be"},{file = "argon2_cffi-20.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:8a84934bd818e14a17943de8099d41160da4a336bcc699bb4c394bbb9b94bd32"},]+astor = [+ {file = "astor-0.8.1-py2.py3-none-any.whl", hash = "sha256:070a54e890cefb5b3739d19f30f5a5ec840ffc9c50ffa7d23cc9fc1a38ebbfc5"},+ {file = "astor-0.8.1.tar.gz", hash = "sha256:6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e"},+]astroid = [{file = "astroid-2.6.2-py3-none-any.whl", hash = "sha256:606b2911d10c3dcf35e58d2ee5c97360e8477d7b9f3efc3f24811c93e6fc2cd9"},{file = "astroid-2.6.2.tar.gz", hash = "sha256:38b95085e9d92e2ca06cf8b35c12a74fa81da395a6f9e65803742e6509c05892"},@@ -2310,6 +2445,38 @@ flake8 = [{file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"},{file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"},]+flake8-bugbear = [+ {file = "flake8-bugbear-21.4.3.tar.gz", hash = "sha256:2346c81f889955b39e4a368eb7d508de723d9de05716c287dc860a4073dc57e7"},+ {file = "flake8_bugbear-21.4.3-py36.py37.py38-none-any.whl", hash = "sha256:4f305dca96be62bf732a218fe6f1825472a621d3452c5b994d8f89dae21dbafa"},+]+flake8-builtins = [+ {file = "flake8-builtins-1.5.3.tar.gz", hash = "sha256:09998853b2405e98e61d2ff3027c47033adbdc17f9fe44ca58443d876eb00f3b"},+ {file = "flake8_builtins-1.5.3-py2.py3-none-any.whl", hash = "sha256:7706babee43879320376861897e5d1468e396a40b8918ed7bccf70e5f90b8687"},+]+flake8-comprehensions = [+ {file = "flake8-comprehensions-3.6.1.tar.gz", hash = "sha256:4888de89248b7f7535159189ff693c77f8354f6d37a02619fa28c9921a913aa0"},+ {file = "flake8_comprehensions-3.6.1-py3-none-any.whl", hash = "sha256:e9a010b99aa90c05790d45281ad9953df44a4a08a1a8f6cd41f98b4fc6a268a0"},+]+flake8-docstrings = [+ {file = "flake8-docstrings-1.6.0.tar.gz", hash = "sha256:9fe7c6a306064af8e62a055c2f61e9eb1da55f84bb39caef2b84ce53708ac34b"},+ {file = "flake8_docstrings-1.6.0-py2.py3-none-any.whl", hash = "sha256:99cac583d6c7e32dd28bbfbef120a7c0d1b6dde4adb5a9fd441c4227a6534bde"},+]+flake8-plugin-utils = [+ {file = "flake8-plugin-utils-1.3.2.tar.gz", hash = "sha256:20fa2a8ca2decac50116edb42e6af0a1253ef639ad79941249b840531889c65a"},+ {file = "flake8_plugin_utils-1.3.2-py3-none-any.whl", hash = "sha256:1fe43e3e9acf3a7c0f6b88f5338cad37044d2f156c43cb6b080b5f9da8a76f06"},+]+flake8-pytest-style = [+ {file = "flake8-pytest-style-1.5.0.tar.gz", hash = "sha256:668ce8f55edf7db4ac386d2735c3b354b5cb47aa341a4655d91a5788dd03124b"},+ {file = "flake8_pytest_style-1.5.0-py3-none-any.whl", hash = "sha256:ec287a7dc4fe95082af5e408c8b2f8f4b6bcb366d5a17ff6c34112eb03446580"},+]+flake8-rst-docstrings = [+ {file = "flake8-rst-docstrings-0.2.3.tar.gz", hash = "sha256:3045794e1c8467fba33aaea5c246b8369efc9c44ef8b0b20199bb6df7a4bd47b"},+ {file = "flake8_rst_docstrings-0.2.3-py3-none-any.whl", hash = "sha256:565bbb391d7e4d0042924102221e9857ad72929cdd305b26501736ec22c1451a"},+]+flake8-simplify = [+ {file = "flake8_simplify-0.14.1-py3-none-any.whl", hash = "sha256:ba5d2905dc277cd4800c6e7f4859f96322d83dd37991ae5f8305750132084dd6"},+ {file = "flake8_simplify-0.14.1.tar.gz", hash = "sha256:d8b38feb97fd6c5943b5d9b2ab352acea83ec036a93215c0576b9e48c6aa2dcc"},+]furo = [{file = "furo-2021.6.18b36-py3-none-any.whl", hash = "sha256:a4c00634afeb5896a34d141a5dffb62f20c5eca7831b78269823a8cd8b09a5e4"},{file = "furo-2021.6.18b36.tar.gz", hash = "sha256:46a30bc597a9067088d39d730e7d9bf6c1a1d71967e4af062f796769f66b3bdb"},@@ -2724,6 +2891,7 @@ moderngl = [{file = "moderngl-5.6.4.tar.gz", hash = "sha256:8c6d04559f5e3bf75a18525cd46d213c0f3a8409363718978e6de691bdb551fb"},]moderngl-window = [+ {file = "moderngl-window-2.4.0.tar.gz", hash = "sha256:20ab97473892a2b3de57b5bf9f44ba2f018ac87d68d219beab38f16526ea4d4f"},{file = "moderngl_window-2.4.0-py3-none-any.whl", hash = "sha256:2f13016db52001351ac785fabaf637af9313ae5cc4549aa3b9c2f034a5494008"},]multipledispatch = [@@ -2850,26 +3018,21 @@ pillow = [{file = "Pillow-8.2.0-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:dc38f57d8f20f06dd7c3161c59ca2c86893632623f33a42d592f097b00f720a9"},{file = "Pillow-8.2.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a013cbe25d20c2e0c4e85a9daf438f85121a4d0344ddc76e33fd7e3965d9af4b"},{file = "Pillow-8.2.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:8bb1e155a74e1bfbacd84555ea62fa21c58e0b4e7e6b20e4447b8d07990ac78b"},- {file = "Pillow-8.2.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c5236606e8570542ed424849f7852a0ff0bce2c4c8d0ba05cc202a5a9c97dee9"},{file = "Pillow-8.2.0-cp36-cp36m-win32.whl", hash = "sha256:12e5e7471f9b637762453da74e390e56cc43e486a88289995c1f4c1dc0bfe727"},{file = "Pillow-8.2.0-cp36-cp36m-win_amd64.whl", hash = "sha256:5afe6b237a0b81bd54b53f835a153770802f164c5570bab5e005aad693dab87f"},{file = "Pillow-8.2.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:cb7a09e173903541fa888ba010c345893cd9fc1b5891aaf060f6ca77b6a3722d"},{file = "Pillow-8.2.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:0d19d70ee7c2ba97631bae1e7d4725cdb2ecf238178096e8c82ee481e189168a"},{file = "Pillow-8.2.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:083781abd261bdabf090ad07bb69f8f5599943ddb539d64497ed021b2a67e5a9"},- {file = "Pillow-8.2.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:c6b39294464b03457f9064e98c124e09008b35a62e3189d3513e5148611c9388"},{file = "Pillow-8.2.0-cp37-cp37m-win32.whl", hash = "sha256:01425106e4e8cee195a411f729cff2a7d61813b0b11737c12bd5991f5f14bcd5"},{file = "Pillow-8.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:3b570f84a6161cf8865c4e08adf629441f56e32f180f7aa4ccbd2e0a5a02cba2"},{file = "Pillow-8.2.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:031a6c88c77d08aab84fecc05c3cde8414cd6f8406f4d2b16fed1e97634cc8a4"},{file = "Pillow-8.2.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:66cc56579fd91f517290ab02c51e3a80f581aba45fd924fcdee01fa06e635812"},{file = "Pillow-8.2.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:6c32cc3145928c4305d142ebec682419a6c0a8ce9e33db900027ddca1ec39178"},- {file = "Pillow-8.2.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:624b977355cde8b065f6d51b98497d6cd5fbdd4f36405f7a8790e3376125e2bb"},{file = "Pillow-8.2.0-cp38-cp38-win32.whl", hash = "sha256:5cbf3e3b1014dddc45496e8cf38b9f099c95a326275885199f427825c6522232"},{file = "Pillow-8.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:463822e2f0d81459e113372a168f2ff59723e78528f91f0bd25680ac185cf797"},{file = "Pillow-8.2.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:95d5ef984eff897850f3a83883363da64aae1000e79cb3c321915468e8c6add5"},- {file = "Pillow-8.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b91c36492a4bbb1ee855b7d16fe51379e5f96b85692dc8210831fbb24c43e484"},{file = "Pillow-8.2.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:d68cb92c408261f806b15923834203f024110a2e2872ecb0bd2a110f89d3c602"},{file = "Pillow-8.2.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:f217c3954ce5fd88303fc0c317af55d5e0204106d86dea17eb8205700d47dec2"},- {file = "Pillow-8.2.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:5b70110acb39f3aff6b74cf09bb4169b167e2660dabc304c1e25b6555fa781ef"},{file = "Pillow-8.2.0-cp39-cp39-win32.whl", hash = "sha256:a7d5e9fad90eff8f6f6106d3b98b553a88b6f976e51fce287192a5d2d5363713"},{file = "Pillow-8.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:238c197fc275b475e87c1453b05b467d2d02c2915fdfdd4af126145ff2e4610c"},{file = "Pillow-8.2.0-pp36-pypy36_pp73-macosx_10_10_x86_64.whl", hash = "sha256:0e04d61f0064b545b989126197930807c86bcbd4534d39168f4aa5fda39bb8f9"},@@ -2989,6 +3152,10 @@ pycparser = [{file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"},{file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"},]+pydocstyle = [+ {file = "pydocstyle-6.1.1-py3-none-any.whl", hash = "sha256:6987826d6775056839940041beef5c08cc7e3d71d63149b48e36727f70144dc4"},+ {file = "pydocstyle-6.1.1.tar.gz", hash = "sha256:1d41b7c459ba0ee6c345f2eb9ae827cab14a7533a88c5c6f7e94923f72df92dc"},+]pydub = [{file = "pydub-0.25.1-py2.py3-none-any.whl", hash = "sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6"},{file = "pydub-0.25.1.tar.gz", hash = "sha256:980a33ce9949cab2a569606b65674d748ecbca4f0796887fd6f46173a7b0d30f"},@@ -3205,6 +3372,10 @@ regex = [{file = "regex-2021.7.6-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:b85ac458354165405c8a84725de7bbd07b00d9f72c31a60ffbf96bb38d3e25fa"},{file = "regex-2021.7.6-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:3f5716923d3d0bfb27048242a6e0f14eecdb2e2a7fac47eda1d055288595f222"},{file = "regex-2021.7.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5983c19d0beb6af88cb4d47afb92d96751fb3fa1784d8785b1cdf14c6519407"},+ {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf1d2d183abc7faa101ebe0b8d04fd19cb9138820abc8589083035c9440b8ca6"},+ {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1947e7de155063e1c495c50590229fb98720d4c383af5031bbcb413db33fa1be"},+ {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17d8a3f99b18d87ac54a449b836d485cc8c195bb6f5e4379c84c8519045facc9"},+ {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d30895ec80cc80358392841add9dde81ea1d54a4949049269115e6b0555d0498"},{file = "regex-2021.7.6-cp36-cp36m-win32.whl", hash = "sha256:c92831dac113a6e0ab28bc98f33781383fe294df1a2c3dfd1e850114da35fd5b"},{file = "regex-2021.7.6-cp36-cp36m-win_amd64.whl", hash = "sha256:791aa1b300e5b6e5d597c37c346fb4d66422178566bbb426dd87eaae475053fb"},{file = "regex-2021.7.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:59506c6e8bd9306cd8a41511e32d16d5d1194110b8cfe5a11d102d8b63cf945d"},@@ -3215,6 +3386,10 @@ regex = [{file = "regex-2021.7.6-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:173bc44ff95bc1e96398c38f3629d86fa72e539c79900283afa895694229fe6a"},{file = "regex-2021.7.6-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:15dddb19823f5147e7517bb12635b3c82e6f2a3a6b696cc3e321522e8b9308ad"},{file = "regex-2021.7.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ddeabc7652024803666ea09f32dd1ed40a0579b6fbb2a213eba590683025895"},+ {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8244c681018423a0d1784bc6b9af33bdf55f2ab8acb1f3cd9dd83d90e0813253"},+ {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a4c742089faf0e51469c6a1ad7e3d3d21afae54a16a6cead85209dfe0a1ce65"},+ {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:914e626dc8e75fe4fc9b7214763f141d9f40165d00dfe680b104fa1b24063bbf"},+ {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3fabb19c82ecf39832a3f5060dfea9a7ab270ef156039a1143a29a83a09a62de"},{file = "regex-2021.7.6-cp37-cp37m-win32.whl", hash = "sha256:f080248b3e029d052bf74a897b9d74cfb7643537fbde97fe8225a6467fb559b5"},{file = "regex-2021.7.6-cp37-cp37m-win_amd64.whl", hash = "sha256:d8bbce0c96462dbceaa7ac4a7dfbbee92745b801b24bce10a98d2f2b1ea9432f"},{file = "regex-2021.7.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:edd1a68f79b89b0c57339bce297ad5d5ffcc6ae7e1afdb10f1947706ed066c9c"},@@ -3225,6 +3400,10 @@ regex = [{file = "regex-2021.7.6-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:bc84fb254a875a9f66616ed4538542fb7965db6356f3df571d783f7c8d256edd"},{file = "regex-2021.7.6-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:598c0a79b4b851b922f504f9f39a863d83ebdfff787261a5ed061c21e67dd761"},{file = "regex-2021.7.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:875c355360d0f8d3d827e462b29ea7682bf52327d500a4f837e934e9e4656068"},+ {file = "regex-2021.7.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfc0957c4a4b91eff5ad036088769e600a25774256cd0e1154378591ce573f08"},+ {file = "regex-2021.7.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:efb4af05fa4d2fc29766bf516f1f5098d6b5c3ed846fde980c18bf8646ad3979"},+ {file = "regex-2021.7.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7423aca7cc30a6228ccdcf2ea76f12923d652c5c7c6dc1959a0b004e308f39fb"},+ {file = "regex-2021.7.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb9834c1e77493efd7343b8e38950dee9797d2d6f2d5fd91c008dfaef64684b9"},{file = "regex-2021.7.6-cp38-cp38-win32.whl", hash = "sha256:e586f448df2bbc37dfadccdb7ccd125c62b4348cb90c10840d695592aa1b29e0"},{file = "regex-2021.7.6-cp38-cp38-win_amd64.whl", hash = "sha256:2fe5e71e11a54e3355fa272137d521a40aace5d937d08b494bed4529964c19c4"},{file = "regex-2021.7.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6110bab7eab6566492618540c70edd4d2a18f40ca1d51d704f1d81c52d245026"},@@ -3235,6 +3414,10 @@ regex = [{file = "regex-2021.7.6-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:2bceeb491b38225b1fee4517107b8491ba54fba77cf22a12e996d96a3c55613d"},{file = "regex-2021.7.6-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:f98dc35ab9a749276f1a4a38ab3e0e2ba1662ce710f6530f5b0a6656f1c32b58"},{file = "regex-2021.7.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:319eb2a8d0888fa6f1d9177705f341bc9455a2c8aca130016e52c7fe8d6c37a3"},+ {file = "regex-2021.7.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:598ee917dbe961dcf827217bf2466bb86e4ee5a8559705af57cbabb3489dd37e"},+ {file = "regex-2021.7.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:56fc7045a1999a8d9dd1896715bc5c802dfec5b9b60e883d2cbdecb42adedea4"},+ {file = "regex-2021.7.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8363ac90ea63c3dd0872dfdb695f38aff3334bfa5712cffb238bd3ffef300e3"},+ {file = "regex-2021.7.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:716a6db91b3641f566531ffcc03ceec00b2447f0db9942b3c6ea5d2827ad6be3"},{file = "regex-2021.7.6-cp39-cp39-win32.whl", hash = "sha256:eaf58b9e30e0e546cdc3ac06cf9165a1ca5b3de8221e9df679416ca667972035"},{file = "regex-2021.7.6-cp39-cp39-win_amd64.whl", hash = "sha256:4c9c3155fe74269f61e27617529b7f09552fbb12e44b1189cebbdb24294e6e1c"},{file = "regex-2021.7.6.tar.gz", hash = "sha256:8394e266005f2d8c6f0bc6780001f7afa3ef81a7a2111fa35058ded6fce79e4d"},@@ -3247,6 +3430,9 @@ requests-unixsocket = [{file = "requests-unixsocket-0.2.0.tar.gz", hash = "sha256:9e5c1a20afc3cf786197ae59c79bcdb0e7565f218f27df5f891307ee8817c1ea"},{file = "requests_unixsocket-0.2.0-py2.py3-none-any.whl", hash = "sha256:014d07bfb66dc805a011a8b4b306cf4ec96d2eddb589f6b2b5765e626f0dc0cc"},]+restructuredtext-lint = [+ {file = "restructuredtext_lint-1.3.2.tar.gz", hash = "sha256:d3b10a1fe2ecac537e51ae6d151b223b78de9fafdd50e5eb6b08c243df173c80"},+]rich = [{file = "rich-10.6.0-py3-none-any.whl", hash = "sha256:d3f72827cd5df13b2ef7f1a97f81ec65548d4fdeb92cef653234f227580bbb2a"},{file = "rich-10.6.0.tar.gz", hash = "sha256:128261b3e2419a4ef9c97066ccc2abbfb49fa7c5e89c3fe4056d00aa5e9c1e65"},diff --git a/pyproject.toml b/pyproject.tomlindex 4a79b7a03..90d8deb52 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -76,6 +76,13 @@ flake8 = "^3.9.0"isort = "^5.8.0"pytest-xdist = "^2.2"psutil = ">=3.0"+flake8-builtins = "^1.5.3"+flake8-bugbear = "^21.4.3"+flake8-docstrings = "^1.6.0"+flake8-rst-docstrings = "^0.2.3"+flake8-pytest-style = "^1.5.0"+flake8-simplify = "^0.14.1"+flake8-comprehensions = "^3.6.1"[tool.poetry.urls]diff --git a/scripts/TEMPLATE.cff b/scripts/TEMPLATE.cffindex 9ede4c4d7..3a7e8d07e 100644--- a/scripts/TEMPLATE.cff+++ b/scripts/TEMPLATE.cff@@ -1,6 +1,6 @@# YAML 1.2----authors:+authors:-name: "The Manim Community Developers"cff-version: "1.1.0"@@ -10,4 +10,4 @@ message: "We acknowledge the importance of good software to support research, antitle: Manim – Mathematical Animation Frameworkurl: "https://www.manim.community/"version: "<version>"-...\ No newline at end of file+...diff --git a/scripts/dev_changelog.py b/scripts/dev_changelog.pyindex 3bf6adfc0..806fb5407 100755--- a/scripts/dev_changelog.py+++ b/scripts/dev_changelog.py@@ -80,8 +80,9 @@ PR_LABELS = {def update_citation(version, date):current_directory = os.path.dirname(__file__)parent_directory = os.path.split(current_directory)[0]- with open(os.path.join(current_directory, "TEMPLATE.cff"), "r") as a, open(- os.path.join(parent_directory, "CITATION.cff"), "w"+ with open(os.path.join(current_directory, "TEMPLATE.cff")) as a, open(+ os.path.join(parent_directory, "CITATION.cff"),+ "w",) as b:contents = a.read()contents = contents.replace("<version>", version)@@ -119,7 +120,7 @@ def process_pullrequests(lst, cur, github_repo, pr_nums):reviewer_names = []for reviewer in reviewers:reviewer_names.append(- reviewer.name if reviewer.name is not None else reviewer.login+ reviewer.name if reviewer.name is not None else reviewer.login,)return {@@ -140,10 +141,13 @@ def get_pr_nums(lst, cur):# From fast forward squash-mergescommits = this_repo.git.log(- "--oneline", "--no-merges", "--first-parent", f"{lst}..{cur}"+ "--oneline",+ "--no-merges",+ "--first-parent",+ f"{lst}..{cur}",)split_commits = list(- filter(lambda x: "pre-commit autoupdate" not in x, commits.split("\n"))+ filter(lambda x: "pre-commit autoupdate" not in x, commits.split("\n")),)commits = "\n".join(split_commits)issues = re.findall(r"^.*\(\#(\d+)\)$", commits, re.M)@@ -175,7 +179,10 @@ def get_summary(body):type=int,)@click.option(- "-o", "--outfile", type=str, help="Path and file name of the changelog output."+ "-o",+ "--outfile",+ type=str,+ help="Path and file name of the changelog output.",)def main(token, prior, tag, additional, outfile):"""Generate Changelog/List of contributors/PRs for release.@@ -232,8 +239,8 @@ def main(token, prior, tag, additional, outfile):A total of {len(set(authors).union(set(reviewers)))} people contributed to thisrelease. People with a '+' by their names authored a patch for the firsttime.\n- """- )+ """,+ ),)for author in authors:@@ -245,8 +252,8 @@ def main(token, prior, tag, additional, outfile):"""The patches included in this release have been reviewed bythe following contributors.\n- """- )+ """,+ ),)for reviewer in reviewers:@@ -258,7 +265,7 @@ def main(token, prior, tag, additional, outfile):f.write(heading + "\n")f.write("=" * len(heading) + "\n\n")f.write(- f"A total of {len(pr_nums)} pull requests were merged for this release.\n\n"+ f"A total of {len(pr_nums)} pull requests were merged for this release.\n\n",)pr_by_labels = contributions["PRs"]diff --git a/tests/conftest.py b/tests/conftest.pyindex 79f4b266b..7d7f6f95a 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -34,7 +34,7 @@ def pytest_collection_modifyitems(config, items):returnelse:slow_skip = pytest.mark.skip(- reason="Slow test skipped due to --disable_slow flag."+ reason="Slow test skipped due to --disable_slow flag.",)for item in items:if "slow" in item.keywords:diff --git a/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json b/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.jsonindex 2e125f125..134f5c9b4 100644--- a/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json+++ b/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json@@ -8,4 +8,4 @@"duration": "4.000000","nb_frames": "240"}-}\ No newline at end of file+}diff --git a/tests/control_data/videos_data/SceneWithMultiplePlayCallsWithNFlag.json b/tests/control_data/videos_data/SceneWithMultiplePlayCallsWithNFlag.jsonindex ad2ea0fac..90249f75b 100644--- a/tests/control_data/videos_data/SceneWithMultiplePlayCallsWithNFlag.json+++ b/tests/control_data/videos_data/SceneWithMultiplePlayCallsWithNFlag.json@@ -8,4 +8,4 @@"duration": "7.000000","nb_frames": "105"}-}\ No newline at end of file+}diff --git a/tests/control_data/videos_data/SceneWithMultipleWaitCallsWithNFlag.json b/tests/control_data/videos_data/SceneWithMultipleWaitCallsWithNFlag.jsonindex 05ae9e038..7b221eff4 100644--- a/tests/control_data/videos_data/SceneWithMultipleWaitCallsWithNFlag.json+++ b/tests/control_data/videos_data/SceneWithMultipleWaitCallsWithNFlag.json@@ -8,4 +8,4 @@"duration": "5.000000","nb_frames": "75"}-}\ No newline at end of file+}diff --git a/tests/control_data/videos_data/SquareToCircleWithDefaultValues.json b/tests/control_data/videos_data/SquareToCircleWithDefaultValues.jsonindex 0f02b3d06..8e836445c 100644--- a/tests/control_data/videos_data/SquareToCircleWithDefaultValues.json+++ b/tests/control_data/videos_data/SquareToCircleWithDefaultValues.json@@ -8,4 +8,4 @@"duration": "1.000000","nb_frames": "60"}-}\ No newline at end of file+}diff --git a/tests/control_data/videos_data/SquareToCircleWithlFlag.json b/tests/control_data/videos_data/SquareToCircleWithlFlag.jsonindex 0c5182ca3..4473dd980 100644--- a/tests/control_data/videos_data/SquareToCircleWithlFlag.json+++ b/tests/control_data/videos_data/SquareToCircleWithlFlag.json@@ -8,4 +8,4 @@"duration": "1.000000","nb_frames": "15"}-}\ No newline at end of file+}diff --git a/tests/helpers/graphical_units.py b/tests/helpers/graphical_units.pyindex 09c46599d..848f890ad 100644--- a/tests/helpers/graphical_units.py+++ b/tests/helpers/graphical_units.py@@ -43,12 +43,14 @@ def set_test_scene(scene_object, module_name):data = scene.renderer.get_frame()assert not np.all(- data == np.array([0, 0, 0, 255])+ data == np.array([0, 0, 0, 255]),), f"Control data generated for {str(scene)} only contains empty pixels."assert data.shape == (480, 854, 4)tests_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))path_control_data = os.path.join(- tests_directory, "control_data", "graphical_units_data"+ tests_directory,+ "control_data",+ "graphical_units_data",)path = os.path.join(path_control_data, module_name)if not os.path.isdir(path):diff --git a/tests/helpers/path_utils.py b/tests/helpers/path_utils.pyindex 7a9e7e496..6c438e065 100644--- a/tests/helpers/path_utils.py+++ b/tests/helpers/path_utils.py@@ -7,5 +7,5 @@ def get_project_root() -> Path:def get_svg_resource(filename):return str(- get_project_root() / "tests/test_graphical_units/img_svg_resources" / filename+ get_project_root() / "tests/test_graphical_units/img_svg_resources" / filename,)diff --git a/tests/helpers/video_utils.py b/tests/helpers/video_utils.pyindex 9776a217e..64c413049 100644--- a/tests/helpers/video_utils.py+++ b/tests/helpers/video_utils.py@@ -55,5 +55,6 @@ def save_control_data_from_video(path_to_video, name):"config": json.loads(config_video)["streams"][0],}path_saved = os.path.join(path_control_data, f"{name}.json")- json.dump(data, open(path_saved, "w"), indent=4)+ with open(path_saved, "w") as f:+ json.dump(data, f, indent=4)logger.info(f"Data for {name} saved in {path_saved}")diff --git a/tests/template_generate_graphical_units_data.py b/tests/template_generate_graphical_units_data.pyindex 3f8afa1e2..4b0960e18 100644--- a/tests/template_generate_graphical_units_data.py+++ b/tests/template_generate_graphical_units_data.py@@ -14,5 +14,6 @@ class YourClassTest(Scene): # e.g. RoundedRectangleTestset_test_scene(- YourClassTest, "INSERT_MODULE_NAME"+ YourClassTest,+ "INSERT_MODULE_NAME",) # INSERT_MODULE_NAME can be e.g. "geometry" or "movements"diff --git a/tests/test_animate.py b/tests/test_animate.pyindex 25cfd10cc..7739e2148 100644--- a/tests/test_animate.py+++ b/tests/test_animate.py@@ -70,12 +70,14 @@ def test_chaining_overridden_animate():return Uncreate(self.line, **anim_args)with pytest.raises(- NotImplementedError, match="not supported for overridden animations"+ NotImplementedError,+ match="not supported for overridden animations",):DotsWithLine().animate.shift((1, 0, 0)).remove_line()with pytest.raises(- NotImplementedError, match="not supported for overridden animations"+ NotImplementedError,+ match="not supported for overridden animations",):DotsWithLine().animate.remove_line().shift((1, 0, 0))diff --git a/tests/test_commands.py b/tests/test_commands.pyindex 47408ed3a..7358f9044 100644--- a/tests/test_commands.py+++ b/tests/test_commands.py@@ -73,12 +73,12 @@ def test_manim_init_subcommand():expected_main_py = ""with open(- Path.resolve(Path(__file__).parent.parent / "manim/templates/template.cfg")+ Path.resolve(Path(__file__).parent.parent / "manim/templates/template.cfg"),) as f:expected_manim_cfg = f.read()with open(- Path.resolve(Path(__file__).parent.parent / "manim/templates/Default.mtp")+ Path.resolve(Path(__file__).parent.parent / "manim/templates/Default.mtp"),) as f:expected_main_py = f.read()diff --git a/tests/test_config.py b/tests/test_config.pyindex 9fa818a66..607dff597 100644--- a/tests/test_config.py+++ b/tests/test_config.py@@ -74,7 +74,7 @@ def test_digest_file(tmp_path):media_dir = this_is_my_favorite_pathvideo_dir = {media_dir}/videosframe_height = 10- """+ """,)tmp_cfg.close()config.digest_file(tmp_cfg.name)@@ -95,7 +95,7 @@ def test_frame_size(tmp_path):[CLI]pixel_height = 10pixel_width = 10- """+ """,)tmp_cfg.close()config.digest_file(tmp_cfg.name)@@ -115,7 +115,7 @@ def test_frame_size(tmp_path):pixel_width = 10frame_height = 10frame_width = 10- """+ """,)tmp_cfg.close()config.digest_file(tmp_cfg.name)@@ -142,7 +142,7 @@ def test_temporary_dry_run():def test_dry_run_with_png_format():"""Test that there are no exceptions when running a png without output"""with tempconfig(- {"write_to_movie": False, "disable_caching": True, "format": "png"}+ {"write_to_movie": False, "disable_caching": True, "format": "png"},):assert config["dry_run"] is Truescene = MyScene()@@ -152,7 +152,7 @@ def test_dry_run_with_png_format():def test_dry_run_with_png_format_skipped_animations():"""Test that there are no exceptions when running a png without output and skipped animations"""with tempconfig(- {"write_to_movie": False, "disable_caching": True, "format": "png"}+ {"write_to_movie": False, "disable_caching": True, "format": "png"},):assert config["dry_run"] is Truescene = MyScene(skip_animations=True)diff --git a/tests/test_deprecation.py b/tests/test_deprecation.pyindex d3e92728b..a5601b534 100644--- a/tests/test_deprecation.py+++ b/tests/test_deprecation.py@@ -215,15 +215,15 @@ class Top:return kwargs@deprecated_params(- redirections=[lambda runtime_in_ms: {"run_time": runtime_in_ms / 1000}]+ redirections=[lambda runtime_in_ms: {"run_time": runtime_in_ms / 1000}],)def qux(self, **kwargs):return kwargs@deprecated_params(redirections=[- lambda point2D_x=1, point2D_y=1: {"point2D": (point2D_x, point2D_y)}- ]+ lambda point2D_x=1, point2D_y=1: {"point2D": (point2D_x, point2D_y)},+ ],)def quux(self, **kwargs):return kwargs@@ -232,8 +232,8 @@ class Top:redirections=[lambda point2D=1: {"x": point2D[0], "y": point2D[1]}if isinstance(point2D, tuple)- else {"x": point2D, "y": point2D}- ]+ else {"x": point2D, "y": point2D},+ ],)def quuz(self, **kwargs):return kwargsdiff --git a/tests/test_graphical_units/img_svg_resources/arcs01.svg b/tests/test_graphical_units/img_svg_resources/arcs01.svgindex 9e4b9a577..235fdddac 100644--- a/tests/test_graphical_units/img_svg_resources/arcs01.svg+++ b/tests/test_graphical_units/img_svg_resources/arcs01.svg@@ -1,5 +1,5 @@<?xml version="1.0" standalone="no"?>-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="12cm" height="5.25cm" viewBox="0 0 1200 400"xmlns="http://www.w3.org/2000/svg" version="1.1">@@ -14,11 +14,10 @@<path d="M275,175 v-150 a150,150 0 0,0 -150,150 z"fill="yellow" stroke="blue" stroke-width="5" />- <path d="M600,350 l 50,-25- a25,25 -30 0,1 50,-25 l 50,-25- a25,50 -30 0,1 50,-25 l 50,-25- a25,75 -30 0,1 50,-25 l 50,-25+ <path d="M600,350 l 50,-25+ a25,25 -30 0,1 50,-25 l 50,-25+ a25,50 -30 0,1 50,-25 l 50,-25+ a25,75 -30 0,1 50,-25 l 50,-25a25,100 -30 0,1 50,-25 l 50,-25"fill="none" stroke="red" stroke-width="5" /></svg>-diff --git a/tests/test_graphical_units/img_svg_resources/arcs02.svg b/tests/test_graphical_units/img_svg_resources/arcs02.svgindex c0bddf955..c4b42c41a 100644--- a/tests/test_graphical_units/img_svg_resources/arcs02.svg+++ b/tests/test_graphical_units/img_svg_resources/arcs02.svg@@ -1,5 +1,5 @@<?xml version="1.0" standalone="no"?>-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="12cm" height="5.25cm" viewBox="0 0 1200 525" version="1.1"xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">@@ -56,4 +56,3 @@</g></g></svg>-diff --git a/tests/test_graphical_units/img_svg_resources/cubic_and_lineto.svg b/tests/test_graphical_units/img_svg_resources/cubic_and_lineto.svgindex 8bab5e5ea..9bfe8f926 100644--- a/tests/test_graphical_units/img_svg_resources/cubic_and_lineto.svg+++ b/tests/test_graphical_units/img_svg_resources/cubic_and_lineto.svg@@ -3,4 +3,4 @@<path style="fill:white" d="m 50,50 c 0,10 10,0 10,10 -10,0 0,10, -10,10 l -5,5 0,-30 z"></path></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/cubic_demo.svg b/tests/test_graphical_units/img_svg_resources/cubic_demo.svgindex 2c6bf004d..e662a4b4f 100644--- a/tests/test_graphical_units/img_svg_resources/cubic_demo.svg+++ b/tests/test_graphical_units/img_svg_resources/cubic_demo.svg@@ -3,4 +3,4 @@<path d="m 50,50 c 0,10 10,0 10,10 -10,0 0,10, -10,10 z"></path></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/curve.svg b/tests/test_graphical_units/img_svg_resources/curve.svgindex 0ccb1e35a..6aba8bdc2 100644--- a/tests/test_graphical_units/img_svg_resources/curve.svg+++ b/tests/test_graphical_units/img_svg_resources/curve.svg@@ -1,5 +1,5 @@<?xml version="1.0" encoding="windows-1252" standalone="no"?>-<svg+<svgwidth="1200" height="600"viewBox="0 0 1200 600"xmlns="http://www.w3.org/2000/svg"@@ -64,4 +64,3 @@</g></g></svg>-diff --git a/tests/test_graphical_units/img_svg_resources/desmos-graph_1.svg b/tests/test_graphical_units/img_svg_resources/desmos-graph_1.svgindex b9feb8fad..2e2d91f7c 100644--- a/tests/test_graphical_units/img_svg_resources/desmos-graph_1.svg+++ b/tests/test_graphical_units/img_svg_resources/desmos-graph_1.svg@@ -98,4 +98,4 @@</g></g></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/inheritance_test.svg b/tests/test_graphical_units/img_svg_resources/inheritance_test.svgindex d1063ada7..56bb6fb82 100644--- a/tests/test_graphical_units/img_svg_resources/inheritance_test.svg+++ b/tests/test_graphical_units/img_svg_resources/inheritance_test.svg@@ -4,4 +4,4 @@<path d="M 0,45 h 25 v -5 l 10,10 -10,10 v -5 h -25 z"/><path d="M 160,45 h 25 v -5 l 10,10 -10,10 v -5 h -25 z"/></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/matrix.svg b/tests/test_graphical_units/img_svg_resources/matrix.svgindex 41a053fba..464355442 100644--- a/tests/test_graphical_units/img_svg_resources/matrix.svg+++ b/tests/test_graphical_units/img_svg_resources/matrix.svg@@ -26,4 +26,4 @@newY = b * oldX + d * oldY + f = 1 * 40 + 3 * 30 + 40 = 170--><rect x="10" y="10" width="30" height="20" fill="red" transform="matrix(3 1 -1 3 30 40)" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/multi_part_path.svg b/tests/test_graphical_units/img_svg_resources/multi_part_path.svgindex 28eb44573..d5b61e327 100644--- a/tests/test_graphical_units/img_svg_resources/multi_part_path.svg+++ b/tests/test_graphical_units/img_svg_resources/multi_part_path.svg@@ -3,4 +3,4 @@<path style="fill : white" d="m 50,50 10,10 -10,10 z m 30,0 -10,-10, -10,10 z"></path></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/multiple_transforms.svg b/tests/test_graphical_units/img_svg_resources/multiple_transforms.svgindex a7331ecba..2db7ea9e7 100644--- a/tests/test_graphical_units/img_svg_resources/multiple_transforms.svg+++ b/tests/test_graphical_units/img_svg_resources/multiple_transforms.svg@@ -22,75 +22,75 @@</defs><g id="figure_1"><g id="patch_1">- <path d="M 0 345.6-L 460.8 345.6-L 460.8 0-L 0 0+ <path d="M 0 345.6+L 460.8 345.6+L 460.8 0+L 0 0z" style="fill:none;"/></g><g id="axes_1"><g id="patch_2">- <path d="M 57.6 307.584-L 414.72 307.584-L 414.72 41.472-L 57.6 41.472+ <path d="M 57.6 307.584+L 414.72 307.584+L 414.72 41.472+L 57.6 41.472z" style="fill:none;"/></g><g id="patch_3">- <path clip-path="url(#p123f0cd496)" d="M 127.941818 307.584-L 127.941818 214.337628-L 130.150353 218.066976-L 132.358887 221.647169-L 134.567421 225.084175-L 136.775955 228.383719-L 138.98449 231.551299-L 141.193024 234.592194-L 143.401558 237.511469-L 145.610093 240.313989-L 147.818627 243.004423-L 150.027161 245.587255-L 152.235696 248.066787-L 154.44423 250.447152-L 156.652764 252.732315-L 158.861299 254.926084-L 161.069833 257.032114-L 163.278367 259.053914-L 165.486902 260.994854-L 167.695436 262.858166-L 169.90397 264.646956-L 172.112505 266.364204-L 174.321039 268.012772-L 176.529573 269.595406-L 178.738108 271.114743-L 180.946642 272.573315-L 183.155176 273.973551-L 185.363711 275.317786-L 187.572245 276.608259-L 189.780779 277.847121-L 191.989314 279.036434-L 194.197848 280.178181-L 196.406382 281.274265-L 198.614917 282.326511-L 200.823451 283.336673-L 203.031985 284.306434-L 205.240519 285.23741-L 207.449054 286.131152-L 209.657588 286.989149-L 211.866122 287.812831-L 214.074657 288.603571-L 216.283191 289.362684-L 218.491725 290.091438-L 220.70026 290.791045-L 222.908794 291.462672-L 225.117328 292.107437-L 227.325863 292.726416-L 229.534397 293.320638-L 231.742931 293.891095-L 233.951466 294.438737-L 236.16 294.964476-L 236.16 307.584+ <path clip-path="url(#p123f0cd496)" d="M 127.941818 307.584+L 127.941818 214.337628+L 130.150353 218.066976+L 132.358887 221.647169+L 134.567421 225.084175+L 136.775955 228.383719+L 138.98449 231.551299+L 141.193024 234.592194+L 143.401558 237.511469+L 145.610093 240.313989+L 147.818627 243.004423+L 150.027161 245.587255+L 152.235696 248.066787+L 154.44423 250.447152+L 156.652764 252.732315+L 158.861299 254.926084+L 161.069833 257.032114+L 163.278367 259.053914+L 165.486902 260.994854+L 167.695436 262.858166+L 169.90397 264.646956+L 172.112505 266.364204+L 174.321039 268.012772+L 176.529573 269.595406+L 178.738108 271.114743+L 180.946642 272.573315+L 183.155176 273.973551+L 185.363711 275.317786+L 187.572245 276.608259+L 189.780779 277.847121+L 191.989314 279.036434+L 194.197848 280.178181+L 196.406382 281.274265+L 198.614917 282.326511+L 200.823451 283.336673+L 203.031985 284.306434+L 205.240519 285.23741+L 207.449054 286.131152+L 209.657588 286.989149+L 211.866122 287.812831+L 214.074657 288.603571+L 216.283191 289.362684+L 218.491725 290.091438+L 220.70026 290.791045+L 222.908794 291.462672+L 225.117328 292.107437+L 227.325863 292.726416+L 229.534397 293.320638+L 231.742931 293.891095+L 233.951466 294.438737+L 236.16 294.964476+L 236.16 307.584z" style="fill:#e6e6e6;stroke:#333333;stroke-linejoin:miter;"/></g>@@ -98,8 +98,8 @@ z<g id="xtick_1"><g id="line2d_1"><defs>- <path d="M 0 0-L 0 3.5+ <path d="M 0 0+L 0 3.5" id="m10db1555b6" style="stroke:#000000;stroke-width:0.8;"/></defs><g>@@ -110,25 +110,25 @@ L 0 3.5<!-- 0 --><g transform="translate(70.651477 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 31.78125 66.40625-Q 24.171875 66.40625 20.328125 58.90625-Q 16.5 51.421875 16.5 36.375-Q 16.5 21.390625 20.328125 13.890625-Q 24.171875 6.390625 31.78125 6.390625-Q 39.453125 6.390625 43.28125 13.890625-Q 47.125 21.390625 47.125 36.375-Q 47.125 51.421875 43.28125 58.90625-Q 39.453125 66.40625 31.78125 66.40625+ <path d="M 31.78125 66.40625+Q 24.171875 66.40625 20.328125 58.90625+Q 16.5 51.421875 16.5 36.375+Q 16.5 21.390625 20.328125 13.890625+Q 24.171875 6.390625 31.78125 6.390625+Q 39.453125 6.390625 43.28125 13.890625+Q 47.125 21.390625 47.125 36.375+Q 47.125 51.421875 43.28125 58.90625+Q 39.453125 66.40625 31.78125 66.40625z-M 31.78125 74.21875-Q 44.046875 74.21875 50.515625 64.515625-Q 56.984375 54.828125 56.984375 36.375-Q 56.984375 17.96875 50.515625 8.265625-Q 44.046875 -1.421875 31.78125 -1.421875-Q 19.53125 -1.421875 13.0625 8.265625-Q 6.59375 17.96875 6.59375 36.375-Q 6.59375 54.828125 13.0625 64.515625-Q 19.53125 74.21875 31.78125 74.21875+M 31.78125 74.21875+Q 44.046875 74.21875 50.515625 64.515625+Q 56.984375 54.828125 56.984375 36.375+Q 56.984375 17.96875 50.515625 8.265625+Q 44.046875 -1.421875 31.78125 -1.421875+Q 19.53125 -1.421875 13.0625 8.265625+Q 6.59375 17.96875 6.59375 36.375+Q 6.59375 54.828125 13.0625 64.515625+Q 19.53125 74.21875 31.78125 74.21875z" id="DejaVuSans-48"/></defs>@@ -146,17 +146,17 @@ z<!-- 1 --><g transform="translate(124.760568 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 12.40625 8.296875-L 28.515625 8.296875-L 28.515625 63.921875-L 10.984375 60.40625-L 10.984375 69.390625-L 28.421875 72.90625-L 38.28125 72.90625-L 38.28125 8.296875-L 54.390625 8.296875-L 54.390625 0-L 12.40625 0+ <path d="M 12.40625 8.296875+L 28.515625 8.296875+L 28.515625 63.921875+L 10.984375 60.40625+L 10.984375 69.390625+L 28.421875 72.90625+L 38.28125 72.90625+L 38.28125 8.296875+L 54.390625 8.296875+L 54.390625 0+L 12.40625 0z" id="DejaVuSans-49"/></defs>@@ -174,28 +174,28 @@ z<!-- 2 --><g transform="translate(178.869659 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 19.1875 8.296875-L 53.609375 8.296875-L 53.609375 0-L 7.328125 0-L 7.328125 8.296875-Q 12.9375 14.109375 22.625 23.890625-Q 32.328125 33.6875 34.8125 36.53125-Q 39.546875 41.84375 41.421875 45.53125-Q 43.3125 49.21875 43.3125 52.78125-Q 43.3125 58.59375 39.234375 62.25-Q 35.15625 65.921875 28.609375 65.921875-Q 23.96875 65.921875 18.8125 64.3125-Q 13.671875 62.703125 7.8125 59.421875-L 7.8125 69.390625-Q 13.765625 71.78125 18.9375 73-Q 24.125 74.21875 28.421875 74.21875-Q 39.75 74.21875 46.484375 68.546875-Q 53.21875 62.890625 53.21875 53.421875-Q 53.21875 48.921875 51.53125 44.890625-Q 49.859375 40.875 45.40625 35.40625-Q 44.1875 33.984375 37.640625 27.21875-Q 31.109375 20.453125 19.1875 8.296875+ <path d="M 19.1875 8.296875+L 53.609375 8.296875+L 53.609375 0+L 7.328125 0+L 7.328125 8.296875+Q 12.9375 14.109375 22.625 23.890625+Q 32.328125 33.6875 34.8125 36.53125+Q 39.546875 41.84375 41.421875 45.53125+Q 43.3125 49.21875 43.3125 52.78125+Q 43.3125 58.59375 39.234375 62.25+Q 35.15625 65.921875 28.609375 65.921875+Q 23.96875 65.921875 18.8125 64.3125+Q 13.671875 62.703125 7.8125 59.421875+L 7.8125 69.390625+Q 13.765625 71.78125 18.9375 73+Q 24.125 74.21875 28.421875 74.21875+Q 39.75 74.21875 46.484375 68.546875+Q 53.21875 62.890625 53.21875 53.421875+Q 53.21875 48.921875 51.53125 44.890625+Q 49.859375 40.875 45.40625 35.40625+Q 44.1875 33.984375 37.640625 27.21875+Q 31.109375 20.453125 19.1875 8.296875z" id="DejaVuSans-50"/></defs>@@ -213,36 +213,36 @@ z<!-- 3 --><g transform="translate(232.97875 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 40.578125 39.3125-Q 47.65625 37.796875 51.625 33-Q 55.609375 28.21875 55.609375 21.1875-Q 55.609375 10.40625 48.1875 4.484375-Q 40.765625 -1.421875 27.09375 -1.421875-Q 22.515625 -1.421875 17.65625 -0.515625-Q 12.796875 0.390625 7.625 2.203125-L 7.625 11.71875-Q 11.71875 9.328125 16.59375 8.109375-Q 21.484375 6.890625 26.8125 6.890625-Q 36.078125 6.890625 40.9375 10.546875-Q 45.796875 14.203125 45.796875 21.1875-Q 45.796875 27.640625 41.28125 31.265625-Q 36.765625 34.90625 28.71875 34.90625-L 20.21875 34.90625-L 20.21875 43.015625-L 29.109375 43.015625-Q 36.375 43.015625 40.234375 45.921875-Q 44.09375 48.828125 44.09375 54.296875-Q 44.09375 59.90625 40.109375 62.90625-Q 36.140625 65.921875 28.71875 65.921875-Q 24.65625 65.921875 20.015625 65.03125-Q 15.375 64.15625 9.8125 62.3125-L 9.8125 71.09375-Q 15.4375 72.65625 20.34375 73.4375-Q 25.25 74.21875 29.59375 74.21875-Q 40.828125 74.21875 47.359375 69.109375-Q 53.90625 64.015625 53.90625 55.328125-Q 53.90625 49.265625 50.4375 45.09375-Q 46.96875 40.921875 40.578125 39.3125+ <path d="M 40.578125 39.3125+Q 47.65625 37.796875 51.625 33+Q 55.609375 28.21875 55.609375 21.1875+Q 55.609375 10.40625 48.1875 4.484375+Q 40.765625 -1.421875 27.09375 -1.421875+Q 22.515625 -1.421875 17.65625 -0.515625+Q 12.796875 0.390625 7.625 2.203125+L 7.625 11.71875+Q 11.71875 9.328125 16.59375 8.109375+Q 21.484375 6.890625 26.8125 6.890625+Q 36.078125 6.890625 40.9375 10.546875+Q 45.796875 14.203125 45.796875 21.1875+Q 45.796875 27.640625 41.28125 31.265625+Q 36.765625 34.90625 28.71875 34.90625+L 20.21875 34.90625+L 20.21875 43.015625+L 29.109375 43.015625+Q 36.375 43.015625 40.234375 45.921875+Q 44.09375 48.828125 44.09375 54.296875+Q 44.09375 59.90625 40.109375 62.90625+Q 36.140625 65.921875 28.71875 65.921875+Q 24.65625 65.921875 20.015625 65.03125+Q 15.375 64.15625 9.8125 62.3125+L 9.8125 71.09375+Q 15.4375 72.65625 20.34375 73.4375+Q 25.25 74.21875 29.59375 74.21875+Q 40.828125 74.21875 47.359375 69.109375+Q 53.90625 64.015625 53.90625 55.328125+Q 53.90625 49.265625 50.4375 45.09375+Q 46.96875 40.921875 40.578125 39.3125z" id="DejaVuSans-51"/></defs>@@ -260,21 +260,21 @@ z<!-- 4 --><g transform="translate(287.087841 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 37.796875 64.3125-L 12.890625 25.390625-L 37.796875 25.390625+ <path d="M 37.796875 64.3125+L 12.890625 25.390625+L 37.796875 25.390625z-M 35.203125 72.90625-L 47.609375 72.90625-L 47.609375 25.390625-L 58.015625 25.390625-L 58.015625 17.1875-L 47.609375 17.1875-L 47.609375 0-L 37.796875 0-L 37.796875 17.1875-L 4.890625 17.1875-L 4.890625 26.703125+M 35.203125 72.90625+L 47.609375 72.90625+L 47.609375 25.390625+L 58.015625 25.390625+L 58.015625 17.1875+L 47.609375 17.1875+L 47.609375 0+L 37.796875 0+L 37.796875 17.1875+L 4.890625 17.1875+L 4.890625 26.703125z" id="DejaVuSans-52"/></defs>@@ -292,28 +292,28 @@ z<!-- 5 --><g transform="translate(341.196932 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 10.796875 72.90625-L 49.515625 72.90625-L 49.515625 64.59375-L 19.828125 64.59375-L 19.828125 46.734375-Q 21.96875 47.46875 24.109375 47.828125-Q 26.265625 48.1875 28.421875 48.1875-Q 40.625 48.1875 47.75 41.5-Q 54.890625 34.8125 54.890625 23.390625-Q 54.890625 11.625 47.5625 5.09375-Q 40.234375 -1.421875 26.90625 -1.421875-Q 22.3125 -1.421875 17.546875 -0.640625-Q 12.796875 0.140625 7.71875 1.703125-L 7.71875 11.625-Q 12.109375 9.234375 16.796875 8.0625-Q 21.484375 6.890625 26.703125 6.890625-Q 35.15625 6.890625 40.078125 11.328125-Q 45.015625 15.765625 45.015625 23.390625-Q 45.015625 31 40.078125 35.4375-Q 35.15625 39.890625 26.703125 39.890625-Q 22.75 39.890625 18.8125 39.015625-Q 14.890625 38.140625 10.796875 36.28125+ <path d="M 10.796875 72.90625+L 49.515625 72.90625+L 49.515625 64.59375+L 19.828125 64.59375+L 19.828125 46.734375+Q 21.96875 47.46875 24.109375 47.828125+Q 26.265625 48.1875 28.421875 48.1875+Q 40.625 48.1875 47.75 41.5+Q 54.890625 34.8125 54.890625 23.390625+Q 54.890625 11.625 47.5625 5.09375+Q 40.234375 -1.421875 26.90625 -1.421875+Q 22.3125 -1.421875 17.546875 -0.640625+Q 12.796875 0.140625 7.71875 1.703125+L 7.71875 11.625+Q 12.109375 9.234375 16.796875 8.0625+Q 21.484375 6.890625 26.703125 6.890625+Q 35.15625 6.890625 40.078125 11.328125+Q 45.015625 15.765625 45.015625 23.390625+Q 45.015625 31 40.078125 35.4375+Q 35.15625 39.890625 26.703125 39.890625+Q 22.75 39.890625 18.8125 39.015625+Q 14.890625 38.140625 10.796875 36.28125z" id="DejaVuSans-53"/></defs>@@ -331,34 +331,34 @@ z<!-- 6 --><g transform="translate(395.306023 322.182437)scale(0.1 -0.1)"><defs>- <path d="M 33.015625 40.375-Q 26.375 40.375 22.484375 35.828125-Q 18.609375 31.296875 18.609375 23.390625-Q 18.609375 15.53125 22.484375 10.953125-Q 26.375 6.390625 33.015625 6.390625-Q 39.65625 6.390625 43.53125 10.953125-Q 47.40625 15.53125 47.40625 23.390625-Q 47.40625 31.296875 43.53125 35.828125-Q 39.65625 40.375 33.015625 40.375+ <path d="M 33.015625 40.375+Q 26.375 40.375 22.484375 35.828125+Q 18.609375 31.296875 18.609375 23.390625+Q 18.609375 15.53125 22.484375 10.953125+Q 26.375 6.390625 33.015625 6.390625+Q 39.65625 6.390625 43.53125 10.953125+Q 47.40625 15.53125 47.40625 23.390625+Q 47.40625 31.296875 43.53125 35.828125+Q 39.65625 40.375 33.015625 40.375z-M 52.59375 71.296875-L 52.59375 62.3125-Q 48.875 64.0625 45.09375 64.984375-Q 41.3125 65.921875 37.59375 65.921875-Q 27.828125 65.921875 22.671875 59.328125-Q 17.53125 52.734375 16.796875 39.40625-Q 19.671875 43.65625 24.015625 45.921875-Q 28.375 48.1875 33.59375 48.1875-Q 44.578125 48.1875 50.953125 41.515625-Q 57.328125 34.859375 57.328125 23.390625-Q 57.328125 12.15625 50.6875 5.359375-Q 44.046875 -1.421875 33.015625 -1.421875-Q 20.359375 -1.421875 13.671875 8.265625-Q 6.984375 17.96875 6.984375 36.375-Q 6.984375 53.65625 15.1875 63.9375-Q 23.390625 74.21875 37.203125 74.21875-Q 40.921875 74.21875 44.703125 73.484375-Q 48.484375 72.75 52.59375 71.296875+M 52.59375 71.296875+L 52.59375 62.3125+Q 48.875 64.0625 45.09375 64.984375+Q 41.3125 65.921875 37.59375 65.921875+Q 27.828125 65.921875 22.671875 59.328125+Q 17.53125 52.734375 16.796875 39.40625+Q 19.671875 43.65625 24.015625 45.921875+Q 28.375 48.1875 33.59375 48.1875+Q 44.578125 48.1875 50.953125 41.515625+Q 57.328125 34.859375 57.328125 23.390625+Q 57.328125 12.15625 50.6875 5.359375+Q 44.046875 -1.421875 33.015625 -1.421875+Q 20.359375 -1.421875 13.671875 8.265625+Q 6.984375 17.96875 6.984375 36.375+Q 6.984375 53.65625 15.1875 63.9375+Q 23.390625 74.21875 37.203125 74.21875+Q 40.921875 74.21875 44.703125 73.484375+Q 48.484375 72.75 52.59375 71.296875z" id="DejaVuSans-54"/></defs>@@ -371,8 +371,8 @@ z<g id="ytick_1"><g id="line2d_8"><defs>- <path d="M 0 0-L -3.5 0+ <path d="M 0 0+L -3.5 0" id="me27c8cc867" style="stroke:#000000;stroke-width:0.8;"/></defs><g>@@ -383,10 +383,10 @@ L -3.5 0<!-- 0.0 --><g transform="translate(50.929602 311.383219)scale(0.1 -0.1)"><defs>- <path d="M 10.6875 12.40625-L 21 12.40625-L 21 0-L 10.6875 0+ <path d="M 10.6875 12.40625+L 21 12.40625+L 21 0+L 10.6875 0z" id="DejaVuSans-46"/></defs>@@ -451,43 +451,43 @@ z<!-- 0.8 --><g transform="translate(50.929602 108.607284)scale(0.1 -0.1)"><defs>- <path d="M 31.78125 34.625-Q 24.75 34.625 20.71875 30.859375-Q 16.703125 27.09375 16.703125 20.515625-Q 16.703125 13.921875 20.71875 10.15625-Q 24.75 6.390625 31.78125 6.390625-Q 38.8125 6.390625 42.859375 10.171875-Q 46.921875 13.96875 46.921875 20.515625-Q 46.921875 27.09375 42.890625 30.859375-Q 38.875 34.625 31.78125 34.625+ <path d="M 31.78125 34.625+Q 24.75 34.625 20.71875 30.859375+Q 16.703125 27.09375 16.703125 20.515625+Q 16.703125 13.921875 20.71875 10.15625+Q 24.75 6.390625 31.78125 6.390625+Q 38.8125 6.390625 42.859375 10.171875+Q 46.921875 13.96875 46.921875 20.515625+Q 46.921875 27.09375 42.890625 30.859375+Q 38.875 34.625 31.78125 34.625z-M 21.921875 38.8125-Q 15.578125 40.375 12.03125 44.71875-Q 8.5 49.078125 8.5 55.328125-Q 8.5 64.0625 14.71875 69.140625-Q 20.953125 74.21875 31.78125 74.21875-Q 42.671875 74.21875 48.875 69.140625-Q 55.078125 64.0625 55.078125 55.328125-Q 55.078125 49.078125 51.53125 44.71875-Q 48 40.375 41.703125 38.8125-Q 48.828125 37.15625 52.796875 32.3125-Q 56.78125 27.484375 56.78125 20.515625-Q 56.78125 9.90625 50.3125 4.234375-Q 43.84375 -1.421875 31.78125 -1.421875-Q 19.734375 -1.421875 13.25 4.234375-Q 6.78125 9.90625 6.78125 20.515625-Q 6.78125 27.484375 10.78125 32.3125-Q 14.796875 37.15625 21.921875 38.8125+M 21.921875 38.8125+Q 15.578125 40.375 12.03125 44.71875+Q 8.5 49.078125 8.5 55.328125+Q 8.5 64.0625 14.71875 69.140625+Q 20.953125 74.21875 31.78125 74.21875+Q 42.671875 74.21875 48.875 69.140625+Q 55.078125 64.0625 55.078125 55.328125+Q 55.078125 49.078125 51.53125 44.71875+Q 48 40.375 41.703125 38.8125+Q 48.828125 37.15625 52.796875 32.3125+Q 56.78125 27.484375 56.78125 20.515625+Q 56.78125 9.90625 50.3125 4.234375+Q 43.84375 -1.421875 31.78125 -1.421875+Q 19.734375 -1.421875 13.25 4.234375+Q 6.78125 9.90625 6.78125 20.515625+Q 6.78125 27.484375 10.78125 32.3125+Q 14.796875 37.15625 21.921875 38.8125z-M 18.3125 54.390625-Q 18.3125 48.734375 21.84375 45.5625-Q 25.390625 42.390625 31.78125 42.390625-Q 38.140625 42.390625 41.71875 45.5625-Q 45.3125 48.734375 45.3125 54.390625-Q 45.3125 60.0625 41.71875 63.234375-Q 38.140625 66.40625 31.78125 66.40625-Q 25.390625 66.40625 21.84375 63.234375-Q 18.3125 60.0625 18.3125 54.390625+M 18.3125 54.390625+Q 18.3125 48.734375 21.84375 45.5625+Q 25.390625 42.390625 31.78125 42.390625+Q 38.140625 42.390625 41.71875 45.5625+Q 45.3125 48.734375 45.3125 54.390625+Q 45.3125 60.0625 41.71875 63.234375+Q 38.140625 66.40625 31.78125 66.40625+Q 25.390625 66.40625 21.84375 63.234375+Q 18.3125 60.0625 18.3125 54.390625z" id="DejaVuSans-56"/></defs>@@ -514,116 +514,116 @@ z</g></g><g id="line2d_14">- <path clip-path="url(#p123f0cd496)" d="M 73.832727 54.114081-L 77.112066 69.019649-L 80.391405 83.048678-L 83.670744 96.252716-L 86.950083 108.680276-L 90.229421 120.37702-L 93.50876 131.385925-L 96.788099 141.74744-L 100.067438 151.499634-L 103.346777 160.678341-L 106.626116 169.317284-L 109.905455 177.448205-L 113.184793 185.100978-L 116.464132 192.303722-L 119.743471 199.082901-L 123.02281 205.463423-L 126.302149 211.468732-L 129.581488 217.120892-L 132.860826 222.440671-L 136.140165 227.447615-L 139.419504 232.16012-L 142.698843 236.595501-L 145.978182 240.770055-L 149.257521 244.69912-L 152.53686 248.397132-L 155.816198 251.877678-L 159.095537 255.153548-L 162.374876 258.236776-L 165.654215 261.138692-L 168.933554 263.869957-L 172.212893 266.440608-L 175.492231 268.860089-L 178.77157 271.137289-L 182.050909 273.280577-L 185.330248 275.297826-L 188.609587 277.196449-L 191.888926 278.983421-L 195.168264 280.665308-L 198.447603 282.24829-L 201.726942 283.738184-L 205.006281 285.140462-L 208.28562 286.460278-L 211.564959 287.702481-L 214.844298 288.871635-L 218.123636 289.972035-L 221.402975 291.007726-L 224.682314 291.982511-L 227.961653 292.899973-L 231.240992 293.763483-L 234.520331 294.576213-L 237.799669 295.34115-L 241.079008 296.061103-L 244.358347 296.73872-L 247.637686 297.376488-L 250.917025 297.976751-L 254.196364 298.541716-L 257.475702 299.073457-L 260.755041 299.573928-L 264.03438 300.044969-L 267.313719 300.48831-L 270.593058 300.905579-L 273.872397 301.298311-L 277.151736 301.667948-L 280.431074 302.015847-L 283.710413 302.343288-L 286.989752 302.651474-L 290.269091 302.941537-L 293.54843 303.214541-L 296.827769 303.471492-L 300.107107 303.713333-L 303.386446 303.940951-L 306.665785 304.155185-L 309.945124 304.35682-L 313.224463 304.546597-L 316.503802 304.725215-L 319.78314 304.893329-L 323.062479 305.051557-L 326.341818 305.20048-L 329.621157 305.340645-L 332.900496 305.472568-L 336.179835 305.596733-L 339.459174 305.713596-L 342.738512 305.823587-L 346.017851 305.92711-L 349.29719 306.024546-L 352.576529 306.116251-L 355.855868 306.202563-L 359.135207 306.2838-L 362.414545 306.36026-L 365.693884 306.432223-L 368.973223 306.499955-L 372.252562 306.563703-L 375.531901 306.623703-L 378.81124 306.680174-L 382.090579 306.733325-L 385.369917 306.783349-L 388.649256 306.830432-L 391.928595 306.874747-L 395.207934 306.916455-L 398.487273 306.955711+ <path clip-path="url(#p123f0cd496)" d="M 73.832727 54.114081+L 77.112066 69.019649+L 80.391405 83.048678+L 83.670744 96.252716+L 86.950083 108.680276+L 90.229421 120.37702+L 93.50876 131.385925+L 96.788099 141.74744+L 100.067438 151.499634+L 103.346777 160.678341+L 106.626116 169.317284+L 109.905455 177.448205+L 113.184793 185.100978+L 116.464132 192.303722+L 119.743471 199.082901+L 123.02281 205.463423+L 126.302149 211.468732+L 129.581488 217.120892+L 132.860826 222.440671+L 136.140165 227.447615+L 139.419504 232.16012+L 142.698843 236.595501+L 145.978182 240.770055+L 149.257521 244.69912+L 152.53686 248.397132+L 155.816198 251.877678+L 159.095537 255.153548+L 162.374876 258.236776+L 165.654215 261.138692+L 168.933554 263.869957+L 172.212893 266.440608+L 175.492231 268.860089+L 178.77157 271.137289+L 182.050909 273.280577+L 185.330248 275.297826+L 188.609587 277.196449+L 191.888926 278.983421+L 195.168264 280.665308+L 198.447603 282.24829+L 201.726942 283.738184+L 205.006281 285.140462+L 208.28562 286.460278+L 211.564959 287.702481+L 214.844298 288.871635+L 218.123636 289.972035+L 221.402975 291.007726+L 224.682314 291.982511+L 227.961653 292.899973+L 231.240992 293.763483+L 234.520331 294.576213+L 237.799669 295.34115+L 241.079008 296.061103+L 244.358347 296.73872+L 247.637686 297.376488+L 250.917025 297.976751+L 254.196364 298.541716+L 257.475702 299.073457+L 260.755041 299.573928+L 264.03438 300.044969+L 267.313719 300.48831+L 270.593058 300.905579+L 273.872397 301.298311+L 277.151736 301.667948+L 280.431074 302.015847+L 283.710413 302.343288+L 286.989752 302.651474+L 290.269091 302.941537+L 293.54843 303.214541+L 296.827769 303.471492+L 300.107107 303.713333+L 303.386446 303.940951+L 306.665785 304.155185+L 309.945124 304.35682+L 313.224463 304.546597+L 316.503802 304.725215+L 319.78314 304.893329+L 323.062479 305.051557+L 326.341818 305.20048+L 329.621157 305.340645+L 332.900496 305.472568+L 336.179835 305.596733+L 339.459174 305.713596+L 342.738512 305.823587+L 346.017851 305.92711+L 349.29719 306.024546+L 352.576529 306.116251+L 355.855868 306.202563+L 359.135207 306.2838+L 362.414545 306.36026+L 365.693884 306.432223+L 368.973223 306.499955+L 372.252562 306.563703+L 375.531901 306.623703+L 378.81124 306.680174+L 382.090579 306.733325+L 385.369917 306.783349+L 388.649256 306.830432+L 391.928595 306.874747+L 395.207934 306.916455+L 398.487273 306.955711" style="fill:none;stroke:#0000ff;stroke-linecap:square;stroke-width:1.5;"/></g><g id="patch_4">- <path d="M 73.832727 307.584-L 73.832727 41.472+ <path d="M 73.832727 307.584+L 73.832727 41.472" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/></g><g id="patch_5">- <path d="M 57.6 307.584-L 414.72 307.584+ <path d="M 57.6 307.584+L 414.72 307.584" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/></g></g>diff --git a/tests/test_graphical_units/img_svg_resources/pixelated_text.svg b/tests/test_graphical_units/img_svg_resources/pixelated_text.svgindex 2085bff4d..c86c47831 100644--- a/tests/test_graphical_units/img_svg_resources/pixelated_text.svg+++ b/tests/test_graphical_units/img_svg_resources/pixelated_text.svg@@ -24,4 +24,4 @@d="m413.26883 194.35208l0 36.51837l-54.777832 0l0 -36.51837zm0 54.777557l0 36.51837l-54.777832 0l0 -36.51837zm-91.29642 -73.03674l0 127.8143l109.555725 0l0 -18.259186l18.259277 0l0 -36.51837l-18.259277 0l0 -18.259186l18.259277 0l0 -36.51837l-18.259277 0l0 -18.259186z"fill-rule="evenodd"/></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/qcurve_demo.svg b/tests/test_graphical_units/img_svg_resources/qcurve_demo.svgindex 408c661ca..61a3b88cf 100644--- a/tests/test_graphical_units/img_svg_resources/qcurve_demo.svg+++ b/tests/test_graphical_units/img_svg_resources/qcurve_demo.svg@@ -3,4 +3,4 @@<path style="fill:white" d="M 20,50 q 0,20 17.3,10 10,17.3 20,0 17.3,-10 0,-20"></path></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/rotate.svg b/tests/test_graphical_units/img_svg_resources/rotate.svgindex 27f4e86e2..089b1907c 100644--- a/tests/test_graphical_units/img_svg_resources/rotate.svg+++ b/tests/test_graphical_units/img_svg_resources/rotate.svg@@ -6,4 +6,4 @@<!-- rotation is done around the point 10,10 --><rect x="0" y="0" width="10" height="10" fill="green" transform="rotate(100,10,10)" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/scale.svg b/tests/test_graphical_units/img_svg_resources/scale.svgindex ab12badf2..f94f61f1c 100644--- a/tests/test_graphical_units/img_svg_resources/scale.svg+++ b/tests/test_graphical_units/img_svg_resources/scale.svg@@ -10,4 +10,4 @@<!-- No scale --><circle cx="0" cy="0" r="10" fill="black" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/skewX.svg b/tests/test_graphical_units/img_svg_resources/skewX.svgindex 497f8cf67..12409a872 100644--- a/tests/test_graphical_units/img_svg_resources/skewX.svg+++ b/tests/test_graphical_units/img_svg_resources/skewX.svg@@ -2,4 +2,4 @@<rect x="-3" y="-3" width="6" height="6" /><rect x="-3" y="-3" width="6" height="6" fill="red" transform="skewX(30)" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/skewY.svg b/tests/test_graphical_units/img_svg_resources/skewY.svgindex 9ac6b5a69..33e442265 100644--- a/tests/test_graphical_units/img_svg_resources/skewY.svg+++ b/tests/test_graphical_units/img_svg_resources/skewY.svg@@ -2,4 +2,4 @@<rect x="-3" y="-3" width="6" height="6" /><rect x="-3" y="-3" width="6" height="6" fill="red" transform="skewY(30)" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/smooth_curves.svg b/tests/test_graphical_units/img_svg_resources/smooth_curves.svgindex 7fe31d675..a13094ef4 100644--- a/tests/test_graphical_units/img_svg_resources/smooth_curves.svg+++ b/tests/test_graphical_units/img_svg_resources/smooth_curves.svg@@ -6,4 +6,4 @@d="M100,200 C100,100 250,100 250,200 S400,300 400,200"/></g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/states_map.svg b/tests/test_graphical_units/img_svg_resources/states_map.svgindex 5a5aba201..6eb24adc9 100644--- a/tests/test_graphical_units/img_svg_resources/states_map.svg+++ b/tests/test_graphical_units/img_svg_resources/states_map.svg@@ -154,4 +154,4 @@</g>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/translate.svg b/tests/test_graphical_units/img_svg_resources/translate.svgindex 4444de93a..75b440c84 100644--- a/tests/test_graphical_units/img_svg_resources/translate.svg+++ b/tests/test_graphical_units/img_svg_resources/translate.svg@@ -10,4 +10,4 @@<!-- Both horizontal and vertical translation --><rect x="5" y="5" width="40" height="40" fill="yellow" transform="translate(50,50)" />-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/img_svg_resources/united-kingdom.svg b/tests/test_graphical_units/img_svg_resources/united-kingdom.svgindex 8aaf4af9b..fb0520625 100644--- a/tests/test_graphical_units/img_svg_resources/united-kingdom.svg+++ b/tests/test_graphical_units/img_svg_resources/united-kingdom.svg@@ -10,7 +10,7 @@c0,4.875,3.953,8.828,8.828,8.828h39.495l163.54-107.147v107.147h88.276V316.578l163.54,107.147h39.495c4.875,0,8.828-3.953,8.828-8.828v-22.831l-140.309-91.927H512v-88.276H371.691L512,119.935V97.104z"/><g>- <polygon style="fill:#FF4B55;" points="512,229.518 282.483,229.518 282.483,88.276 229.517,88.276 229.517,229.518 0,229.518+ <polygon style="fill:#FF4B55;" points="512,229.518 282.483,229.518 282.483,88.276 229.517,88.276 229.517,229.518 0,229.5180,282.483 229.517,282.483 229.517,423.725 282.483,423.725 282.483,282.483 512,282.483 "/><path style="fill:#FF4B55;" d="M178.948,300.138L0.25,416.135c0.625,4.263,4.14,7.59,8.577,7.59h12.159l190.39-123.586h-32.428V300.138z"/>diff --git a/tests/test_graphical_units/img_svg_resources/watch_the_decimals.svg b/tests/test_graphical_units/img_svg_resources/watch_the_decimals.svgindex b30c13f1a..f58546e94 100644--- a/tests/test_graphical_units/img_svg_resources/watch_the_decimals.svg+++ b/tests/test_graphical_units/img_svg_resources/watch_the_decimals.svg@@ -1,4 +1,4 @@<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9062"width="200" height="200"><path fill="orange" d="M99.89.22M512 1024 c 282.784 0 512 -229.216 512 -512 0 -35.36 28.64 -64 64 -64 z"></path>-</svg>\ No newline at end of file+</svg>diff --git a/tests/test_graphical_units/test_axes.py b/tests/test_graphical_units/test_axes.pyindex 694fcb00f..cba17bc07 100644--- a/tests/test_graphical_units/test_axes.py+++ b/tests/test_graphical_units/test_axes.py@@ -30,7 +30,7 @@ def test_custom_coordinates(scene):ax = Axes(x_range=[0, 10])ax.add_coordinates(- dict(zip([x for x in range(1, 10)], [Tex("str") for _ in range(1, 10)]))+ dict(zip(list(range(1, 10)), [Tex("str") for _ in range(1, 10)])),)scene.add(ax)@@ -46,7 +46,10 @@ def test_get_axis_labels(scene):def test_get_x_axis_label(scene):ax = Axes(x_range=(0, 8), y_range=(0, 5), x_length=8, y_length=5)x_label = ax.get_x_axis_label(- Tex("$x$-values").scale(0.65), edge=DOWN, direction=DOWN, buff=0.5+ Tex("$x$-values").scale(0.65),+ edge=DOWN,+ direction=DOWN,+ buff=0.5,)scene.add(ax, x_label)@@ -204,7 +207,10 @@ def test_get_riemann_rectangles(scene):# the colour of rectangles below the x-axis is inverted# due to show_signed_arearects_left = ax.get_riemann_rectangles(- quadratic, x_range=[-1.5, 1.5], dx=0.15, color=YELLOW+ quadratic,+ x_range=[-1.5, 1.5],+ dx=0.15,+ color=YELLOW,)bounding_line = ax.get_graph(lambda x: 1.5 * x, color=BLUE_B, x_range=[3.3, 6])diff --git a/tests/test_graphical_units/test_brace.py b/tests/test_graphical_units/test_brace.pyindex 884cef767..364bc17e3 100644--- a/tests/test_graphical_units/test_brace.py+++ b/tests/test_graphical_units/test_brace.py@@ -17,7 +17,7 @@ def test_brace_sharpness(scene):def test_braceTip(scene):line = Line().shift(LEFT * 3).rotate(PI / 2)steps = 8- for i in range(steps):+ for _i in range(steps):brace = Brace(line, direction=line.copy().rotate(PI / 2).get_unit_vector())dot = Dot()brace.put_at_tip(dot)diff --git a/tests/test_graphical_units/test_coordinate_systems.py b/tests/test_graphical_units/test_coordinate_systems.pyindex f4839a29a..3a78dc2b9 100644--- a/tests/test_graphical_units/test_coordinate_systems.py+++ b/tests/test_graphical_units/test_coordinate_systems.py@@ -22,10 +22,14 @@ def test_number_plane(scene):def test_line_graph(scene):plane = NumberPlane()first_line = plane.get_line_graph(- x_values=[-3, 1], y_values=[-2, 2], line_color=YELLOW+ x_values=[-3, 1],+ y_values=[-2, 2],+ line_color=YELLOW,)second_line = plane.get_line_graph(- x_values=[0, 2, 2, 4], y_values=[0, 0, 2, 4], line_color=RED+ x_values=[0, 2, 2, 4],+ y_values=[0, 0, 2, 4],+ line_color=RED,)scene.add(plane, first_line, second_line)diff --git a/tests/test_graphical_units/test_img_and_svg.py b/tests/test_graphical_units/test_img_and_svg.pyindex 0a89b4e09..ebc82d662 100644--- a/tests/test_graphical_units/test_img_and_svg.py+++ b/tests/test_graphical_units/test_img_and_svg.py@@ -253,7 +253,7 @@ def test_ImageMobject(scene):@frames_comparisondef test_ImageInterpolation(scene):img = ImageMobject(- np.uint8([[63, 0, 0, 0], [0, 127, 0, 0], [0, 0, 191, 0], [0, 0, 0, 255]])+ np.uint8([[63, 0, 0, 0], [0, 127, 0, 0], [0, 0, 191, 0], [0, 0, 0, 255]]),)img.height = 2img1 = img.copy()diff --git a/tests/test_graphical_units/test_transform.py b/tests/test_graphical_units/test_transform.pyindex 563a3da50..0abbbdcff 100644--- a/tests/test_graphical_units/test_transform.py+++ b/tests/test_graphical_units/test_transform.py@@ -109,8 +109,9 @@ def test_ApplyComplexFunction(scene):square = Square()scene.play(ApplyComplexFunction(- lambda complex_num: complex_num + 2 * np.complex(0, 1), square- )+ lambda complex_num: complex_num + 2 * complex(0, 1),+ square,+ ),)diff --git a/tests/test_graphical_units/testing/_frames_testers.py b/tests/test_graphical_units/testing/_frames_testers.pyindex 29601e096..5ebd1366a 100644--- a/tests/test_graphical_units/testing/_frames_testers.py+++ b/tests/test_graphical_units/testing/_frames_testers.py@@ -73,5 +73,5 @@ class _ControlDataWriter(_FramesTester):self.frames = self.frames.astype("uint8")np.savez_compressed(self.file_path, frame_data=self.frames)logger.info(- f"{self._number_frames_written} control frames saved in {self.file_path}"+ f"{self._number_frames_written} control frames saved in {self.file_path}",)diff --git a/tests/test_graphical_units/testing/_show_diff.py b/tests/test_graphical_units/testing/_show_diff.pyindex 8c0383325..5a03ecc45 100644--- a/tests/test_graphical_units/testing/_show_diff.py+++ b/tests/test_graphical_units/testing/_show_diff.py@@ -2,7 +2,9 @@ import numpy as npdef show_diff_helper(- frame_number: int, frame_data: np.ndarray, expected_frame_data: np.ndarray+ frame_number: int,+ frame_data: np.ndarray,+ expected_frame_data: np.ndarray,):"""Will visually display with matplotlib differences between frame generated and the one expected."""import matplotlib.gridspec as gridspecdiff --git a/tests/test_graphical_units/testing/frames_comparison.py b/tests/test_graphical_units/testing/frames_comparison.pyindex dffe3da06..0ebe42ecf 100644--- a/tests/test_graphical_units/testing/frames_comparison.py+++ b/tests/test_graphical_units/testing/frames_comparison.py@@ -65,17 +65,17 @@ def frames_comparison(not in inspect.getfullargspec(tested_scene_construct).args):raise Exception(- f"Invalid graphical test function test function : must have '{SCENE_PARAMETER_NAME}'as one of the parameters."+ f"Invalid graphical test function test function : must have '{SCENE_PARAMETER_NAME}'as one of the parameters.",)# Exclude "scene" from the argument list of the signature.old_sig = inspect.signature(- functools.partial(tested_scene_construct, scene=None)+ functools.partial(tested_scene_construct, scene=None),)if "__module_test__" not in tested_scene_construct.__globals__:raise Exception(- "There is no module test name indicated for the graphical unit test. You have to declare __module_test__ in the test file."+ "There is no module test name indicated for the graphical unit test. You have to declare __module_test__ in the test file.",)module_name = tested_scene_construct.__globals__.get("__module_test__")test_name = tested_scene_construct.__name__[len("test_") :]@@ -90,7 +90,7 @@ def frames_comparison(# This modify the test_name so the it is defined by the parametrization arguments too.# Ex : if "length" is parametrized from 0 to 20, the kwargs will be with once with {"length" : 1}, etc.test_name_with_param = test_name + "_".join(- map(lambda tup: f"{str(tup[0])}:{str(tup[1])}", kwargs.items())+ map(lambda tup: f"{str(tup[0])}:{str(tup[1])}", kwargs.items()),)config_tests = _config_test(last_frame)@@ -105,7 +105,9 @@ def frames_comparison(setting_test = request.config.getoption("--set_test")real_test = _make_test_comparing_frames(file_path=_control_data_path(- module_name, test_name_with_param, setting_test+ module_name,+ test_name_with_param,+ setting_test,),base_scene=base_scene,construct=construct,@@ -127,7 +129,7 @@ def frames_comparison(parameters += [inspect.Parameter("request", inspect.Parameter.KEYWORD_ONLY)]if "tmp_path" not in old_sig.parameters:parameters += [- inspect.Parameter("tmp_path", inspect.Parameter.KEYWORD_ONLY)+ inspect.Parameter("tmp_path", inspect.Parameter.KEYWORD_ONLY),]new_sig = old_sig.replace(parameters=parameters)wrapper.__signature__ = new_sig@@ -201,7 +203,8 @@ def _make_test_comparing_frames(test_renderer=testRenderer(file_writer_class=file_writer_class)if base_scene is not ThreeDSceneelse testRenderer(- file_writer_class=file_writer_class, camera_class=ThreeDCamera+ file_writer_class=file_writer_class,+ camera_class=ThreeDCamera,), # testRenderer(file_writer_class=file_writer_class),)scene_tested = sceneTested(skip_animations=True)@@ -223,7 +226,7 @@ def _control_data_path(module_name: str, test_name: str, setting_test: bool) ->if not setting_test and not path.is_file():raise Exception(f"The control frame for the test {test_name} cannot be found in {path.parent}. "- "Make sure you generated the control frames first."+ "Make sure you generated the control frames first.",)return path@@ -236,6 +239,6 @@ def _config_test(last_frame: bool) -> ManimConfig:"config_graphical_tests_monoframe.cfg"if last_frameelse "config_graphical_tests_multiframes.cfg"- )- )+ ),+ ),)diff --git a/tests/test_hashing.py b/tests/test_hashing.pyindex b713dcc5f..990a11451 100644--- a/tests/test_hashing.py+++ b/tests/test_hashing.py@@ -9,7 +9,7 @@ from manim import SquareALREADY_PROCESSED_PLACEHOLDER = hashing._Memoizer.ALREADY_PROCESSED_PLACEHOLDER[email protected](autouse=True, scope="function")[email protected](autouse=True)def reset_already_processed():hashing._Memoizer.reset_already_processed()diff --git a/tests/test_logging/test_logging.py b/tests/test_logging/test_logging.pyindex 22368bc53..354b35f3c 100644--- a/tests/test_logging/test_logging.py+++ b/tests/test_logging/test_logging.py@@ -12,7 +12,9 @@ from ..utils.logging_tester import *)def test_logging_to_file(tmp_path, python_version):path_basic_scene = os.path.join(- "tests", "test_logging", "basic_scenes_square_to_circle.py"+ "tests",+ "test_logging",+ "basic_scenes_square_to_circle.py",)command = [python_version,@@ -37,7 +39,9 @@ def test_logging_to_file(tmp_path, python_version):)def test_logging_when_scene_is_not_specified(tmp_path, python_version):path_basic_scene = os.path.join(- "tests", "test_logging", "basic_scenes_square_to_circle.py"+ "tests",+ "test_logging",+ "basic_scenes_square_to_circle.py",)command = [python_version,diff --git a/tests/test_number_line.py b/tests/test_number_line.pyindex 72bf98a04..16cff0caf 100644--- a/tests/test_number_line.py+++ b/tests/test_number_line.py@@ -34,7 +34,8 @@ def test_decimal_determined_by_step():def test_decimal_config_overrides_defaults():"""Checks that ``num_decimal_places`` is determined by step size and gets overridden by ``decimal_number_config``."""axis = NumberLine(- x_range=[-2, 2, 0.5], decimal_number_config={"num_decimal_places": 0}+ x_range=[-2, 2, 0.5],+ decimal_number_config={"num_decimal_places": 0},)expected_decimal_places = 0actual_decimal_places = axis.decimal_number_config["num_decimal_places"]@@ -57,7 +58,7 @@ def test_add_labels():expected_label_length = 6num_line = NumberLine(x_range=[-4, 4])num_line.add_labels(- dict(zip([x for x in range(-3, 3)], [Integer(m) for m in range(-1, 5)]))+ dict(zip(list(range(-3, 3)), [Integer(m) for m in range(-1, 5)])),)actual_label_length = len(num_line.labels)assert (diff --git a/tests/test_plugins/test_plugins.py b/tests/test_plugins/test_plugins.pyindex 032571ef7..641c8ce80 100644--- a/tests/test_plugins/test_plugins.py+++ b/tests/test_plugins/test_plugins.py@@ -25,7 +25,7 @@ plugin_pyproject_template = textwrap.dedent([build-system]requires = ["poetry-core>=1.0.0"]build-backend = "poetry.core.masonry.api"- """+ """,)plugin_init_template = textwrap.dedent(@@ -45,14 +45,14 @@ plugin_init_template = textwrap.dedent(self.dotgrid.become(self.dotgrid.shift(UP))def {function_name}():return [{class_name}]- """+ """,)cfg_file_contents = textwrap.dedent("""\[CLI]plugins = {plugin_name}- """+ """,)@@ -78,7 +78,8 @@ def random_string():def test_plugin_warning(tmp_path, python_version, simple_scenes_path):cfg_file = cfg_file_create(- cfg_file_contents.format(plugin_name="DNEplugin"), tmp_path+ cfg_file_contents.format(plugin_name="DNEplugin"),+ tmp_path,)scene_name = "SquareToCircle"command = [@@ -110,15 +111,17 @@ def create_plugin(tmp_path, python_version, random_string):with open(module_dir / "__init__.py", "w") as f:f.write(plugin_init_template.format(- class_name=class_name, function_name=function_name, all_dec=all_dec- )+ class_name=class_name,+ function_name=function_name,+ all_dec=all_dec,+ ),)with open(plugin_dir / "pyproject.toml", "w") as f:f.write(plugin_pyproject_template.format(plugin_name=plugin_name,plugin_entrypoint=entry_point,- )+ ),)command = [python_version,@@ -144,10 +147,15 @@ def create_plugin(tmp_path, python_version, random_string):@pytest.mark.slowdef test_plugin_function_like(- tmp_path, create_plugin, python_version, simple_scenes_path+ tmp_path,+ create_plugin,+ python_version,+ simple_scenes_path,):function_like_plugin = create_plugin(- "{plugin_name}.__init__:import_all", "FunctionLike", "import_all"+ "{plugin_name}.__init__:import_all",+ "FunctionLike",+ "import_all",)cfg_file = cfg_file_create(cfg_file_contents.format(plugin_name=function_like_plugin["plugin_name"]),@@ -177,7 +185,8 @@ def test_plugin_no_all(tmp_path, create_plugin, python_version):create_plugin = create_plugin("{plugin_name}", "NoAll", "import_all")plugin_name = create_plugin["plugin_name"]cfg_file = cfg_file_create(- cfg_file_contents.format(plugin_name=plugin_name), tmp_path+ cfg_file_contents.format(plugin_name=plugin_name),+ tmp_path,)test_class = textwrap.dedent(f"""\@@ -187,11 +196,14 @@ def test_plugin_no_all(tmp_path, create_plugin, python_version):assert "{plugin_name}" in globals()a = {plugin_name}.NoAll()self.play(FadeIn(a))- """+ """,)with tempfile.NamedTemporaryFile(- mode="w", encoding="utf-8", suffix=".py", delete=False+ mode="w",+ encoding="utf-8",+ suffix=".py",+ delete=False,) as tmpfile:tmpfile.write(test_class)scene_name = "NoAllTest"@@ -224,7 +236,8 @@ def test_plugin_with_all(tmp_path, create_plugin, python_version, simple_scenes_)plugin_name = create_plugin["plugin_name"]cfg_file = cfg_file_create(- cfg_file_contents.format(plugin_name=plugin_name), tmp_path+ cfg_file_contents.format(plugin_name=plugin_name),+ tmp_path,)scene_name = "WithAllTest"command = [diff --git a/tests/test_scene_rendering/simple_scenes.py b/tests/test_scene_rendering/simple_scenes.pyindex f77ff0f68..ff0d2e5cb 100644--- a/tests/test_scene_rendering/simple_scenes.py+++ b/tests/test_scene_rendering/simple_scenes.py@@ -12,7 +12,7 @@ class SceneWithMultipleCalls(Scene):def construct(self):number = Integer(0)self.add(number)- for i in range(10):+ for _i in range(10):self.play(Animation(Square()))diff --git a/tests/test_scene_rendering/standard_config.cfg b/tests/test_scene_rendering/standard_config.cfgindex ca45eafe6..e506f41ee 100644--- a/tests/test_scene_rendering/standard_config.cfg+++ b/tests/test_scene_rendering/standard_config.cfg@@ -2,4 +2,4 @@frame_rate = 15pixel_height = 480pixel_width = 300-verbosity = DEBUG\ No newline at end of file+verbosity = DEBUGdiff --git a/tests/test_scene_rendering/test_cairo_renderer.py b/tests/test_scene_rendering/test_cairo_renderer.pyindex ea4d849d9..56dea35bb 100644--- a/tests/test_scene_rendering/test_cairo_renderer.py+++ b/tests/test_scene_rendering/test_cairo_renderer.py@@ -51,7 +51,7 @@ def test_when_animation_is_cached(using_temp_config):scene.update_to_time = Mock()scene.render()assert scene.renderer.file_writer.is_already_cached(- scene.renderer.animations_hashes[0]+ scene.renderer.animations_hashes[0],)# Check that the same partial movie files has been used (with he same hash).# As there might have been several hashes, a list is used.@@ -63,7 +63,8 @@ def test_when_animation_is_cached(using_temp_config):def test_hash_logic_is_not_called_when_caching_is_disabled(- using_temp_config, disabling_caching+ using_temp_config,+ disabling_caching,):with patch("manim.renderer.cairo_renderer.get_hash_from_play_call") as mocked:scene = SquareToCircle()diff --git a/tests/test_scene_rendering/test_cli_flags.py b/tests/test_scene_rendering/test_cli_flags.pyindex 26d41a13f..cf9194869 100644--- a/tests/test_scene_rendering/test_cli_flags.py+++ b/tests/test_scene_rendering/test_cli_flags.py@@ -34,7 +34,8 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes@pytest.mark.slow@video_comparison(- "SquareToCircleWithlFlag.json", "videos/simple_scenes/480p15/SquareToCircle.mp4"+ "SquareToCircleWithlFlag.json",+ "videos/simple_scenes/480p15/SquareToCircle.mp4",)def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):scene_name = "SquareToCircle"@@ -144,7 +145,7 @@ def test_r_flag(tmp_path, manim_cfg_file, simple_scenes_path):assert is_not_empty, "running manim with -s, -r flag did not render a file"filename = add_version_before_extension(- tmp_path / "images" / "simple_scenes" / "SquareToCircle.png"+ tmp_path / "images" / "simple_scenes" / "SquareToCircle.png",)assert np.asarray(Image.open(filename)).shape == (100, 200, 4)@@ -221,7 +222,7 @@ def test_dash_as_filename(tmp_path):result = runner.invoke(main, command, input=code)assert result.exit_code == 0exists = add_version_before_extension(- tmp_path / "images" / "-" / "Test.png"+ tmp_path / "images" / "-" / "Test.png",).exists()assert exists, result.output@@ -249,7 +250,7 @@ def test_gif_format_output(tmp_path, manim_cfg_file, simple_scenes_path):tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mp4")assert not unexpected_mp4_path.exists(), "unexpected mp4 file found at " + str(- unexpected_mp4_path+ unexpected_mp4_path,)expected_gif_path = (@@ -289,20 +290,22 @@ def test_mp4_format_output(tmp_path, manim_cfg_file, simple_scenes_path):/ add_version_before_extension("SquareToCircle.gif"))assert not unexpected_gif_path.exists(), "unexpected gif file found at " + str(- unexpected_gif_path+ unexpected_gif_path,)expected_mp4_path = (tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mp4")assert expected_mp4_path.exists(), "expected mp4 file not found at " + str(- expected_mp4_path+ expected_mp4_path,)@pytest.mark.slowdef test_videos_not_created_when_png_format_set(- tmp_path, manim_cfg_file, simple_scenes_path+ tmp_path,+ manim_cfg_file,+ simple_scenes_path,):"""Test mp4 and gifs are not created when --format png is set"""scene_name = "SquareToCircle"@@ -329,20 +332,22 @@ def test_videos_not_created_when_png_format_set(/ add_version_before_extension("SquareToCircle.gif"))assert not unexpected_gif_path.exists(), "unexpected gif file found at " + str(- unexpected_gif_path+ unexpected_gif_path,)unexpected_mp4_path = (tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mp4")assert not unexpected_mp4_path.exists(), "expected mp4 file not found at " + str(- unexpected_mp4_path+ unexpected_mp4_path,)@pytest.mark.slowdef test_images_are_created_when_png_format_set(- tmp_path, manim_cfg_file, simple_scenes_path+ tmp_path,+ manim_cfg_file,+ simple_scenes_path,):"""Test images are created in media directory when --format png is set"""scene_name = "SquareToCircle"@@ -367,7 +372,9 @@ def test_images_are_created_when_png_format_set(@pytest.mark.slowdef test_images_are_zero_padded_when_zero_pad_set(- tmp_path, manim_cfg_file, simple_scenes_path+ tmp_path,+ manim_cfg_file,+ simple_scenes_path,):"""Test images are zero padded when --format png and --zero_pad n are set"""scene_name = "SquareToCircle"@@ -390,7 +397,7 @@ def test_images_are_zero_padded_when_zero_pad_set(unexpected_png_path = tmp_path / "images" / "simple_scenes" / "SquareToCircle0.png"assert not unexpected_png_path.exists(), "non zero padded png file found at " + str(- unexpected_png_path+ unexpected_png_path,)expected_png_path = tmp_path / "images" / "simple_scenes" / "SquareToCircle000.png"@@ -420,20 +427,22 @@ def test_webm_format_output(tmp_path, manim_cfg_file, simple_scenes_path):tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mp4")assert not unexpected_mp4_path.exists(), "unexpected mp4 file found at " + str(- unexpected_mp4_path+ unexpected_mp4_path,)expected_webm_path = (tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.webm")assert expected_webm_path.exists(), "expected webm file not found at " + str(- expected_webm_path+ expected_webm_path,)@pytest.mark.slowdef test_default_format_output_for_transparent_flag(- tmp_path, manim_cfg_file, simple_scenes_path+ tmp_path,+ manim_cfg_file,+ simple_scenes_path,):"""Test .mov is created by default when transparent flag is set"""scene_name = "SquareToCircle"@@ -455,14 +464,14 @@ def test_default_format_output_for_transparent_flag(tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.webm")assert not unexpected_webm_path.exists(), "unexpected webm file found at " + str(- unexpected_webm_path+ unexpected_webm_path,)expected_mov_path = (tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mov")assert expected_mov_path.exists(), "expected .mov file not found at " + str(- expected_mov_path+ expected_mov_path,)@@ -489,12 +498,12 @@ def test_mov_can_be_set_as_output_format(tmp_path, manim_cfg_file, simple_scenestmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.webm")assert not unexpected_webm_path.exists(), "unexpected webm file found at " + str(- unexpected_webm_path+ unexpected_webm_path,)expected_mov_path = (tmp_path / "videos" / "simple_scenes" / "480p15" / "SquareToCircle.mov")assert expected_mov_path.exists(), "expected .mov file not found at " + str(- expected_mov_path+ expected_mov_path,)diff --git a/tests/test_set_attr.py b/tests/test_set_attr.pyindex 0a51c44b4..d6f9aa9e5 100644--- a/tests/test_set_attr.py+++ b/tests/test_set_attr.py@@ -11,7 +11,8 @@ def test_Data():a = Square().move_to(RIGHT)data_bb = a.data["bounding_box"]assert np.array_equal(- data_bb, np.array([[0.0, -1.0, 0.0], [1.0, 0.0, 0.0], [2.0, 1.0, 0.0]])+ data_bb,+ np.array([[0.0, -1.0, 0.0], [1.0, 0.0, 0.0], [2.0, 1.0, 0.0]]),)# test that calling the attribute equals calling it from self.data@@ -32,7 +33,8 @@ def test_Data():data_bb = a.data["bounding_box"]assert np.array_equal(- data_bb, np.array([[0.0, -1.0, 0.0], [300.0, 300.0, 300.0], [2.0, 1.0, 0.0]])+ data_bb,+ np.array([[0.0, -1.0, 0.0], [300.0, 300.0, 300.0], [2.0, 1.0, 0.0]]),)assert np.array_equal(a.bounding_box, data_bb)diff --git a/tests/test_svg_mobject.py b/tests/test_svg_mobject.pyindex 7ae1fd946..6522b3615 100644--- a/tests/test_svg_mobject.py+++ b/tests/test_svg_mobject.py@@ -39,7 +39,9 @@ def test_stroke_opacity():def test_fill_overrides_color():expected_color = "#343434"svg = SVGMobject(- get_svg_resource("heart.svg"), color="#123123", fill_color=expected_color+ get_svg_resource("heart.svg"),+ color="#123123",+ fill_color=expected_color,)assert svg.fill_color == expected_color@@ -47,6 +49,8 @@ def test_fill_overrides_color():def test_stroke_overrides_color():expected_color = "#767676"svg = SVGMobject(- get_svg_resource("heart.svg"), color="#334433", stroke_color=expected_color+ get_svg_resource("heart.svg"),+ color="#334433",+ stroke_color=expected_color,)assert svg.stroke_color == expected_colordiff --git a/tests/test_texmobject.py b/tests/test_texmobject.pyindex 2e13c710c..6ebb3afaa 100644--- a/tests/test_texmobject.py+++ b/tests/test_texmobject.py@@ -15,13 +15,13 @@ def test_SingleStringMathTex():assert Path(config.media_dir, "Tex", "79822967f1fa1935.svg").exists()[email protected]( # : PT006"text_input,length_sub",[("{{ a }} + {{ b }} = {{ c }}", 5), (r"\frac{1}{a+b\sqrt{2}}", 1)],)def test_double_braces_testing(text_input, length_sub):t1 = MathTex(text_input)- len(t1.submobjects) == length_sub+ assert len(t1.submobjects) == length_subdef test_tex():diff --git a/tests/test_ticks.py b/tests/test_ticks.pyindex 545a47963..8beeb5aeb 100644--- a/tests/test_ticks.py+++ b/tests/test_ticks.py@@ -13,7 +13,9 @@ def test_duplicate_ticks_removed_for_axes():def test_ticks_not_generated_on_origin_for_axes():axes = Axes(- x_range=[-10, 10], y_range=[-10, 10], axis_config={"include_ticks": True}+ x_range=[-10, 10],+ y_range=[-10, 10],+ axis_config={"include_ticks": True},)x_axis_range = axes.x_axis.get_tick_range()@@ -36,7 +38,9 @@ def test_expected_ticks_generated():def test_ticks_generated_from_origin_for_axes():axes = Axes(- x_range=[-PI, PI], y_range=[-PI, PI], axis_config={"include_ticks": True}+ x_range=[-PI, PI],+ y_range=[-PI, PI],+ axis_config={"include_ticks": True},)x_axis_range = axes.x_axis.get_tick_range()y_axis_range = axes.y_axis.get_tick_range()diff --git a/tests/test_vectorized_mobject.py b/tests/test_vectorized_mobject.pyindex 82016fa76..bfbca7425 100644--- a/tests/test_vectorized_mobject.py+++ b/tests/test_vectorized_mobject.py@@ -13,7 +13,7 @@ def test_vmobject_point_from_propotion():np.array([0, 0, 0]),np.array([4, 0, 0]),np.array([4, 2, 0]),- ]+ ],)# Total length of 6, so halfway along the object@@ -191,7 +191,7 @@ def test_vgroup_item_assignment_at_correct_position():"""Test VGroup item-assignment adds to correct position for VMObjects"""n_items = 10vgroup = VGroup()- for i in range(n_items):+ for _i in range(n_items):vgroup.add(VMobject())new_obj = VMobject()vgroup[6] = new_objdiff --git a/tests/utils/GraphicalUnitTester.py b/tests/utils/GraphicalUnitTester.pyindex f6163f9ef..122a4b009 100644--- a/tests/utils/GraphicalUnitTester.py+++ b/tests/utils/GraphicalUnitTester.py@@ -41,7 +41,10 @@ class GraphicalUnitTester:scene_class.__name__,)self.path_control_data = os.path.join(- tests_directory, "control_data", "graphical_units_data", module_tested+ tests_directory,+ "control_data",+ "graphical_units_data",+ module_tested,)self.rgb_atol = rgb_atol@@ -77,7 +80,7 @@ class GraphicalUnitTester:The pre-rendered frame."""frame_data_path = os.path.join(- os.path.join(self.path_control_data, f"{self.scene}.npz")+ os.path.join(self.path_control_data, f"{self.scene}.npz"),)return np.load(frame_data_path)["frame_data"]@@ -128,7 +131,7 @@ class GraphicalUnitTester:)mismatches = np.logical_not(- np.isclose(frame_data, expected_frame_data, atol=self.rgb_atol, rtol=0)+ np.isclose(frame_data, expected_frame_data, atol=self.rgb_atol, rtol=0),)if mismatches.any():incorrect_indices = np.argwhere(mismatches)diff --git a/tests/utils/logging_tester.py b/tests/utils/logging_tester.pyindex 8dd2f03a3..b33b05655 100644--- a/tests/utils/logging_tester.py+++ b/tests/utils/logging_tester.py@@ -3,10 +3,12 @@ import jsonimport osfrom functools import wraps+import pytest+def _check_logs(reference_logfile, generated_logfile):with open(reference_logfile) as reference_logs, open(- generated_logfile+ generated_logfile,) as generated_logs:reference_logs = reference_logs.readlines()generated_logs = generated_logs.readlines()@@ -22,7 +24,7 @@ def _check_logs(reference_logfile, generated_logfile):for log in generated_logs[len(reference_logs) :]:msg_assert += logmsg_assert += f"\nPath of reference log: {reference_logfile}\nPath of generated logs: {generated_logfile}"- assert 0, msg_assert + reference_logfile + " " + generated_logfile+ pytest.fail(msg_assert + reference_logfile + " " + generated_logfile)for index, ref, gen in zip(itertools.count(), reference_logs, generated_logs):# As they are string, we only need to check if they are equal. If they are not, we then compute a more precise difference, to debug.@@ -68,19 +70,22 @@ def logs_comparison(control_data_file, log_path_from_media_dir):result = f(*args, **kwargs)tmp_path = kwargs["tmp_path"]tests_directory = os.path.dirname(- os.path.dirname(os.path.abspath(__file__))+ os.path.dirname(os.path.abspath(__file__)),)control_data_path = os.path.join(- tests_directory, "control_data", "logs_data", control_data_file+ tests_directory,+ "control_data",+ "logs_data",+ control_data_file,)path_log_generated = tmp_path / log_path_from_media_dir# The following will say precisely which subdir does not exist.if not os.path.exists(path_log_generated):for parent in reversed(path_log_generated.parents):if not parent.exists():- assert (- False- ), f"'{parent.name}' does not exist in '{parent.parent}' (which exists). "+ pytest.fail(+ f"'{parent.name}' does not exist in '{parent.parent}' (which exists). ",+ )break_check_logs(control_data_path, str(path_log_generated))return resultdiff --git a/tests/utils/video_tester.py b/tests/utils/video_tester.pyindex 6db20e6d6..4fef59a24 100644--- a/tests/utils/video_tester.py+++ b/tests/utils/video_tester.py@@ -3,6 +3,8 @@ import osimport subprocessfrom functools import wraps+import pytest+from ..utils.commands import capture@@ -25,7 +27,8 @@ def _get_config_from_video(path_to_video):def _load_video_data(path_to_data):- return json.load(open(path_to_data))+ with open(path_to_data) as f:+ return json.load(f)def _check_video_data(path_control_data, path_to_video_generated):@@ -64,18 +67,21 @@ def video_comparison(control_data_file, scene_path_from_media_dir):result = f(*args, **kwargs)tmp_path = kwargs["tmp_path"]tests_directory = os.path.dirname(- os.path.dirname(os.path.abspath(__file__))+ os.path.dirname(os.path.abspath(__file__)),)path_control_data = os.path.join(- tests_directory, "control_data", "videos_data", control_data_file+ tests_directory,+ "control_data",+ "videos_data",+ control_data_file,)path_video_generated = tmp_path / scene_path_from_media_dirif not os.path.exists(path_video_generated):for parent in reversed(path_video_generated.parents):if not parent.exists():- assert (- False- ), f"'{parent.name}' does not exist in '{parent.parent}' (which exists). "+ pytest.fail(+ f"'{parent.name}' does not exist in '{parent.parent}' (which exists). ",+ )break_check_video_data(path_control_data, str(path_video_generated))return result