* Fix ruff linter issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix unintended kwargs propagation in LaggedStartMap
Ensure intended for are not forwarded to the superclass, and make explicit.
* add test for keyword propagation in LaggedStartMap
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update test_composition.py
update the test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update test_composition.py
add there_and_back
---------
Co-authored-by: Benjamin Hackl <mail@behackl.dev>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Stop ignoring manim._config erros in mypy.ini
* Aspect ratio should be a float.
* Handled more mypy issues in _config/utils.py
* Handled more mypy issues in _config/utils.py
* Removed two assert statements that triggered errors in the unittests.
* Fix last mypy issue in utils.py and activate mypy checking
* Fix type of window_size in opengl_renderer_window.py
* ...
---------
Co-authored-by: F. Muenkel <25496279+fmuenkel@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* docker: add libgl1 runtime dependency for OpenGL
* docker: tighten .dockerignore for smaller build context
* docs(docker): add runtime notes for latest image
* docs(docker): note ctex is not included by default
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add support for negative z-index in AnimationGroup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Refactor animation unpacking logic for clarity
* Fix unpacking logic to handle Mobject instances correctly
* Fix mypy check
* Fix tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: simplify AnimationGroup unpacking for moving mobjects
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Small touch-ups before fixing tip bugs
- fixed mutable default argument in Tipable VMobject constructor
- fixed typo in method name assign_tip_attr
- added two todo's which outline unexpected behavior in tip placement and how to solve
* refactor: align tip attr naming and remove TODO comments
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* fixing #4591
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* ci: fix publish release workflow
- Add sudo to apt-get calls (runner is non-root)
- Add contents: write permission for uploading release assets
- Drop uv sync before uv build (unnecessary)
- Replace archived upload-release-asset action and redundant
Python/requests API script with gh release upload; tag name
is available directly from the release event context
- Strip leading v from tag name to match built artifact filename
* ci: set bash shell for release asset upload step
* fix: replace double-brace splitting regex with state-machine parser
The previous re.split(r'{{|}}', ...) call split on any occurrence of
{{ or }} in the input string, which broke strings whose only }} came
from closing two nested LaTeX brace groups (e.g. ^{\frac{Mq}{M+m}}).
The new _split_double_braces() static method uses a character-level
state machine with three guards:
* Escape priority: \\ is consumed before \{ / \}, so \\}} is
correctly read as an escaped backslash followed by a real }}, not
misinterpreted as \ + \} + lone }.
* Whitespace-gated opener: {{ is only treated as a Manim group opener
at the start of the string or after whitespace. Naturally-occurring
{{ in LaTeX is usually preceded by non-whitespace (e.g. \frac{{{n}}}
or a^{{2}}), so this eliminates the most common false positives.
* Depth-tracking closer: inside a Manim group, }} only closes the
group when the inner brace depth is zero, so {{ a^{b^{c}} }} is
handled correctly and nested LaTeX }} cannot trigger an early close.
Fixes#4601.
* docs: document double-brace whitespace requirement
Add a Notes section to the MathTex docstring explaining:
- how {{ }} splits a string into submobjects
- that {{ must be at start-of-string or preceded by whitespace
- that this leaves natural LaTeX like \frac{{{n}}}{k} untouched
- the { { ... } } escape hatch when a split is not wanted
Apply the same explanation to the double-brace paragraph in
docs/source/guides/using_text.rst.
* fix: use r-string for _split_double_braces docstring, halve backslash escaping
* fix: resolve parameter shadowing bug in release script changelog command
* chore: bump version to v0.20.0, regenerate lockfile, update citation
* generate v0.20.0 changelog, first round
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* a bit of copyediting, second pass
* include newly merged PR, apply suggestions from review
* Update docs/source/changelog/0.20.0-changelog.md
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
When a single flat list or 1D numpy array was passed to
`Axes.coords_to_point()` (e.g. `ax.c2p([1, 2])` or
`ax.c2p(np.array([1, 2, 1]))`), the values were incorrectly
interpreted as multiple x-coordinates instead of a single (x, y) or
(x, y, z) point.
This happened because `np.asarray(([1, 2],))` produces a 2D array
with shape (1, N), which fell through to the code path that treats
`coords[0]` as a list of x-values. The fix detects this case
(ndim == 2, shape[0] == 1) and extracts the inner array so it is
handled identically to `c2p(1, 2)`.
Closes ManimCommunity#4073
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Fix some graph tests
* Fix two more tests
* Ensure temporary visuals get removed from scene
* Fix wrong import
* Remove redundant hasattr
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add type annotations to point_cloud_mobject.py
* Make reset_points return Self instead of None
* Fix return type of get_array_attrs()
* Change return type of reset_points() to Self in image_mobject.py
* Fix 3D ImageMobject rotation
* Remove lanczos, box and hamming resampling algorithms
* Consider case where matrix A is singular (points are aligned)
* homographic_matrix -> homography_matrix
* Fix ImageInterpolationEx scene and increase height in ImageInterpolation test
* Regenerate unit test again
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ManimFloat should probably not be used as dtype
* Import ImageMobject inside TYPE_CHECKING
* Add Camera.points_to_subpixel_coords() and do not render perpendicular images
* Modify algorithm to use height from longest side
* Prevent possible zero division
* Regenerate ImageMobject.npz
* Edit Image.transform() commentary
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Extracted the method get_mob_from_shape_element
* Moved more functionality to get_mob_from_shape_element
* More cleanup
* Parse the svg file while maintaining the group structure.
* Make the svg groups available
* Handle PERF401 issue
* [pre-commit.ci] pre-commit autoupdate (#4506)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.7 → v0.14.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.7...v0.14.8)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added an example of the issue
* Experimenting with coloring elements from the latex equation
* ...
* Regular expression can now match more than one object
* Process the string by applying the substrings in the order they match
* Code refactoring and added type annotations
* ...
* Added a lot of test cases
* More examples
* More examples
* Use matched_strings_and_ids to simplify existing methods
* Remove unused code
* Update get_part_by_tex to use matched_strings_and_ids
* This is required for test_MathTable to pass
* Ensure that self.texstring is set.
* Added more examples from exising issues in the github repo
* Ensure that latex groups are maintained by adding an additional pair of curly braces around the extracted part
* ExampleScene -> Scene
* Added comment
* _break_up_by_substrings
* Refactor code
* Added comment to example
* Handle integer inputs well.
* Expose the original tex_string
* Do not treat the content of substrings_to_isolate as regular expressions.
* Updated examples
* Update examples
* Fix SVMobject caching issue.
* Remove traces from brace_notation_split_occurred
* Simplify MathTex::_break_up_by_substrings
* Fix small issue in tex that in some cases moved elements a tiny bit around
* No use of regular expressions for locate substrings.
* Updated notes to the set of test cases
* Handle issues with the center environment.
* Add example
* Fix issue with rectangles (e.g. from sqrt)
* ConvertToOpenGL
* Reduce the number of nesting levels.
* Use the specified arg_seperator
* Deal with the double curly brace markup
* Code cleanup
* Code cleanup
* Rollback a few changes
* Code cleanup
* Adjust paths the generated artefacts in tests that rely on MathTex
* Added a remark to the using text guide on enclosing snippets in curly braces for substrings_to_isolate to work
* Added space around the numerator argument to frac to avoid having double curly braces in the example.
This would otherwise trigger MathTex to split the string at that location.
* Log errors properly and display some information about the errors and their context.
* Code refactoring as suggested by Benjamin
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Synchronize axes in the show_diff interactive view
* Modify show_diff layout to include test name in plot
* Fix issue where the difference displayed was wrong
This occured when the expected color was black but the generated color was something different.
* Also show number of non matching pixels in the show diff gui
* Implemented suggestions from Chopan50
* Fix embed dt calculation, Arrow stroke_width bug, and shader compatibility
* Restored lost fixes from b78ccba: Arrow stroke_width, Shaders AA, Manager interaction
* fix(core): resolve recursion in set_fill, ManimColor opacity error, and restore add_sound
* Fix(Experimental): Restore functionality and stabilize architecture
- Fix Arrow stroke_width initialization (float vs list bug) and restore scaling logic.
- Implement 'save_last_frame' logic by integrating it with skipping mechanism.
- Refactor Manager.post_construct to ensure correct exit and image saving behavior.
- Fix transparency issues in OpenGLRenderer (background_opacity and shader alpha).
- Update shader code to use modern 'texture()' syntax instead of 'texture2D()'.
- Fix VMobject recursion error in set_fill and ManimColor initialization.
- Restore audio connectivity in Scene.add_sound.
- Update tests to align with new Manager(Scene) architecture and document pending TODOs.
- Detailed rationale in CHANGES_SUMMARY.md.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Use 'OpenGLMobject as Mobject' and similar imports everywhere
* Remove commented Mobject imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert accidental renaming of OpenGLMobject to Mobject and duplicated .set_default() - now the example scene works again
* Fix CurvesAsSubmobjects and DashedVMobject imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Temporarily solve issue in _add_intrinsic_animation_overrides()
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>