* feat: support multiple compilations
Allow `tex_compiler` to be a `str | list[str]` instead of just
`str`. When a list is given, document will be compiled sequentially.
* fix: suppress compilation progress log when only one compiler is used
* fix: updated docstrings and variable naming
Allows accessing edges via tuple keys like g[(1, 2)] in addition to
vertex lookups like g[1]. Previously only vertex lookups were supported.
FixesManimCommunity/manim#3798
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* feat: add TypstMobject and TypstMathMobject for first-class Typst support
Implement the initial TypstMobject proposal (see agents/typst.md):
- TypstMobject: renders arbitrary Typst markup to SVG via the 'typst'
Python package (self-contained Rust binary, no system install needed),
then imports through SVGMobject.
- TypstMathMobject: convenience subclass that wraps input in Typst math
delimiters ($ ... $).
Pipeline: user string → wrap in minimal Typst document (auto-sized page,
transparent background) → write .typ file → compile to SVG via
typst.compile() → import via SVGMobject → scale/center/recolor.
Key details:
- Compilation helper in manim/utils/typst_file_writing.py with SHA-256
content-hash caching (same scheme as the LaTeX pipeline).
- font_size property mirrors SingleStringMathTex: compile at fixed 11pt,
scale after import using initial_height / SCALE_FACTOR_PER_FONT_POINT.
- init_colors() recolors black submobjects to self.color (Typst default
fill is black), preserving any explicit Typst colors.
- path_string_config enables curve subdivision for smooth animation.
- 'typst' added as optional dependency group in pyproject.toml.
- 10 tests covering creation, font_size, caching, preamble, and repr.
* feat(typst): add sub-expression selection via {{ }} groups and .select()
- Override modify_xml_tree in Typst to convert data-typst-label
attributes to id attributes before svgelements parsing (avoids
attribute inheritance issue with data-* attributes)
- Add Typst.select(key) method accepting str labels or int indices
to retrieve VGroup sub-expressions from id_to_vgroup_dict
- Implement {{ }} double-brace preprocessor on TypstMath:
- {{ content }} → manimgrp("_grp-N", content) (auto-numbered)
- {{ content : label }} → manimgrp("label", content) (named)
- Skips {{ }} inside string literals and [...] content blocks
- Uses math-mode call convention (no # prefix) to keep args in
math mode
- Auto-inject manimgrp preamble when groups are detected
- Add 12 new tests covering label mapping, nesting, select(),
error handling, and preprocessor edge cases
* Remove unneeded assert line
* Generalize some more critical hard-coded LaTeX assumptions
* Fix syntax error
* Support Typst labels in existing APIs
* Add ManimTextLabel typing alias
* Preserve Typst SVG stroke widths by default
* Calibrate Typst font sizing against TeX
* Add Typst mobject documentation
* Track Typst baseline frames
* Document Typst baseline frame tracking
* Add Typst section to text guide
* Polish Typst docs and label handling
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Improve Typst stroke scaling and docs examples
* Tune Typst SVG stroke scaling
* Restore Typst math example wording
* Fix pre-commit issues for Typst branch
* Fix number line runtime typing import
* Exclude Typst autogenerated .rst files
* Use Manim directive in docstrings and fix wrong key in Typst.select() docstring
* Fix GroupedMath comments
---------
Co-authored-by: Toon Verstraelen <Toon.Verstraelen@UGent.be>
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>
Co-authored-by: Francisco Manríquez Novoa <francisco.manriquezn@usm.cl>
GenericGraph.__getitem__ only handled vertex lookup. Passing a 2-tuple
(u, v) to retrieve an edge mobject raised a KeyError against the
vertices dict instead of looking up self.edges.
Route tuple keys of length 2 to self.edges so that g[(u, v)] returns
the edge mobject, consistent with how edges are stored internally.
Adds a test covering vertex lookup, edge lookup (Graph), and edge
lookup (DiGraph).
Fixes#3798
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Issue-4087 Add bug test
* Issue-4087 Fix bug
* Issue-4087 Fix comment and add type hint
* Issue-4087 Fix comment
* Issue-4087 Improve previous test instead of adding a new one
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tests/module/mobject/mobject/test_mobject.py
* Enhance docstring for reduce_across_dimension method
Updated docstring for reduce_across_dimension method to clarify its purpose and parameters.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove float typehints for coords in length_over_dim
* Modify test for empty VMobject dimensions
* [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>
* Allow Swap to accept Group and VGroup and add example
* Modify create_target return type to Group | VGroup
Updated create_target method to allow returning either Group or VGroup.
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add type annotations to `transform_matching_parts.py`
* Make two type errors quiet
* Make the pytests pass
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* More specific Callable type annotations in mobject_update_utils
* [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>
* Add option to hide/show inner lines in Table class
* Add tests for Table class inner lines visibility
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Correct indentation
* Fix os.startfile usage to check for availability on Windows
* Add ConversationFlowScene to animate user-chatbot interactions and metadata display
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert "Merge remote-tracking branch 'origin/conversation' into hide_table_inner_lines"
This reverts commit c0ba5b8511, reversing
changes made to 1f71f4b0e8.
* Revert change
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Leonardo Cariaggi <leonardo.cariaggi@kbc.be>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add regression tests for four recent fixes in vectorized_mobject.py
Adds four regression tests for fixes that landed without tests in the same PR:
* 21cf9998 (PR #4630, fixes#3569 + #4629) -- IndexError in
`get_nth_subpath` when `path_list` is empty; ensure it always returns
a NumPy array.
* f6cdb547 (PR #4219) -- `add_points_as_corners` silently dropped a
single new point when called on a VMobject whose last subpath was
complete.
* 3d029c12 (PR #4320, fixes#4255) -- `pointwise_become_partial` cleared
the target's points when the source had no cubic curves, surfacing as
`Arrow3D.get_start()` / `get_end()` returning the origin after a
`Create` animation.
* 429f25328 (PR #4694) -- `scale(scale_stroke=True)` on a compound
VMobject propagated the parent's scaled stroke width to every
submobject, overwriting submobjects with their own (e.g. zero) stroke.
Each test reproduces the original failing condition at the unit level
and asserts the post-fix behavior. Validation: every test was confirmed
to fail when the corresponding fix is reverted on the source file, and
pass when the fix is restored.
4 tests, ~0.2s runtime. Tests go in the existing files
`tests/module/mobject/types/vectorized_mobject/test_vectorized_mobject.py`
(three tests, adjacent to their topically-related siblings) and
`tests/module/mobject/types/vectorized_mobject/test_stroke.py` (one test,
next to the existing `test_stroke_scale`).
Co-authored-by: LetMarq <LetMarq@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: THE-RAF <THE-RAF@users.noreply.github.com>
Co-authored-by: LetMarq <LetMarq@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>
* Add unit tests for module-level color helpers in manim/utils/color/core.py
Adds tests/module/utils/test_color_helpers.py covering the standalone
helper functions exported from manim.utils.color.core (color_to_rgb,
color_to_rgba, color_to_int_rgb, color_to_int_rgba, rgb_to_color,
rgba_to_color, rgb_to_hex, hex_to_rgb, invert_color, color_gradient,
interpolate_color, average_color, random_bright_color, random_color)
and the RandomColorGenerator class.
Before this PR, only the ManimColor class itself was tested
(via tests/module/utils/test_manim_color.py); the standalone helpers
had zero direct test coverage. Coverage on manim/utils/color/core.py
goes from 71% to 80% (line+branch), and 17 of the 18 testable symbols
in the file's __all__ are now exercised. The only deferred symbol is
get_shaded_rgb, which concerns lighting math rather than color
conversion and is better suited to a follow-up.
42 tests, ~0.3s runtime, no new dependencies.
Co-authored-by: LetMarq <LetMarq@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tests/module/utils/test_color_helpers.py
Increased assertion scheme to cover all colors.
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
---------
Co-authored-by: THE-RAF <THE-RAF@users.noreply.github.com>
Co-authored-by: LetMarq <LetMarq@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>
* fix: preserve geometry in put_start_and_end_on for zero-vector mobjects
* fix: preserve geometry in put_start_and_end_on for zero-vector mobjects
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed asser_array_equal line
* removed commets in mobject.py and opengl_mobject.py as suggested
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added stacklevel=2 suggestion
---------
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>
Includes the changes from PRs #4666, #4668, #4669, #4670, and #4671.
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* fix#3569 and #4629
* Add changes to opengl_vectorized_mobject.py
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Made the document changes
* added additional example
* Apply some suggestions from code review
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Shorten sphere examples
* Fix line breaks and remove trailing whitespace
* Add example for showing portions of spheres
* Undo accidental overwrite of ExampleSphereOverlap
* Change name of manim code block
---------
Co-authored-by: Xiuyuan <u7678992@anu.edu.au>
Co-authored-by: TahitiX <136950383+TahitiX@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <francisco.manriquezn@usm.cl>
* Add type annotations to `mobject.py`
* More work on type annotations for mobject.py
* ...
* Almost handled all mypy errors
* Add the mypy error messages to the lines that trigger them
* Use typing.cast to avoid some mypy errors, as suggested by JasonGrace2282
* Used the ruff linter
* Fixed one typing issue and added the error descriptions to the source code for the remaning 10 errors
* Set the type of the elements in a VGroup to VMobject
* Use typing.cast to handle some specific cases.
* Code cleaning
* Updates
* When started to use typing.cast it is needed to import / define certain elements during runtime and not only during type checking
* Fix bug introduced with the type annotations.
* Made it work again
* ..
* Fixed more issues.
* Code cleanup
* Code cleanup.
Replace self.lines with self.lines_chars and self.lines_alignment.
* Handle slicing when accessing elements inside a VGroup
* Fix missing issues.
* Silence the last mypy error
* Make _Updater, _NonTimeBasedUpdater and _TimeBasedUpdater private.
* Replace | with Union[...] in one location
* Move import of Union
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove comment that is no longer relevant
* Overload the auto_zoom method in MovingCamera to provide better type hinting
* Codecleanup
* Code cleanup
* Renamed lines_alignment to lines_alignments and added a TODO about a future cleanup task
* More code cleanup
* Update manim/mobject/matrix.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Addressing multiple comments from Chopan50
* Implementing more suggestions from Chopan50
* More suggestions by Chopan50
* ...
* More renaming and code cleanup, as suggested by Chopan50
* Restructure code
* anim_args
* Update typing in vector_space_scene
* Implemented a number of suggestions from chopan50
* Make a list of faces with the type list[ThreeDVMobject]
* Ensure to return a VGroup if slicing is used.
* Revert back to the original code in text_mobject.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add the propagate_colors option to Mobject as it is used by VMobject.
Replace Self with _UpdateBuilder
* Simplify code
---------
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>
Added quotes to Vector3D and to Point3D to match other calls to `cast`, such has Chopan suggested
Issue #4550: https://github.com/ManimCommunity/manim/issues/4550
Co-authored-by: Colin Belhomme <colin.belhomme@telecom-paris.fr>
* 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>
* 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>
* sub_alphas is derived directly from to_update so they're guaranteed to be of the same length.
* self.shapes is initialised as a direct copy of the mobject, guaranteed to be of same length.
* linspace in this case guarantees both arrays are of equal size (self.n_segments).
* Any transformation already requires that each datapoint in the first tuple has a corresponding datapoint in the second (ie same length)
* Replaced arange with linspace, eliminates risk of floating point errors and forces rgbas and offset to be the same size for strict=True
* all_arc_configs is either defined specifically by length of point_pairs or strictly forced to be the same length (n). In any case they'll always be the same length so strict=True works.
* There should always be an equal amount of start and end anchors; radius_list is defined directly from the length of vertex_group; both outer_vertices and inner_vertices posess n vertices.
* boundary_times always contains has an even length so both 'slices' in the zup function are the same length.
* colors_in_gradient is defined to be the same length as p_list_complete; labels and parts are seemingly user inputs with no guarantee of equal length; val_range is defined to be same lenght as self.bar_names; however there's no authentication that self.values has a fixed length after it's been defined ie user can append to the list creating a mismatch between len(self.values) and len(self.bars)
* In most cases here, the tuples are either defined to be of same length or manipulated to be by the align_data function. In the match_points function there is currently no validation to ensure both mobjects are the same length.
* Reverting _add_x_axis_labels() zip() function back
to strict=False due to failing test cases
* Reverted strict zip usage
* color_gradient is defined to be same length as p_list_complete & within _add_x_axis_labels we define val_range to be the same length as self.bar_names
* align_data and lock_matching_data have no validation to ensure tuples in the zip() function are of the same length. Every other time zip() is used here it is generally immediately manipulating or explicitly defining the tuples to be of same length
* All tuples in zip() functions here are either clearly the same size or manipulated to be the same size using the make_even function.
* The tuples in the zip() function will clearly be of equal length, the second tuple is simply a cyclic shift of the first.
* In the ingest_submobjects function arrays is a one to one mapping of attrs so they are guaranteed to have equal lengths.
* Every usage of zip() consists of tuples that are either manipulated to be equal size or defined to be equal size.
* the zip() function in bezier_remap will always consist of equal length tuples as current_number_of_curves is read directly from the shape of bezier_tuples and is used to dictate the size of split_factors.
* The zip() function color_gradient() will always consist of equal length tuples as floors is defined directly from alphas (which also defines alphas_mod1)
* The tuples in the zip() function in adjacent_n_tuples will always be the same length so strict=True.
* The find_intersection() contains a zip() function that has been set to strict=True. While it is technically possible to pass tuples to this function that are *not* the same length, this would result in generally unexpected behaviour anyway.
* Changed zip() function to have strict=True in __init__() as custom_labels is dependent on tick_range so guaranteed to have the same length.
* Several instances of zip() set to strict=True. In add_coordinates we have axis manipulated to be the same length as tick_range. In get_riemann_rectangles() we have colors dependent on of x_range_Array forcing them to be the same length. Finally in plot_line_graph() it is clearly intended that all inputs used in the zip() function are of the same length (except possibly z which may not exist and will be made equal length to x); while it is not guaranteed they will be the same length this would cause unintended behaviour.
* zip() function bool changed to strict=True in all these test cases. Most test cases either a) hardcode two things to be the same length, b) verify things are the same length before the function or c) explicitly exist to check whether two things are the same length.
* Add py.typed to declare manim as having type hints
This tells tools like Pyright that this package has its own type hints and it should try to look for them in typeshed.
Fixes#4552
* [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>
* type annotations and docs for opengl_renderer.py
* add missing self
* Fix RTD build: move Window import to TYPE_CHECKING block
The Window import was moved to module-level in a recent type annotation
commit, but this causes opengl_renderer_window.py to be imported at
load time, triggering pyglet which fails on headless systems (RTD) when
it tries to create a shadow window. Moving the import into TYPE_CHECKING
preserves type hints for mypy while avoiding runtime display dependency.
* Fix mypy errors in opengl_renderer.py
- Cast np.linalg.inv() result to correct type
- Convert quaternion list to ndarray before passing to rotation_matrix_transpose_from_quaternion
- Cast get_center return value
- Fix return type for pixel_coords_to_space_coords (ensure float dtype)
- Add type: ignore for moderngl.create_context backend arg (incorrect stubs)
- Add type: ignore for blend_func assignment (incorrect stubs)
* Fix mypy errors and runtime import issues in opengl_renderer.py
- Import MatrixMN and Point3D at runtime (needed for typing.cast)
- Cast np.linalg.inv() result to correct MatrixMN type
- Convert quaternion list to ndarray before passing to rotation_matrix_transpose_from_quaternion
- Cast get_center and pixel_coords_to_space_coords return values to Point3D
- Ensure float dtype in np.array literals for type consistency
* Add runtime import of Window in init_scene
The Window class is imported inside TYPE_CHECKING for type hints, but
needs to be imported at runtime when actually creating a window. This
import is deferred to avoid triggering pyglet display initialization
on headless systems (RTD build).
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix: infinite recursion caused by accessing color of a highlighted Table cell.
fix: removed type: ignore[attr-defined] mypy was not a fan of
* fix: added back needed mypy type ignore
* Add regression tests for Table/BackgroundRectangle color access
Tests for infinite recursion issue fixed in PR #4435 (issue #4419).
Refs: #4419
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Refactor BackgroundRectangle color test to geometry tests
Move test_background_rectangle_color from test_table.py to
test_unit_geometry.py since BackgroundRectangle lives in
geometry/shape_matchers.py, not in tables.
Regression test for ManimCommunity/manim#4419 (infinite recursion
when accessing BackgroundRectangle.color)
* Fix: Added missing manim GREEN import needed for test_BackgroundRectangle_color_access()
---------
Co-authored-by: Henrik Skov Midtiby <hemi@mmmi.sdu.dk>
Co-authored-by: Benjamin Hackl <mail@behackl.dev>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: bhearr <None>
* fill_color --> color for MathTeX
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* feat: 'seed' option for reproducible outputs
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* enh: let Scene automatically pick global random seed, use arg as override
* chore: move import slightly
* chore: add test for color generator being reproducible with global config seed
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* fix: correct Circle.point_at_angle calculation for accurate arc mapping
* chore: remove unused variable 'start_angle' to fix pre-commit CI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* test: add test for Circle.point_at_angle()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henrik Skov Midtiby <hemi@mmmi.sdu.dk>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Benjamin Hackl <mail@behackl.dev>
* chore: bump minimum supported python to 3.11
* fix: breaking changes from av upgrade
* chore: slightly bump minimum required version of av to 14.0.1
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* chore: update lockfile
* chore: update lockfile again with --upgrade
* Update pyproject.toml
* chore: CI pipeline os/version changes
* fix: indentation in ci.yml
* fix: use result.output instead of result.stdout for test_manim_cfg_subcommand
In Click 8.3.1 (pulled in by av>=14.0.1), help text output
behavior changed for no_args_is_help=True. Using result.output
instead of result.stdout makes the test robust across Click versions,
matching the pattern used in other tests like
test_manim_plugins_subcommand.
* fix: add UP to imports in get_winding_number doctest
* fix: add match_interpolate to imports in doctest
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Initial type work
* More kwargs Any
* More typing
* _get_u_values_and_v_values cleaned
* self.checkerboard_colors
* Simplify code
* colorscale
* new_colors
* Ugly hacks to make the opengl objects behave
* checkerboard_colors
* Ignored a single type error
* Ignored the last type error
* Remove entry from mypy.ini
* set_fill_by_checkerboard
* resolution
* u_range and v_range
* ThreeDAxes
* Is tuple a color?
* resolution
* Point3D and Vector3D
* More with Point3D
* resolution
* colorscale
* checkerboard_colors Iterable
* Breaking change: checkerboard_colors can now be set to None
* Revert "Breaking change: checkerboard_colors can now be set to None"
This reverts commit d5c54cf5fa.
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
## Overview: What does this pull request change?
This PR fixes the documentation for `TangentialArc`.
1. It replaces the static code block in the `TangentialArc` example with the `.. manim::` directive, allowing the example image/video to actually render in the documentation.
2. It adds a new second example scene, `TangentialArcCorners`, which visually demonstrates how the `corner` parameter (e.g., `(1,1)`, `(-1,1)`) affects the arc's orientation.
## Motivation and Explanation: Why and how do your changes improve the library?
Previously, the `TangentialArc` example was hidden inside a standard code block, so users could not see what the output looked like.
Additionally, the `corner` parameter is complex to visualize mentally. The new `TangentialArcCorners` scene provides a clear visual reference for all four possible quadrant configurations, making the class much easier to learn.
## Links to added or changed documentation pages
N/A
## Further Information and Comments
I have tested these changes locally and verified that the images generate correctly.
I am submitting this to the Codeberg mirror as per the current guidance regarding the GitHub incident.
**Visual Proof of the new example:**
I have attached the image
## Reviewer Checklist
- [ ] The PR title is descriptive enough for the changelog, and the PR is labeled correctly
- [ ] If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
- [ ] If applicable: newly added functions and classes are tested
Reviewed-on: https://codeberg.org/ManimCommunity/manim/pulls/1
Reviewed-by: Benjamin Hackl <behackl@noreply.codeberg.org>
Co-authored-by: TahaShams <01-134222-153@student.bahria.edu.pk>
Co-committed-by: TahaShams <01-134222-153@student.bahria.edu.pk>
* Add ruff rules PERF for performance
* [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 duplicated arrow tips in DashedVMobject and add tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Fixes
Fix type errors, add types for the transformation functions, and fix one case where the about_point and about_edge options were not correctly passed in apply_complex_function in mobject.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* More fixes
- Import a couple types that should have been imported
- Remove the redefinition of self.background_stroke_width in manim/mobject/types/vectorized_mobject.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Set the default python version to 3.13 in the uv installation guide.
* Capitalize Python
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add regression tests for about_point view mutation issue
This adds regression tests for issue #4445 where using get_vertices()[0]
as about_point in transformation methods would cause incorrect results
due to numpy array view mutation.
Tests added:
- test_rotate_about_vertex_view
- test_scale_about_vertex_view
- test_stretch_about_vertex_view
- test_apply_matrix_about_vertex_view
- test_opengl_rotate_about_vertex_view (OpenGL was not affected by the bug)
Related to #4445
* Fix about_point view mutation in apply_points_function_about_point
When about_point parameter receives a numpy array view (e.g., from
get_vertices()[0]), the in-place operation `mob.points -= about_point`
would mutate the view, corrupting the transformation calculation.
This fix copies about_point before using it to prevent view mutation.
The OpenGL renderer was not affected by this bug because it uses
`arr - about_point` (creates temporary) instead of `arr -= about_point`
(mutates in-place).
Fixes#4445
* [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>
* added option to render all scenes by typing '*' when prompted
* [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>
* Add implementation for tangential arc
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add example
* Improve doc slightly
* Remove corner type
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add test for TangentialArc
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Import Line only if type checking
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add missing type hint
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add test for tangential arc
* [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>
* fixed problem: default value of color in styles in CodeMobject
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added accidently removed test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update code_mobject.py
Code suggested by maejam
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henrik Skov Midtiby <hemi@mmmi.sdu.dk>
Co-authored-by: Henrik Skov Midtiby <henrikmidtiby@gmail.com>
* fixed problem with type conversions in Line3D
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed broken test and Arrow3D
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/mobject/three_d/three_dimensions.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/mobject/three_d/three_dimensions.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Delete unnecessary file
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed typo in variable nam
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* feat(manim.mobject.opengl): added type annotations for `opengl_compatibility.py`
* feat(manim.mobject.opengl): typed almost all attribute definitions in `OpenGLMobject.__init__`
* feat(manim.mobject.opengl): typed more methods for `OpenGLMobject`
* fix(manim.mobject.opengl): import `override` from `typing_extensions`
* fix(manim.mobject.opengl): import `Never` from `typing_extensions`
* feat(manim.utils.config_ops): made `_Data` descriptor generic, to allow correctly typing `OpenGLMobject`
* fix(mypy.ini): don't ignore `manim.mobject.opengl.opengl_mobject`
* fix(manim.utils.config_ops): import `TypeVar` from `typing_extensions`, because the `typing` one does not have the `default` argument.
* feat(manim.mobject.opengl.opengl_mobject): Type checked more methods in `OpenGLMobject`.
* fix(manim.mobject.opengl.opengl_mobject): Fix a typo in `OpenGLMobject.restore`.
* feat(manim.mobject.opengl.opengl_mobject): Typed more methods in `OpenGLMobject`.
* feat(manim.mobject.opengl.opengl_mobject): Moved `overload`s inside an `if TYPE_CHECKING` statement.
* feat(manim.mobject.opengl.opengl_mobject): Added type annotations for `**kwargs` in a set of related methods.
* Revert "feat(manim.mobject.opengl): added type annotations for `opengl_compatibility.py`"
This reverts commit 1cd1550dd2.
* fix(OpenGLMobject): defined `get_array_attrs` method (and typed `_original__init__` at class scope).
I followed the advice of an existing `# TODO` comment and the implementation in `Mobject`. This also resolves a mypy error in this class (missing attribute).
It's interesting because the `get_array_attrs` method is (was) only defined in three classes:
- `Mobject`
- `PMobject`
- `OpenGLPMobject`
* feat(manim.mobject.opengl.opengl_mobject): Added type annotations for the `override_animate()`.
* feat(manim.mobject.opengl.opengl_mobject): Added type annotations to `_AnimationBuilder` and some methods in `OpenGLPoint`.
* fix(manim.mobject.opengl.opengl_mobject): fix failing tests
* fix(OpenGLMobject): default implementation of `pointwise_become_partial(…)` had to return `self`!
* feat(OpenGLMobject): added `type: ignore[no-untyped-call]` for calls to `ShaderWrapper` methods (not yet annotated).
* feat(OpenGLMobject): annotated shader-related `ClassVar`s
* feat(OpenGLMobject): typed several `**kwargs` and added `type: ignore[no-any-return]`s for cases where mypy cannot understand operations on numpy arrays.
* feat(OpenGLMobject): typed more `**kwargs` and fixed `set_color` arguments
* feat(OpenGLMobject): Added more type annotations.
* feat(OpenGLMobject): Typed `OpenGLMobject.uniforms` and `OpenGLMobject.fixed_orientation_center`
* fix(OpenGLMobject): fix tests
* fix(OpenGLGroup): annotate `**kwargs`
* fix(OpenGLPoint): annotate `**kwargs`
* fix(OpenGLPoint): corrected `**kwargs` and removed two `type: ignore`s
* fix(OpenGLPoint): removed `# type: ignore[no-untyped-call]`s
* fix(ci): import `Self` from `typing_extensions` rather than `typing`.
* fix(ci): import `TypeAlias` from `typing_extensions` rather than `typing`.
* feat(OpenGLMobject): make use of PEP 728.
* fix(ci): update `typing-extensions` requirement to the first version that supports PEP 728.
* fix(OpenGLMobject): avoid variable redefinitions in the `arrange_in_grid` method.
* fix(mypy.ini): remove unused changes to `mypy` configuration.
* fix(OpenGLMobject): use different symbols for the two `updater` variables.
* Revert "fix(ci): update `typing-extensions` requirement to the first version that supports PEP 728."
This reverts commit 69b96c6420.
* fix(OpenGLMobject): remove `TypedDict`s and switch to the less precise `**kwargs: Any`.
* Handle three no-any-return issues.
* Removed the slash divider in function parameters
* Removed the slash divider in function parameters
* Keep a single slash divider - to make return types match
---------
Co-authored-by: Henrik Skov Midtiby <henrikmidtiby@gmail.com>
* edit: added the descriptions to /docs/source/index.rst
* apply suggestions from review
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Give SurroundingRectangle 2D buffer
* add test for SurroundingRectangle buff parameter
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Rename save_final_image() to save_image()
* Rename SceneFileWriter.save_final_image() to save_image() and fix
docstring
* fix some type annotations
* make docstrings consistent
* Update manim/scene/scene_file_writer.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Francisco Manríquez <francisco.manriquezn@usm.cl>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add type hints to scene/scene_file_write.py
* Add type hints to scene/scene_file_write.py
* Add type hints to scene/section.py
* Add type hints to scene/zoomed_scene.py
* Add type hints to scene/moving_camera_scene.py
* Fix typing of variable scene_name
* Fix typing
* Fix one more type hint
* Adding type annotations to three_d_camera.py
* Suggestions from Chopan50
* Removed a comment.
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Starting to work on type annotations for tex_mobject.py
* More work
* Finished.
* Code cleanup.
* ...
* Removed the ignore errors line in mypy for tex_mobject
* Fix typing of colors
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add classes MethodWithArgs, SceneInteractRerun and SceneInteractExit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add missing manim.data_structures file
* Rename SceneInteractExit to SceneInteractContinue and use dataclasses
* Revert using @dataclass(slots=True), because Python 3.9 does not support it
* Change order of dataclasses
* Add references to Scene.queue in docstrings
* Include data_structures in utilities_misc.rst
* Use qualified names and mark strings as code in data_structures.py
* Add module docstring to data_structures.py
* Move Scene.interact() objects from data_structures.py into scene.py
* Use qualified name in SceneInteractAction docstring
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Improve MappingCamera, MovingCamera, Rotation, CliColors, and _init_.py readability and docstrings
* Readibility and docsstrings
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestion from @behackl
---------
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>
* Stop ignoring errors from manim/scene.py
Count: 307 errors
Type annotations on scene/vector_space_scene.py
Add type annotations to scene/vector_space_scene.py
Mypy count: 210
Reverting two changes that triggers an error in the automatic testing.
Further work on type hinting.
Avoid forwarding positional arguments from Arrow to Line in the constructor.
Revert "Avoid forwarding positional arguments from Arrow to Line in the constructor."
This reverts commit 80ae8576c1.
Removed several type ignore statements and addressed comments from JasonGrace2282
Revert "Activate mypy check of mobject.geometry.*"
This reverts commit d477c9a994.
Revert "Removed several type ignore statements and addressed comments from JasonGrace2282"
This reverts commit 07bbe3f220.
Added type annotations to zoomed_scene.py
Error count: 308 -> 303
Adding type annotations to all methods in vector_space_scene.py
Error count: 303 -> 272
Get rid of no-untyped-call errors from my in the vector_space_scene.py file
Error count: 272 -> 343
Handle type issues related to ManimColor in vector_space_scene.py
Handle var-annotated issues in vector_space_scene.py
Error count: 332 -> 330
Handling has-type type errors in vector_space_scene.py
Error count: 330 -> 285
Handled name-defined type issues in vector_space_scene.py
Error count: 285 -> 282
Address type issue with calling an untyped method.
Error count: 282 -> 281
Fix some typing issues in transform_mathcing_parts.py
Change stroke_width to float in vector_space_scene.py
Handled a few type errors.
Error count: 267
Handled several typing issues in three_d_scene.py
Error count: 267 -> 248
Dealing with type errors in scene_file_writer.py
Error count: 248 -> 216
Ensured that all methods in scene.py have type declarations.
Error count: 216 -> 225
Handle type issues related to interactivity by asserting that the camera is the OpenGLCamera
Error count: 225 -> 182
Handle type issues in scene.py
Error count: 182 -> 167
Asserting that the renderer or camera is of the proper type to use certain methods.
This is mainly related to interactive elements and the 3D camera used in the ThreeDScene
Error count: 167 -> 143
Avoid cyclic import of dependencies
Error count: 143 -> 143
Handling no-untyped-call type errors in manim/scene/scene.py
Error count: 143 -> 131
Handling assignment type errors in manim/scene/*.py
Error count: 131 -> 121
Handling arg-type type errors in manim/scene/*.py
Error count: 121 -> 116
Handling arg-type type errors in manim/scene/*.py
Error count: 116 -> 112
Fixing various type errors
Error count: 112 -> 102
Fixing various type errors
Error count: 102 -> 97
Fixing various type errors
Error count: 97 -> 90
Some aggressive changes to silence a significant number of type errors.
Error count: 90 -> 66
Commented out an import (IPython) that makes the CI tests fail.
Fix various type errors.
More type annotations.
Code cleanup.
Remove the property mobject_updater_lists of the Scene class as it is not used anywhere.
Handle import-untyped typing issues.
More work on type annotations in manin/scene/.*
More work on scenes/*.py looking at the dependency opengl_renderer.py
More work on types in scenes/*.py
Ignored an old bunch of type ignore statements.
More work on dependencies for scene.py
More work on dependencies for scene.py
* Stop ignoring errors from manim/scene/scene.py
mypy error count: 307
* Adding type annotations to scene.py (C1)
* Adding type annotations to scene.py (C2.1)
* Adding type annotations to scene.py (C2.2)
* Adding type annotations to scene.py (C2.3)
* Adding type annotations to scene.py (C3)
* Adding type annotations to scene.py (C4)
* Adding type annotations to scene.py (C5)
* Adding type annotations to scene.py (C6)
* Adding type annotations to scene.py (C7)
* ...
* Focus on scene.py
* Adding type annotations to vector_space_scene.py
* Added types to opengl_renderer.py
* Added types to cairo_renderer.py
* Fixed the last mypy errors in scene.py - many was ignored
* Fixed the last mypy errors in vector_space_scene.py - many was ignored
* Got rid of the last mypy errors.
* Activate mypy check of vector_space_scene.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Code cleanup.
* Update manim/gui/gui.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/renderer/opengl_renderer.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/scene/scene.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/scene/scene.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/scene/scene.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/scene/scene.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/scene/scene.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Implementing suggestions from chopan50
* Explicitly mention all files where type errors are ignored in mypy.ini
# Conflicts:
# mypy.ini
* Fix issue
* Updates based on comments from chopan50
* Updates suggested by Chopan50
* Addressed more comments from chopan50
* Addressing more comments from chopan50
* Added docstring to SceneInteractAction
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Differentiate between _AnimationBuilder from an mobject and an opengl_mobject
* Avoid a nameclash with the mobject module and variable name
* Last touches.
* Rolled back some changes related to _AnimationBuilder
---------
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>
Co-authored-by: Louis Pierre Jean Gerard <louis_global@fasoo.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Fixed mypy errors in several files with a few errors in each file.
* Fixed a few easy mypy errors.
* Fix mypy issues in animation/changing.py
* Handled mypy issues in _config/cli_colors.py
* Handled mypy issues in mobject/logo.py
* Handling mypy errors in fading.py
* Removed a default parameter (scene = None) in the method clean_up_from_scene in the class FadeOut
* Handled mypy errors in graphing/scale.py
* Handled a few mypy errors in updaters/update.py
* Handled mypy errors in three_d_utils.py
* Updated mypy.ini to check more files
* Avoid a circular import loop.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/mobject/logo.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Cleaner way to indicate the float type
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/animation/changing.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Updated the type annotations of MoveAlongPath and ChangingDecimal
* Suggestions from review by chopan50
* Fix missing import.
* Update mypy.ini
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update mypy.ini
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update mypy.ini
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update mypy.ini
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Updated mypy.ini
---------
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>
* add a random generator to hold the seed for random generation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add DOCSTRING for new class RandomColorGenerator
* fix RandomColorGenerator doctest
* introduce the sample colors param in RandomColorGenerator
* Update docstrings to include sample_colors param for RandomColorGenerator
* fix cyclic import issues
* fix indentations for code blocks
* docstring formatting changes
* removed performance warning
added class method
---------
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>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Francisco Manríquez <francisco.manriquezn@usm.cl>
* Fix polygon inside/outside logic for edge cases
* Stop using hardcoded values and improve variable naming
* Decompose inside/outside logic into smaller functions
Improves readability and maintanance.
* Improve test readability
* Fix polylabel test logic
* Fix polylabel test by adding multiple options of pole
* Improve docstring description of argument
* Stop checking type checking blocks on coverage
* Fix OpenGLMobject methods doctests
* Fix(graph) : fix Line subclass usage for Graph and DiGraph
Fix(graph): LabeledLine can now be used in _add_edge
* Test(test_graph.py): add tests for LabeledLine as edge_type in Graph and DiGraph
Fix(test_graph): Fixed test_graph_accepts_labeledline_as_edge_type() always failing.
* Add example to family_members_with_points method in Mobject
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add the word 'recursively' to clarify the method description
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Improve the sentence of method description
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Improve the method description
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Adding brackets
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add 'See also' section
* Update manim/mobject/mobject.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* chenge list to list[Mobject]
---------
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>
* Fix Line failing with buff and path_arc
- make copy of vmobject.points if necessary
* change self to self.copy() in Line, and remove the previous change in pointwise_become_partial()
* Revert to first approach: copy points if self is vmobject
* Add unit test for pointwise_become_partial and Line
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* In Line: simplify _account_for_buff and set default path_arc to 0.0
* In Line: add docstring
* change 0.0 to 0
* Use explicit check for path_arc == 0 in _account_for_buff
---------
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Bugfix: colorsys uses HLS (hue, luminance, saturation) ordering when converting to/from rgb. Manim says it uses HSL ordering. Fixed order of parameters in call to colorsys for ManimColor.from_hsl and ManimColor.to_hsl.
Added tests ensure correct HSL ordering.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update to fix the correct color tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: SonnyRoomex <sonny.campbell@roomex.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* fix: enable opengl compatibility for Code
* [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>
* rewrite pyproject.toml to support uv; version upgrades of several dev dependencies
* codespellrc: poetry.lock -> uv.lock
* rewrite workflows, first attempt
* change name of pre-commit-hook
* dev-dependencies -> dependency-groups.dev
* lint + format
* Update .github/workflows/ci.yml
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* convert development.rst to myst markdown
* fix (most) docbuild warnings from theme upgrade
* development instructions: switch to uv, plus minor updates
* update entrypoint config in plugin docs + tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix link formatting and clarify the distinction between Manim versions
* [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>
* Add example to get_family method in Mobject
* [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>
* Type color and polish docstrings
* Stop ignoring manim.utils.color MyPy errors
* Remove manim.mobject.mobject from mypy.ini (put there on accident)
* Fix MyPy errors in GitHub pre-commit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Modify _construct_from_space parameter type
* Modify _construct_from_space parameter type
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: remove duplicate property definitions
---------
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>
* Update readme to properly credit Grant Sanderson and revise dismissive language
* Adjust readme and add landing-page mention about Grant's Manim
* Apply suggestions from code review
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* add __hash__ to ManimColor
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update core.py
* add test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: correct typehint
* fix test
---------
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>
* Add missing changes for homotopy example
* [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 VMobject.add_points_as_corners() to return self and safely handle case where no points are passed
* Add test_vmobject_add_points_as_corners()
* assert np.allclose() -> np.testing.assert_allclose()
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
Co-authored-by: Francisco Manríquez <francisco.manriquezn@usm.cl>
Follow-up to #3501
This commit combines all the installation documentation onto one page, and switches to recommending the usage
of `uv` for installing Manim.
* Allow python 3.13
* Specify scipy more strictly
* try using 3rd-party audioop package
* debug: wrap context generation in try-block
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove audioop-lts, update dependencies
* add wrapt pre-release (wheels!)
* update lockfile
* CI, windows: try installing all tinytex packages at once
* tmp: verbosity of pytest
* tmp: pass -n 0 for testing
* tmp: disable pytest-xdist
* remove deprecated poetry installer option
* try running tests via uv-provided env
* tmp: run -> run --no-project
* try --full-trace
* try running tests via python -v ...
* tmp: test import of suspicious modules
* test click/cloup
* ci: back to poetry
* ci: disable pytest plugins altogether
* update lockfile
* ci: upgrade pytest
* remove all flags from pytest call
* ci: move conftest, temporarily disable test header
* fix test fixture
* try with more recent version of pytest-xdist
* loadfile -> loadscope
* explicitly test pytest for non-manim module
* some proper tests
* only keep fixtures in new conftest.py
* remove all non-necessary fixtures
* try a literal try/except in fixture file
* simplify tests further
* try and explicitly trigger non-silent errors
* Revert "try and explicitly trigger non-silent errors"
This reverts commit 35b862d483.
* more pytest debug output
* test whether manim can be imported correctly
* test with upgraded numpy
* revert all sorts of debug changes, attempt clean pytest run
* fix whitespace
* pre-commit hooks
* apply config fixture to render tests
* let config fixture ensure renderer is set to cairo
* update doctests for numpy>=2.0
* missed some
* upgrade required numpy version, revert separate treatment of numpy in ci
* upgraded moderngl-window to latest
* more delicate versioning of numpy dependency
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Allow animations with run_time=0 and implement convenience Add animation
* Modify examples so that there are less characters per line
* Docstring fixes
* Update manim/animation/animation.py
* Address comments
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* initial commit
* Update labeled.py
* general fixes
fixed added utils (i.e., Incomplete ordering and Explicit returns mixed with implicit), added :quality: high to docstrings, made ConvexHullExample determined
* typing
added typing to `qhull.py` and `polylabel.py` for debugging. simplified test cases for `ConvexHull` and `ConvexHull3D` and rewrote control data. added tip to LabeledPolygon documentation.
* response to feedback
added `label_config` and `box_config` and `frame_config` for additional configuration options and cleaner interface. added `InternalPointND` and `PointND ` and `InternalPointND_Array` and `PointND_Array` for typing. updated docstring.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* typing
* Update manim/mobject/geometry/labeled.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Update manim/mobject/geometry/labeled.py
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* typing, docstring, class name
* typing
---------
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>
* make checks involving from/upto_animation_number more explicit
* add test for flag -n 0,0 for only rendering first animation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Implement SurroundingRectangle.multiple and BackgroundRectangle.multiple
* Integrate SurroundingRectangle constructor for multiple objects into __init__
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* SurroundingRectangle now takes multiple Mobjects as positional args
* Add tests for multiple Mobjects in SurroundingRectangle
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix example that was not using keyword args for SurroundingRectangle
* Remove duplicate code from BackgroundRectangle
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add typing to manim argument of SurroundingRecrabgle constructor
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Remove redundant argument from test_SurroundingRectangle
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Remove type check from SurroundingRectangle
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix missing line issue
* resolve merge conflict
* Fix Group import
* Move Group import into the body of SurroundingRectangle
* Return type checking to SurroundingRectangle
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* small change to error message
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix missing imports
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
* Add option to scale object outlines with objects
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Move outline scaling into VMobject.scale()
* Add unit tests for stroke width
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix docstring for VMobject.scale
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Remove tautology from VMobject.scale
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Refactored Animation run_time validation
* Rewrite error and warning messages, and add validations to wait(), pause() and wait_until()
* Undo rewriting of imports
* Reduce line cylinder height resolution to 2
Subdividing a line cylinder by its height adds no extra resolution -
since it's not checkerboarded, all new rectangles would look the same as
one long rectangle. Decreasing the default subdivision resolution to 2
reduces submobject count by 12x while sacrificing no quality.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Allow for 2 resolution values in Line3D
This prevents a breaking change where a tuple of resolution values
passed to Line3D.resolution would no longer work.
Also applies to Arrow3D.
* Assign field before init
* Add checkered line info to docstring
* Regenerate test control frame
* Regenerate missing control frames
---------
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>
* ToEdgeExample's circle is added to the scene
* Made it consistent to the surrounding code
---------
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* scene_file_writer: convert frame_rate to fraction
* Set audio codec to AAC when format=mp4
* refactor: change import uv.utils.Fraction -> fractions.Fraction
* use config as single source of truth for container format
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Quoting the python library documentation:
> The subprocess module provides more powerful facilities for spawning
> new processes and retrieving their results; using that module is
> preferable to using this function.
* feat: preserve original Tex colors
* added test for preserving tex color
* fix: fixed breaking change to tex color inheritance
* updated docstring and comment
* Update manim/mobject/text/tex_mobject.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Changing the 'side_length' attribute to a property
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add tests for Square side_length property
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tests/module/mobject/geometry/test_unit_geometry.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
A Sector is a special case of `AnnualarSector` where the inner radius is zero. As such, it does not make sense to also have a parameter for the inner radius.
* Simplify Sector Class by Removing Redundant Parameters
* [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>
pydub will try to use `ffmpeg` for non-`.wav`/`.raw` files, which is no longer a dependency of Manim. To avoid this, we convert non `.wav`/`.raw` files into `.wav` files before passing it to pydub.
---------
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
* Add separate thread for writing frames to stream
* [pre-commit.ci] pre-commit autoupdate (#3889)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.5.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.4...v0.5.5)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Replace the TypeError message code in the _typecheck_input method in … (#3890)
* Replace the TypeError message code in the _typecheck_input method in the DrawBorderThenFill class.
* [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>
* Remove print statements used for debugging
* Remove writing process termination
- This is probably leftover from back when manim used subprocess to
write frames to FFmpeg via stdin
* Add type hints to modified methods & instance vars
* Fix inline code in docstring & type hint for queue
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Irvanal Haq <125118413+irvanalhaq9@users.noreply.github.com>
* Replace the TypeError message code in the _typecheck_input method in the DrawBorderThenFill class.
* [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>
* Experimenting with an HSL class
* Add some more functionality
* Adding a lot of tests and implementing fully functional conversion between color spaces over proxy rgba
* Fixing tests
* Fixing typing
* return str to normal
* Additional documentation
* Update manim/utils/color/core.py
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/utils/color/core.py
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/utils/color/core.py
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/utils/color/core.py
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Fix documentation and typing and revamp operators to respect color spaces
* Fix color operator typing and add operator tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix typeguard
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Import ManimFloat
* Update manim/utils/color/core.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/utils/color/core.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Add docstring to _internal_space
* naming of functions according to pep8
* Fix naming
* Update manim/utils/color/core.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Update manim/utils/color/core.py
Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add colorscale to plot
* Update manim/mobject/graphing/coordinate_systems.py
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* updated typing and moved one line
* added test
* fix input_to_graph_point error
* Performance improvement by using cairo color drawing
* Add OpenGL support
* Add OpenGL tests and split test for x and y axis for more behavior coverage
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated gradient_line tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: MrDiver <mrdiverlp@gmail.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>
Co-authored-by: chopan <francisco.manriquezn@usm.cl>
* Add config for bugbear/comprehensions
note: flake8-comprehensions has 0 changes to the files
* Safe fixes from pre-commit
* Manual changes to make pre-commit pass
* Remove deps from pyproject
* pyproject
* Autofixes from pre-commit
* use get over get(x, None)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
---------
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* feat: Animation.set_default
Adds set_default class method to Animation class based on existing implementation for Mobject class.
Addresses issue #3142
* test: added missing test
* fix: docstring formatting
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add ruff config for pytest
* Fixes for pre-commit
* Changes to make pre-commit happy (Unrelated to PR)
---------
Co-authored-by: Tristan Schulz <tristanschulz1200@gmail.com>
* Fixes#3614
Setting background_transparency=0.0 should have the same effect than
setting transparent=True. The output format must be compatible
with transparency (.mov, .webm). Otherwise ffpmeg fails.
This patch ensures that background_transparency=0.0 triggers the
change of the output format. Also a WARNING is raised about
the change in the output format.
I want to thank @SirJamesClarkMaxwell for inspiring me to tackle
this issue.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* test config.background_opacity < 1
* fix config behavior for config.background_opacity < 1
* fix logger messages being emitted twice
* actually cleanup usage of loggers, remove logger-imports; black
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* dry_run fixture
* remove debug print
* applied suggestion from review
* remove custom fixture from test_deprecation, use manim_caplog
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update macos.rst
As of July/2024, brew installs Manim and its dependencies.
Guideline for installing dependencies with brew, and attempt to install using pip3 will no longer work either venv or not.
Now homebrew team manages python resources as "System-wide" only with Brew installed resources.
Hence, to give first time installer just leave a single line install command would be the simplest option we have.
* Update docs/source/installation/macos.rst
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add docstrings to `Brace` methods
* Add full NumPy format docstring for the `Brace` methods
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feedback
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* my test is not passing, i need to add a little bit of docs. except that everything is fine. Issue is solved!
* fixed the issue #3655
* removed comments
* fix: 3706 original issue, without adding unnecessary dot
added: i added self.height parameter in Cone class
my tests passes
* Changes that way how end point of Arrow3D is calculated.
* I've improved the methods get_start and get_end for the Cone class, and get_end for the Arrow3D class to ensure they return accurate geometrical points after transformations. Additionally, I've included unit tests to verify the correctness of these methods for the Cone class.
* Finished! Replaced VMobject by VectorizedPoint as Ben suggested while ago
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Make `Line::set_points_by_ends` behavior consistent with constructor
* Use `Line::set_points_by_ends` in edge updaters
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Undo unnecessary change to Graph
* Update manim/mobject/geometry/line.py
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>
* docs: add manim.typing guide
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add colors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add another example for when to typehint as Vector
* Add docs for images+functions
* write Beziers
* Improve based on feedback
* type -> Type
---------
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>
* fix: importing manim should not trigger pygments.styles.get_all_styles
Removed the Code.styles_list attribute.
Rewrote the documentation to say that a list of all styles can be generated by calling list(pygments.styles.get_all_styles()).
The example in the docstring of Code was rewritten to use an explicit code style name.
* fix: small change to documentation
* Added potential class method to get available code styles.
* Adding typehints to newly-added attributes.
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Removing unnecessary lines.
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
---------
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Add typings to OpenGLMobject
* Import typing_extensions
* Add explicit returns to inner functions in .arrange_in_grid()
* Add quotes to parameters in ValueError
* Add some more typings
* Address requested changes
* Type apply_over_attr_arrays with TypeVar
* Fix use of TypeVar
* Add Vector3D typing in set_x, set_y and set_z
The "insert_n_curves_to_point_list" function requires the "points" argument to be a numpy array, since it calls the "get_bezier_tuples_from_points" function, which requires "points" to be a numpy array because it has the "return points.reshape((-1, nppc, 3))" statement. Ordinary lists do not have a "reshape" method.
So we need to convert "sp1" and "sp2" to numpy arrays before calling the "insert_n_curves_to_point_list" function.
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* Add config for pyupgrade
* Fix pyupgrade errors
* Unsafe-fixes
* Nicer way of formatting
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert "Nicer way of formatting"
This reverts commit 48013f4a30.
---------
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add shorthand for axes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add spacing
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* Convert CoordinateSystem example, and add to NumberLine
* Add doctest for NumberLine
* Add test
* Fix typehint for c2p
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
* pre-commit change to ruff
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixes
* astral-sh ruff bump
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Optimized AnimationGroup computation of start-end times with lag ratio
* Added extra comment for init_run_time
* Added full path to imports in composition.py
* Optimized AnimationGroup.interpolate
* Fixed final bugs
* Removed accidental print
* Final fix to AnimationGroup.interpolate
* Fixed animations being skipped unintentionally
* Fix and improve Mobject assertions when adding submobjects
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update examples in Mobject.add() and OpenGLMobject.add() docstrings
* overriden -> overridden
* Joined string in OpenGLMobject error message
* Address requested changes
* OpenGLVMObjects -> OpenGLVMobjects
* Use tuplify in VGroup.__setitem__()
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Optimized manim.utils.partial_bezier_points()
* Added split_bezier, subdivide_bezier and bezier_remap, and tests
* Use bezier_remap() in VMobject and OpenGLVMobject()
* Note that partial_bezier_points is similar to calling split_bezier twice
* Optimized manim.utils.bezier.is_closed()
* oops, that shouldn't have been there
* Slightly optimized is_closed() even more
* Added doctest for is_closed()
* Use --py39-plus in pre-commit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix indication.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added av as a dependency
* make partial movie files use av instead of piping to external ffmpeg
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* opengl rendering: use av for movie files
* no need to check for ffmpeg executable
* refactor: *_movie_pipe -> *_partial_movie_stream
* improve (oneline) documentation
* pass more options to partial movie file rendering
* move ffmpeg verbosity settings to config; renamed option dict
* replaced call to ffmpeg in combine_files by using av
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* there was one examples saved as a gif?
* chore(deps): re-order av
* chore(lib): simplify `write_frame` method
Reduces the overall code complexity
* chore(lib): add audio
* fix(lib): same issue for conversion
* fix(lib): webm export
* fix(lib): transparent export
Though the output video is weird
* try(lib): fix gif + TODOs
* chore(deps): lower dep crit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat(lib): add support for GIF
* fix(ci): rewrite tests
* fix
* chore(ci): prevent calling concat on empty list
* add missing dot
* fix(ci): update frame comparison ?
* fix(log): add handler to libav logger
* chore: add TODO
* fix(lib): concat issue
* Revert "fix(ci): update frame comparison ?"
This reverts commit 904cfb46ae.
* fix(ci): make it pass tests
* chore(lib/docs/ci): remove FFMPEG entirely
This removes any reference to FFMPEG, except in translation files
* added av as a dependency
* make partial movie files use av instead of piping to external ffmpeg
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* opengl rendering: use av for movie files
* no need to check for ffmpeg executable
* refactor: *_movie_pipe -> *_partial_movie_stream
* improve (oneline) documentation
* pass more options to partial movie file rendering
* move ffmpeg verbosity settings to config; renamed option dict
* replaced call to ffmpeg in combine_files by using av
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* there was one examples saved as a gif?
* chore(deps): re-order av
* chore(lib): simplify `write_frame` method
Reduces the overall code complexity
* chore(lib): add audio
* fix(lib): same issue for conversion
* fix(lib): webm export
* fix(lib): transparent export
Though the output video is weird
* try(lib): fix gif + TODOs
* chore(deps): lower dep crit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat(lib): add support for GIF
* fix(ci): rewrite tests
* fix
* chore(ci): prevent calling concat on empty list
* add missing dot
* fix(ci): update frame comparison ?
* fix(log): add handler to libav logger
* chore: add TODO
* fix(lib): concat issue
* Revert "fix(ci): update frame comparison ?"
This reverts commit 904cfb46ae.
* fix(ci): make it pass tests
* chore(lib/docs/ci): remove FFMPEG entirely
This removes any reference to FFMPEG, except in translation files
* chore(deps): update lockfile
* chore(lib): rewrite ffprobe
* fix typo
* slightly more aggressive removal of ffmpeg in docs; minor language changes
* fix gif output stream dimensions
* minor style change
* fix encoding of (transparent) mov files
* fixed metadata / comment
* set frame rate for --format=gif in output_stream
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* more video tests for different render settings, also test pix_fmt
* improve default bitrate setting via crf
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* parametrized format/transparency rendering test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* context managers for (some) av.open
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/utils/commands.py
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
* fixed segfault
* update test data involving implicit functions (output improved!)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* explicity set pix_fmt for transparent webms
* special-special case extracting frame from vp9-encoded file with transparency
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix transparent gifs, more special casing in parametrized video format test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* run tests on macos-latest again
* removed old control data
* Revert "run tests on macos-latest again"
This reverts commit f50efa4b88.
* added sound to codec test; fixed issue with sound track in gif (disabled) and webm (now via opus)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* manual wav -> ogg transcoding
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed f-string
* refactored codec test, split out gif
* check for non-zero audio samples
* more cleanup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove ffmpeg from readthedocs apt_packages
* round up run_time if positive and shorter than current frame rate
* added more run_time tests
* black
* improve implementation of test
* removed some unused imports
* improve wording of logged warning
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
* move run_time checks from Animation.begin to Scene.get_run_time
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove unused import
* flake: PT012
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
* typehint iterables
* organize typing hints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove any
* Add overloads for tuplify
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove example
* feedback
* Make TypeVars accessible at runtime
* Add hints for zip
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* typing -> collections.abc
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* try to make mypy happy
* zip[tuple[T, ...]] instead of zip[T]
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
* feat: Add animations that together simulate typing
AddTextLetterByLetterWithCursor
RemoveTextLetterByLetterWithCursor
Blink
* Revert "feat: Add animations that together simulate typing"
This reverts commit 5fe256880d.
* Revert "Revert "feat: Add animations that together simulate typing""
This reverts commit 6a8244a157.
* Add new animations to __all__
* Temporarily remove docs example
* Modify "Blink" and add docstring examples back in
To avoid 0-second animations, which fail docstring test
* Address requested changes
Fix imports
Remove redundant constructor arguments
Improve names
* Shorten names
* Optimized AnimationGroup computation of start-end times with lag ratio
* Added extra comment for init_run_time
* Added full path to imports in composition.py
* Optimized AnimationGroup.interpolate
* Fixed final bugs
* Removed accidental print
* Final fix to AnimationGroup.interpolate
* Fixed animations being skipped unintentionally
* Addressed requested changes
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add preview_command cli flag
* Edit help for --preview_command
* Change back from subprocess.run
* Remove old comment
* Bug with timg stopped happening with sp.run
* Fix docstring
* Revert "Fix docstring"
This reverts commit d2c00fc24dc46586f994237f1d2758528b78d6a3.
* Actually fix docstring
* Change help for option
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* suggestions from review on #3434
* [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>
* allow user-defined layout functions for Graph
+ fixup type annotations
* only pass relevant args
* write tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* change_layout forward root_vertex and partitions
- deduplicated layout code in __init__ and change_layout
- fixed change_layout backwards compatibility
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add test for change_layout
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix copy/paste error
* fix
* fixup types for CodeQL
* static type the Layout Names
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix dynamic union type for Python 3.9
* add example scenes to LayoutFunction protocol documentation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Replace references to np.ndarray with standard Manim types
* Label NxGraph as a TypeAlias
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Set SpiralIn to use fill_opacity 1 if not set
* Create SpiralIn control data
* Create test for SpiralIn
* Fix spiralin to separate fill and stroke opacity
* resolve opacity issue
* fix test data
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* fix put_start_and_end_on() at the same point
* [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>
* refactor(mobject): fix some typehints
* Move typing_extensions import under `if TYPE_CHECKING`
* Change from using `def animate(self: T ,...) -> T` to `def
animate(self, ...) -> Self` as stated in PEP 673
* Fix incorrect usage of `T` in a method
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* move updaters type alias into TYPE_CHECKING
* [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>
* Update documentation and typings for ParametricFunction
* Use manim tyings
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* fix typings
* a few doc fixes
* Update manim/mobject/graphing/functions.py
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update typings
* remove extraneous line
* update example code
* add line back for comptibility
* import TYPE_CHECKING
---------
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update typing guidelines
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix formatting
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* docs: improve installation FAQ's
* I have potentially resolved the issue when in LinearTransformationScene between two animations of transforming space we invoke the self.wait()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added another solutions in comments, added tests and removed wrong files from git
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* yeah , i forgot to save the file xd
* fixed the test, removed the comments my in changed file
* fix test and speed up test time for test_apply_matrix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed the test, removed the comments my in changed file
* fixed the test
* Revert "docs: improve installation FAQ's"
This reverts commit e53a1c8d6f.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
* Attempt to fix windows test
* Revert "Attempt to fix windows test"
This reverts commit e31c2077cd.
* try a different fix
* maybe both fixes together?
* try adding in CI
* Update ci.yml
* Update logger_utils.py
* maybe needs a dash?
* try utf8 again
* Remove legacy_windows
* try changing test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Try decoding after capturing bytes output
* Nicer fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix typehint of Vector
* Change from Vector to Point in typehint
In `TipableVMobject._pointify` it converts a 3D
list of the form [x, y, z] to a Vector3D. Therefore
the direction parameter can take lists, not just numpy arrays.
* Add examples to mobject+vmobject methods
* Add missing import
* Separate whitespace to point_from_proportion
* Fixes!
* Changed example of Mobject.get_color
* Remove unneccessary import
* Add in import
* Copied ndarray for rgbas when interpolating
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changing .become to copy the target mobject
* change tests and test data to reflect .become new behavior
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tests/test_graphical_units/test_mobjects.py
* removed unused copy_submobject kwarg
* added doctests and improved documentation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Remove unused import
* More security fixes
* Remove unused global variable
* More fixes
* Revert change (actual fix would require some rewrite)
* Add exception for edge case to satisfy warning
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Stuff
* [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>
* Remove call to deprecated `pkg_resources`
* Remove support for dynamic plugin imports, update plugin utilities
* fix affected tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* more fixes
* Last fix
* Fix import
* Update docs
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
The proposed fix does two things :
* If the specified font is 'sans-serif' : change it to 'sans' as this is the name used in the list of fonts
* if the font name is not in the list of fonts, automatically check if the capitalized version of the font exists in the list of fonts. If not, print a warning to the user.
* Refactor `TexTemplate`
* Add tests, refactor some things
* Fixed Some tests
* Move typing imports
* Fix remaining tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* exception add if new_rings is none
* [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>
* Improve VGroup creation error message
* Use .__name__ for the type
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
---------
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
* Improve section in docs about contributing to docs
* Add note about doc build command depending on the OS
* Improve section in docs about contributing to docs
* Add note about doc build command depending on the OS
* Fix wrong toctree path in docs/source/contributing/docs.rst
* Updated manim.typing and included TypeAliases in docs.source.conf
* Added Vector2 and reorganized manim_type_aliases
* Fixed __all__ exports for __all__ of manim
* Update manim/cli/render/global_options.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Draft of new typing docs and new autotyping directive
* Changed vertical bars to Unions
* Updated poetry.lock
* Created custom file parser for manim.typing
* Got reST parser going
* Updated autotyping and parsing
* Update parsing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added code_block toggle
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added typings to directives
* Renamed Tuple to tuple in manim.typings
* Added missing docs for type aliases
* Fixed exponent typo in ManimInt
* Hyperlinks to types work - removed Module Attributes section
* Removed Unused Import
Remove ``import re``
* Added freeglut-devel to workflows for Linux
Hopefully (?) fix the GLU import error
* Fix package name
* Add support for Type Aliases section in every module - Renaming of Vector types
* Add/fix docs for directive, parser and others
* Fixed alias typo in module_parsing
* Fix decode/import bugs, fix minor details in docs
* Added missing docs for utils.docbuild and utils.testing
* Sort alphabetically entries in utilities_misc.rst
* Address review comments, add notes about Vector and hyperlinks inside definition blocks
---------
Co-authored-by: MrDiver <mrdiverlp@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
* adding the ability to pass lists and generators to .play()
* fix for _AnimationBuilder
* Changed handling of generators to accept lists of generators and normal arguments at the same time
* Animation group handles generators
* Refactored into own function for reusability
* Fix typing
* Fix typing
---------
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
* Added docstrings and example renders to Mobject.to_corner() and Mobject.to_edge
* Added docstrings and example renders to Mobject.to_corner() and Mobject.to_edge
* Update manim/mobject/mobject.py
* Update manim/mobject/mobject.py
* Update manim/mobject/mobject.py
* Update manim/mobject/mobject.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/mobject/mobject.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fixed the stroke width issue with single color in streamlines
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added test for streamlines
* Added test for streamlines
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: MrDiver <mrdiverlp@gmail.com>
* Fix animation group not erroring when instantiated with an empty list
* Move error messages into Animation.begin()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/animation/animation.py
* Update manim/animation/composition.py
* Update manim/animation/animation.py
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
* Import for both vertical and horizontal gridlines in
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix(lib): fix
This fixes an issue where the `invert` argument would only work for `uint8` dtypes. Now the `max` value is updated according to the pixel array dtype.
Maybe we should add unit tests for that, but haven't found an obvious place to put unit tests.
* chore(ci): add basic test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix(ci): wrong attr name
* Update tests/module/mobject/test_image.py
---------
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>
* Fix formatting building blocks
* Fix formatting building blocks
---------
Co-authored-by: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com>
* Explained ReplacementTransform vs Transform
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added section explaining Transform vs ReplacementTransform
* Added a->b->c example
* Clarified explanation
* Fixed Typo
* Fixed missing colon
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
* Worked on issue 3471, fixing rendered file names to inherit section name
* Modified file name to include section number and name
* Modified tests for file names to include number and name, in order to pass
---------
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
* feat(cli): optionally hide version splash
As discussed in #3326, this PR proposes a new optional flag to hide the version splash when manim command in launched. Additionally, the splash print is now inly executed when the CLI is executed, not on module import.
After looking at the current documentation, it does not seem to change anything. I only saw that you documented a version splash for when the CLI is used, but not when the module is imported. So removing it should not break the api docs.
In the future, users can still have version information with `import manim; print(manim.__version__)`.
Closes#3326
* chore(tests): make tests pass
---------
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
* Added cap_style feature to VMobject
* Added an example to `set_cap_style` method
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Unsplitted line 2501
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added graphical test for cap_style
* Added vmobject_cap_styles.npz for testing cap_styles
* Removed # noqa comments from vectorized_mobject.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* WIP: Update metadata
* Finish removing upper bounds
Drop requests dependency, use urllib instead
order depencencies
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix issues on 3.12
* Order dev dependencies
* Update most dev deps, update lint config
* Add missing import
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* trigger CI
* More deprecation fixes
* Missing argument
* Deprecation fixes, again
* Use older xdist to fix test flakyness
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added cross and optimized get_unit_normal in manim.utils.space_ops
* Added missing border case to new get_unit_normal where one vector is nonzero
* Updated test_threed.py::test_Sphere test data
* Add type hints to `_config`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix call issues
* Fix wrong value being used
* Fix test
* Fix wrong value being set
* lint
* Few type fixes
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix CSV reader adding empty files
Fixes issue #3311
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added LinearTransformationScene.ghost_vectors
* Added test and prevented empty VGroups as ghost vectors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed typo in example
* Added ability to join together multiple renders
* Revert "Added ability to join together multiple renders" (wrong branch)
This reverts commit dee29c390f.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* generated changelog and bumped version
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changed some PR descriptions in the changelog
* fix some docbuild warnings
* fixed a reference that became ambiguous
* copyedit pass of changelog
* some more changelog polishing
* bump release date
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* updated release date
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add option to run examples directly with binder
The minified JS is from
https://github.com/naveen521kk/manim-binder
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* slight style changes
* update the js file to fix on chrome
Signed-off-by: Naveen M K <naveen521kk@gmail.com>
* show the run button as an cursor
* make the video to be 100% of the width
* Update manim/utils/docbuild/manim_directive.py
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add a "Make interactive" button instead of "Run" button
Clicking on the "Make interactive" button show the code-editor and "run" button
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update margin for run interactive button
---------
Signed-off-by: Naveen M K <naveen521kk@gmail.com>
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>
* Added ability to remove latex junk (default True)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed tests (hopefully), and whitelisted .tex
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* reverted weird changes from merge
* See previous commit message
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed logs-too-long test
* Fixed log output
* Fixed typo ;)
* deleted unused variable
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* moved latex deletion to tex_file_writing.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* removed changes in scene files
* Added caching based on LaTeX expression .svg
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Deleted unused function in delete_old_tex
* make if condition more readable
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* cleaned up svg file check
* changed blacklist -> whitelist for file endings
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Reverted docstring change
* Updated delete_non_svg files docstring
* Changed list to a set
* Update manim/_config/utils.py
* Update manim/cli/render/global_options.py
* added one test for the no_latex_cleanup config option
---------
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>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
* fix: fix an issue with ImageMobject bounding box
A missing point resulted in smaller bounding box causing issues it to be
smaller when the object is rotated. Added the missing fourth point to
ImageMobject points and altered call from camera. Filled in docstring
that used to propagate from superclass, saying that ImageMobject has no
points.
* add a test to check that rotating an image to and from doesn't change it
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Václav Blažej <vaclav.blazej@warwick.ac.uk>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* first draft of color class + starting library conversion
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changed everything to Manim color todo: figure out circular dependency in utils
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* first working draft of new color version
* resolving conflicts
* resolving conflicts
* resolving conflicts
* resolving conflicts
* resolving conflicts
* changed default internal value of ManimColor to np.ndarray[float]
* starting to fix tests
* fixed more tests and changed precision of manim color
* removed premature color conversion
* fixed some more tests
* final test changes
* fix doctests
* fix for 3.8
* fixing ManimColor string representation
* removing some unneccesary conversions
* moved community constants to manim_colors.py and added more color standards
* Added typing.py and typed bezier.py, core.py, constants.py fully
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed codeql complaints
* add type ignore for np.allclose
* fixed import in three_dimensions
* added ignore for F401 back again in flake
* added typings to coordinate_systems.py
* Few improvements to `graphing/coordinate_systems.py`
* added some typings to mobject/geometry/line.py
* updated typings for mobject/geometry/line.py
* Add missing imports to `line.py`
* added typings to three_dimensions.py
* Use `FunctionOverride` for animation overrides
Fix type signature of `set_color_by_gradient`
* Remove `TYPE_CHECKING` check
Doc is failing
* Revert "Remove `TYPE_CHECKING` check"
Fails due to circular import
* Use `Self` in `coordinate_systems.py`
* Typehinted mobject.py and updated manim.typing.py
* Typed VMobject
* Type-hinted manim.mobject.geometry
* math.cos->np.cos, etc & fixed incorrect typehints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix missing annotations import
* TypeAlias fix in typing.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add ignore errors again to mypy because commits are not possible like this
* Fix last typing issues
* Update docs
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Only type check manim
* Try fixing pre-commit
* fix merge
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix compat
* Fix compat again
* Fix imports compat
* Use union syntax
* Use union syntax
* Fix reduce_across_dimension
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Various test and merge fixes
* Doc fixes
* Last doc fix
* Revert usage of np over math
* Bump numpy version
* Remove obsolete duplicate example
* Fixed Incorrect Typehint in manim.constants
* Fix docstring typo
* More fixes
Use mypy.ini instead of .mypy.ini
Fix more docstrings
Improve types in utils and constants
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* docs fixes
* Add internal aliases
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix compat
* line lengths in .rst file, formatting, typos
* add docstring for space_ops:cross2d
* add some more arrow tip typings (in a non-circular import causing way)
* yes, this can be deleted
* fix formatting of example
* added docstring to bezier::inverse_interpolation
* added docstring + test for bezier::match_interpolate
* some improvements in coordinate_systems
* Vector -> Vector3
* replaced np.ndarray with more appropriate type hints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply feedback
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* revert to previous (new) version
* fix doctest
* fix ReST errors
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Lembcke <alex.lembcke@gmail.com>
Co-authored-by: Viicos <65306057+Viicos@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Fix None check order in _tree_layout
* add tests to test_graph.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* do not add a VectorizedPoint as a submobject if SingleStringMathTex renders to empty SVG
* test new behavior
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tests/module/mobject/text/test_texmobject.py
* Update tests/module/mobject/text/test_texmobject.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Misc: Just a class to test out some functions
* Fix: Fixed a bug in AddTextLetterByLetter class
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix: Adjusted changes according to Ben's comments
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix: Removed imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Feat: Adjusted changes to AddTextLetterByLetter
* Feat: Added test_creation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Add a script to build and install cairo
* Update gui tests for cairo 1.18.0
* update script to set env vars
* Make the script run with plain python
* Prefer the recently built one in pkg-config
* Skip the built if it's windows
* CI: build and install latest cairo
* CI: only run when cache is missed
* Disable compiling tests while building cairo
* update poetry lock file
* Display the cairo version when running pytest
* fixup
* tests: skip graphical test when cairo is old
* fix the path to find the pkgconfig files on linux
* set the LD_LIBRARY_PATH too
only then it'll work on linux
* fixup
* small fixup
* Move the script inside `.github/scripts` folder
* Make the minimum cairo version a constant
* Seperate setting env vars to a sperate step
this seem to have broken when cache is hit
* Added docs for functions in mobject_update_utils
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated docstring of always_shift
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Added period to sentence.
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Updated parameter description in always_redraw
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Update always_rotate description
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Finished parameters in always_redraw
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Changed comment in always_shift
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* update always_shift description
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* used normalize from manim.utils.space_ops
* fixed indentation in always_redraw
* added type-hints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* use np.isclose for float equality in number line elongated ticks
* use offsets relative to x_min to tell if we need to elongate a tick
* forgot to subtract to create list of offsets
* add test for elongated ticks float equality
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove unused import
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Unlike similar methods on other objects .add_to_preamble and
.add_to_document do not return the TexTemplate object itself.
This does not allow for stacking these methods.
Just added the `return self` for both methods
Co-authored-by: Uwe Zimmermann <C:\Users\uwezi\AppData\Roaming\The Bat! Pwd>
* first draft of color class + starting library conversion
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changed everything to Manim color todo: figure out circular dependency in utils
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* first working draft of new color version
* resolving conflicts
* resolving conflicts
* resolving conflicts
* resolving conflicts
* resolving conflicts
* changed default internal value of ManimColor to np.ndarray[float]
* starting to fix tests
* fixed more tests and changed precision of manim color
* removed premature color conversion
* fixed some more tests
* final test changes
* fix doctests
* fix for 3.8
* fixing ManimColor string representation
* removing some unneccesary conversions
* moved community constants to manim_colors.py and added more color standards
* broke some too long lines
* added fallback: check whether passed object has get_hex method
* actually fix _internal_from_string
* added hsv support
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove dependency on colour
* fixed DARK_EARTH being assigned twice
* fixed double assignment
* remove more duplicated colour names
* raise NotImplementedError for ManimColor.gradient
* removed unused import
* remove superfluous ManimColor import
* fix circular import, remove dependency of space_ops on config
* one more Color -> ParseableManimColor
* removed one *-import
* somewhat unrelated fixed type hint
* -1 *-import
* fixed change of logic in CoordinateSystem.get_graph_label
* removed debug print; fixed type hint in mobject.py
* some fixes and improvements to text_mobject.py
* update three_dimensions
* fixes for rendered documentation of utils.color.*
* substantial improvements to documentation, including new Sphinx directive
Co-authored-by: MrDiver <mrdiverlp@gmail.com>
* Rewrite of the sphinx directive to use docutils nodes and 2 column design
* I just had to do it
* Improve the color table
* minor cleanup
* fixed ColorOverview example
* documentation improvements
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/mobject/mobject.py
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix flake8 errors
* Removed test in test_text_mobject
* Improved Documentation of core.py and added private members in sphinx so that internal methods can be documented
* Change color types of labeled.py
* removed some unused imports
* turned docstring into comment
* _colors -> _all_manim_colors; move to manim_color module
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed typing
* rewrite import
---------
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>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
* Added docstring & example for always_redraw
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* made more descriptive names for vars in example
* Change runtime 10s->3s
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* change Create -> add
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Added typehint for always_redraw
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Changed description of :meth:`always_redraw`
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Added return type to :meth:`always_redraw`
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* added new checkhealth subcommand
* basic checkhealth tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* check -> healthcheck
* more helpful test output on checkhealth fail
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* callable -> Callable
* fix executable check for windows
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed type
* shutil already returns .exe in case it is there
* debug commit ...
* do proper debug commit for windows ...
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix failing test if executable is batch file
* added more helpful (?) recommendations on failed tests
* allow rendering ManimBanner from prerendered SVG path
* improved test scene, actually test text / latex
* added debug info on python executable
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove debug test again
* move SCALE_FACTOR_PER_FONT_POINT to constants
* access constants via module in logo.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* replaced other occurrence of 48 / 960
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fixed IPython sqlite errors/history for interactive_embed scenes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add config to instance method
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
* feat: added two new classes LabeledLine and LabeledArrow
* test: added tests for new LabeledLine and LabeledArrow for the geometry module testing suite
* feat: added new class names to '__all__' module attribute
* fix: added missing import line for new classes
* fix: removed import lines causing cyclic import error
* new file containing two new classes
* modified files to correctly load new classes when manim is imported
* commented out new classes in line.py
* created control frames for LabeledLine and LabeledArrow
* removed commented out classes
* removed unused import of 'Colors'
* Update manim/mobject/geometry/labeled_shapes.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Update manim/mobject/geometry/labeled_shapes.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Update manim/mobject/geometry/labeled_shapes.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Update manim/mobject/geometry/labeled_shapes.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update __init__.py
will change name of labeled_shapes.py to labeled.py
* Rename labeled_shapes.py to labeled.py
* Update __init__.py
Changed name of file from labeled_shapes.py to labeled.py and updated __init__.py to import from the correct location.
* Update manim/mobject/geometry/labeled.py
Removed color import line because of redundancy.
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Update labeled.py
default label_color parameter is now set to `None` instead of `WHITE`.
* Update manim/mobject/geometry/labeled.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Update tests/test_graphical_units/test_geometry.py
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
* Revert changes related to WHITE and it's import
SurroundingRectangle uses label_color as well and using a default of None removes the rectangle.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Optimized Axes.coords_to_point
* Changed variable name to are_coordinates_transposed and added more commentaries
* Added some commas to the tuple in the last comment in Axes.coords_to_pointC
* fix: prevent vector position array from being modified (#3273)
changed from np.asarray(point) to nd.array(point) in order
to make sure that a copy of the array is created even if func
is the identity function lambda pos: pos
* fix: using the example for LinearTransformationScene in Jupyter notebooks
The Manim magic in Jupyter notebooks adds a "renderer=" parameter to the
__init__ call of the scene, but in its current form the example scene
LinearTransformationSceneExample does not accept any **kwargs and thus creates
an exception.
Added the handling of **kwargs in the example scene.
---------
Co-authored-by: Uwe Zimmermann <C:\Users\uwezi\AppData\Roaming\The Bat! Pwd>
changed from np.asarray(point) to nd.array(point) in order
to make sure that a copy of the array is created even if func
is the identity function lambda pos: pos
Co-authored-by: Uwe Zimmermann <C:\Users\uwezi\AppData\Roaming\The Bat! Pwd>
* Small fix in the code of ArcBrace
Avoiding the creation of an Arc object at import time
* Replace last `os.path` occurrencies by `pathlib` (#3224)
This resolves [last
comment](https://github.com/ManimCommunity/manim/issues/485#issuecomment-1523016291)
of #485.
Removes one line of dead code.
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Made docbuild errors easier to debug + fixed error from changed exception class (#3229)
* Make errors during docbuild somewhat easier to debug
* fix an issue with docbuild under py3.10+
* Make set_resampling_algorithm() return self
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Adrien ANTON LUDWIG <42720099+Adrien-ANTON-LUDWIG@users.noreply.github.com>
* documentation: require urllib3<2.0 for now
* moved version requirement to main library in pyproject.toml
* constraint needed in both?
* try upgrading to docbuild with python 3.10, remove restriction on urllib3
* change image -> os
* fixed rtd config
* explicitly added graphviz
---------
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
* rewrite some list comprehensions as generator expressions
* fixed flake's docstring warnings
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* one more generator expression in tests/
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Instead set it through super object init method.
For some reason, on OpenGL renderer `stroke_width` is needed
as a different type, rather than an integer as in Cairo renderer.
To avoid problems, set `stroke_width` while calling super's
init method.
This is new feature of `sphinxext-opengraph` which will automatically
generate social cards for the documentation. This is a new feature and
it is not enabled is there is a custom `ogp_image` defined, which we
do. Remove it and also make sure it adds our logo to the social cards.
* generated changelog for v0.17.3, first pass
* bump version number
* fixed python version in classifier list
* regenerated changelog, second pass
* changelog generation, final pass
* fixed docbuild warning
* [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 and improve formatting of replace docstring
* replace assert statements by ValueError
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed ValueError message
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added new tip class: StealthTip
* let NumberLine propagate tip_shape properly
* documentation, tests
* black
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed type hint, added some more documentation.
* black
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove unused import
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Make triangle arrow tips accessible
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
In the docs the winget command to install MiKTeX was changed from `winget install ChristianSchenk.MiKTeX` to `winget install MiKTeX.MiKTeX`. I have changed the docs to reflect this change. Here is the link to the manifest on the winget repo. I have also attached an image that shows the original command not working and an image of the new command working.
Winget Repo Link: https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/MiKTeX/MiKTeX
New command working: https://imgur.com/D7qp6kU
Image of old command not working: https://imgur.com/k7Pvpp0
* Improve creation time for large Text Mobjects
* space
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Check before last point
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* markup text also
* handle quads for open GL
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update comments
---------
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>
* Add assertion if font is not found for Text, Code, and MarkupText
This adds tests for this behavior and makes sure that if a font is registered via register_font, the assertions work correctly.
If a font is not specified, we do not assert, as this will cause Manim to use a default font.
Some tests needed to be updated to use cross-platform font names. Monospace and Sans are found on both my Windows and Linux environment, so that seems like a reasonable thing to try.
* Reformat
* Testing register_font fails for unknown reasons on CI - remove it
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Make assertion a warning
* Fix missing warn
* Don't warn on default font
* let Code use test_mobject logic for missing font warning
* Update manim/mobject/text/code_mobject.py
---------
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>
* Added MathTex.set_opacity_by_tex and MathTex.fade_all_but_tex
* Completed unittests for set_opacity_by_tex and fade_all_but_tex
* Added control_data for `fade_all_but_tex` and `set_opacity_by_tex`
* Removed ade_all_but_tex and integrated functionality into set_opacity_by_tex. Included a second parameter 'remaining_opacity' to define the opacity value of the remaining tex
* Added type hints for `set_opacity_by_tex`. Removed type information in docstring. Improved logic of `set_opacity_by_tex` to reduce redundant calls for tex parts
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* feat(Polygram.round_corners): add support for individualized radius values
* Update manim/mobject/geometry/polygram.py
Remove type hints from the docstring of round_corners()
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Update rounded_corners() so that integer values are accepted
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* Speed up width/height/depth by reducing copying
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix test
* fix example and improve tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* typo
* np.max/min is 2x slower than max/min
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Reduce memory allocations when building SVGMobject
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* split two quads
* fix shape
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* assign
* Fix lines
* Add some tests and fix extra lineto
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Appease assertion CQ check
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix: BraceLabel not passing **kwargs to Brace
* create an empty dict if brace_config is None
* added typehints and included comments made
* added missing type hints in BraceLabel.__init__
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed docstring indentation
* remove superfluous import
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Allow to use call_updater=True with a function without dt
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fixed behavior of stop_condition in Wait
* updated documentation to reflect actual behavior of wait_until etc
* added test for Wait with stop_condition and Scene.wait_until
* [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>
* Add scene.replace() and use in ReplacementTransform
This replace method allows one mobject to take the place (that is,
the draw order) of another mobject.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Address Feedback
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update visual Replacement test and fix extract_frames.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* allow flake8 to be unhappy
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>
* Convert docstring param type to type-hint in three_dimensions.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- [ ] I have checked the [troubleshooting page](https://docs.manim.community/en/stable/installation/troubleshooting.html) and my problem is either not mentioned there,
- [ ] I have checked the [installation FAQ](https://docs.manim.community/en/stable/faq/installation.html) and my problem is either not mentioned there,
or the solution given there does not help.
## Description of error
@ -53,14 +53,5 @@ PASTE HERE
<!-- output of `tlmgr list --only-installed` for TeX Live or a screenshot of the Packages page for MikTeX -->
</details>
<details><summary>FFMPEG</summary>
Output of `ffmpeg -version`:
```
PASTE HERE
```
</details>
## Additional comments
<!-- Add further context that you think might be relevant for this issue here. -->
<!-- Thank you for contributing to Manim! Learn more about the process in our contributing guidelines: https://docs.manim.community/en/latest/contributing.html -->
## Overview: What does this pull request change?
<!-- If there is more information than the PR title that should be added to our release changelog, add it in the following changelog section. This is optional, but recommended for larger pull requests. -->
<!--changelog-start-->
<!--changelog-end-->
## Motivation and Explanation: Why and how do your changes improve the library?
<!-- Optional for bugfixes, small enhancements, and documentation-related PRs. Otherwise, please give a short reasoning for your changes. -->
message: "We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work."
@ -152,6 +152,7 @@ Examples of conflicts of interest include:
* The reporter or reported person is a maintainer who regularly reviews your contributions
* The reporter or reported person is your metamour.
* The reporter or reported person is your family member
Committee members do not need to state why they have a conflict of interest, only that one exists. Other team members should not ask why the person has a conflict of interest.
Anyone who has a conflict of interest will remove themselves from the discussion of the incident, and recluse themselves from voting on a response to the report.
Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as demonstrated in the videos of [3Blue1Brown](https://www.3blue1brown.com/).
> NOTE: This repository is maintained by the Manim Community and is not associated with Grant Sanderson or 3Blue1Brown in any way (although we are definitely indebted to him for providing his work to the world). If you would like to study how Grant makes his videos, head over to his repository ([3b1b/manim](https://github.com/3b1b/manim)). This fork is updated more frequently than his, and it's recommended to use this fork if you'd like to use Manim for your own projects.
> [!NOTE]
> The community edition of Manim (ManimCE) is a version maintained and developed by the community. It was forked from 3b1b/manim, a tool originally created and open-sourced by Grant Sanderson, also creator of the 3Blue1Brown educational math videos. While Grant Sanderson continues to maintain his own repository, we recommend this version for its continued development, improved features, enhanced documentation, and more active community-driven maintenance. If you would like to study how Grant makes his videos, head over to his repository ([3b1b/manim](https://github.com/3b1b/manim)).
## Table of Contents:
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Docker](#docker)
- [Help with Manim](#help-with-manim)
- [Contributing](#contributing)
- [License](#license)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Docker](#docker)
- [Help with Manim](#help-with-manim)
- [Contributing](#contributing)
- [License](#license)
## Installation
> **WARNING:** These instructions are for the community version _only_. Trying to use these instructions to install [3b1b/manim](https://github.com/3b1b/manim) or instructions there to install this version will cause problems. Read [this](https://docs.manim.community/en/stable/faq/installation.html#why-are-there-different-versions-of-manim) and decide which version you wish to install, then only follow the instructions for your desired version.
> [!CAUTION]
> These instructions are for the community version _only_. Trying to use these instructions to install [3b1b/manim](https://github.com/3b1b/manim) or instructions there to install this version will cause problems. Read [this](https://docs.manim.community/en/stable/faq/installation.html#why-are-there-different-versions-of-manim) and decide which version you wish to install, then only follow the instructions for your desired version.
Manim requires a few dependencies that must be installed prior to using it. If you
want to try it out first before installing it locally, you can do so
@ -88,9 +88,9 @@ The `-p` flag in the command above is for previewing, meaning the video file wil
Some other useful flags include:
-`-s` to skip to the end and just show the final frame.
-`-n <number>` to skip ahead to the `n`'th animation of a scene.
-`-f` show the file in the file browser.
- `-s` to skip to the end and just show the final frame.
- `-n <number>` to skip ahead to the `n`'th animation of a scene.
- `-f` show the file in the file browser.
For a thorough list of command line arguments, visit the [documentation](https://docs.manim.community/en/stable/guides/configuration.html).
@ -118,8 +118,8 @@ The contribution guide may become outdated quickly; we highly recommend joining
[Discord server](https://www.manim.community/discord/) to discuss any potential
contributions and keep up to date with the latest developments.
Most developers on the project use `poetry` for management. You'll want to have poetry installed and available in your environment.
Learn more about `poetry` at its [documentation](https://python-poetry.org/docs/) and find out how to install manim with poetry at the [manim dev-installation guide](https://docs.manim.community/en/stable/contributing/development.html) in the manim documentation.
Most developers on the project use `uv` for management. You'll want to have uv installed and available in your environment.
Learn more about `uv` at its [documentation](https://docs.astral.sh/uv/) and find out how to install manim with uv at the [manim dev-installation guide](https://docs.manim.community/en/latest/contributing/development.html) in the manim documentation.
@ -202,7 +202,7 @@ msgid "This ``Scene`` illustrates the quirks of ``.animate``. When using ``.anim
msgstr ""
#: ../../source/tutorials/quickstart.rst:344
msgid "In ``DifferentRotations``, the difference between ``.animate``'s interpretation of rotation and the ``Rotate`` method is far more apparent. The starting and ending states of a ``Mobject`` rotated 360 degrees are the same, so ``.animate`` tries to interpolate two identical objects and the result is the left square. If you find that your own usage of ``.animate`` is causing similar unwanted behavior, consider using conventional animation methods like the right square, which uses ``Rotate``."
msgid "In ``DifferentRotations``, the difference between ``.animate``'s interpretation of rotation and the ``Rotate`` method is far more apparent. The starting and ending states of a ``Mobject`` rotated 180 degrees are the same, so ``.animate`` tries to interpolate two identical objects and the result is the left square. If you find that your own usage of ``.animate`` is causing similar unwanted behavior, consider using conventional animation methods like the right square, which uses ``Rotate``."
* Introduce seed in `random_color` method to produce colors deterministically by {user}`ishu9bansal` in {pr}`4265`
* Add support for arithmetic operators `//`, `%`, `*`, `**` and `/` on `ValueTracker` by {user}`fmuenkel` in {pr}`4351`
* Add `TangentialArc` mobject by {user}`Brainsucker92` in {pr}`4469`
### Fixed Bugs and Enhancements
* Fix environment formatting for Tex() mobject by {user}`fmuenkel` in {pr}`4159`
* Improved consistency of rate_function implementations by {user}`BenKirkels` in {pr}`4144`
* Make new `Code` mobject compatible with OpenGL renderer by {user}`behackl` in {pr}`4164`
* Fix HSL color ordering in ManimColor by {user}`thehugwizard` in {pr}`4202`
* Fix return type of `Polygram.get_vertex_groups()` and rename variables in `.round_corners()` by {user}`chopan050` in {pr}`4063`
* Improve `Mobject.align_data` docstring by {user}`irvanalhaq9` in {pr}`4152`
* Fix :meth:`VMobject.pointwise_become_partial` failing when `vmobject` is `self` by {user}`irvanalhaq9` in {pr}`4193`
* Fix `add_points_as_corners` not connecting single point to existing path by {user}`irvanalhaq9` in {pr}`4219`
* Complete typing for logger_utils.py by {user}`fmuenkel` in {pr}`4134`
* Fix(graph): Allow any Line subclass as edge_type in Graph/DiGraph by {user}`Akshat-Mishra-py` in {pr}`4251`
* Replace exceptions, remove unused parameters, and fix type hints in `Animation`, `ShowPartial`, `Create`, `ShowPassingFlash`, and `DrawBorderThenFill` by {user}`irvanalhaq9` in {pr}`4214`
* Fix: `Axes` submobject colors are not being set properly by {user}`ishu9bansal` in {pr}`4291`
* Refactor `Rotating` and add docstrings to `Mobject.rotate()` and `Rotating` by {user}`irvanalhaq9` in {pr}`4147`
* Fix default config of `manim init project` to use correct `pixel_height` and `pixel_width` by {user}`StevenH34` in {pr}`4213`
* Handle opacity and transparent images by {user}`henrikmidtiby` in {pr}`4313`
* Gracefully fall back when version metadata is missing by {user}`mohiuddin-khan-shiam` in {pr}`4324`
* Fix for issue 4255 - Do not clear points when the number of curves is zero by {user}`henrikmidtiby` in {pr}`4320`
* Use utf-8 encoding to read generated .tex files. by {user}`OliverStrait` in {pr}`4334`
* Add zero to vmobject points to remove negative zeros in `get_mobject_key` by {user}`elshorbagyx` in {pr}`4332`
* Ensure `stroke_width` attribute of `SVGMobject` is not set to `None` by {user}`henrikmidtiby` in {pr}`4319`
* Fix `Prism` incorrectly rendering with `dimensions=[2, 2, 2]` in OpenGL by {user}`ra1u` in {pr}`4003`
* Fix `BraceLabel.change_label()` and document `BraceText` by {user}`henrikmidtiby` in {pr}`4347`
* Include `Text.gradient` in hash to properly regenerate `Text` when its gradient changes by {user}`AbhilashaTandon` in {pr}`4099`
* Fixed surface animations in OpenGL by {user}`nubDotDev` in {pr}`4286`
* Add type hints and support for arithmetic operators `+` and `-` on `ValueTracker` by {user}`fmuenkel` in {pr}`4129`
* Fix duplicate references in `Scene.mobjects` after `ReplacementTransform` with existing target mobject by {user}`irvanalhaq9` in {pr}`4242`
* Optimize `always_redraw()` by reducing `Mobject` copying in `Mobject.become()` by {user}`chopan050` in {pr}`4357`
* Enhance `manim cfg show` output and add info-level logging for config files read by {user}`xnov18` in {pr}`4375`
* Let `Cube` use Bevel type line joints by {user}`nubDotDev` in {pr}`4361`
* Properly define `init_points` methods for use in OpenGL instead of defining `init_points = generate_points` by {user}`chopan050` in {pr}`4360`
* Allow passing a tuple to `buff` in `SurroundingRectangle` to specify buffer in x and y direction independently by {user}`nubDotDev` in {pr}`4390`
* Rewrite `color_gradient` to always return a list of ManimColors by {user}`henrikmidtiby` in {pr}`4380`
* Ensure leading whitespace does not change line height for lines in CodeMobject by {user}`behackl` in {pr}`4392`
* Simplify the function `remove_invisible_chars` in `text_mobject.py` by {user}`henrikmidtiby` in {pr}`4394`
* Fix some config options specified via `--config_file` not being respected properly by {user}`behackl` in {pr}`4401`
* Fix: Correct resolution tuple order to (height, width) by {user}`Nikhil172913832` in {pr}`4440`
* Ensure that start and end points are stored as float values in Line3D by {user}`SirJamesClarkMaxwell` in {pr}`4080`
* OpenGL: Fix iterated nesting in `DecimalNumber.set_value` by {user}`henrikmidtiby` in {pr}`4373`
* Update default resolution in CLI to match Manim’s 1920x1080 default settings by {user}`SASHAKT1290` in {pr}`4452`
* Better parsing of color styles in CodeMobject by {user}`SirJamesClarkMaxwell` in {pr}`4454`
* Allow selection of all scenes to render using '*' by {user}`NightyStudios` in {pr}`4470`
* Prevent mutation of `about_point` in `apply_points_function_about_point` by {user}`Morkunas` in {pr}`4478`
* Fix behavior of `Mobject.suspend_updating`: when only suspending parent mobject, let children continue updating by {user}`behackl` in {pr}`4402`
* Allow passing a `buff` to `LabeledDot` by {user}`nubDotDev` in {pr}`4403`
* Pass ndarrays to `mapbox_earcut.triangulate_float32()` to fix `TypeError` in `mapbox_earcut==2.0.0` by {user}`GuiCT` in {pr}`4479`
* Fix duplicated arrow tips in DashedVMobject (issue #3220) by {user}`jakekinchen` in {pr}`4484`
### Documentation
* Add docstring to :meth:`.Mobject.get_family` by {user}`irvanalhaq9` in {pr}`4127`
* Fix link formatting and clarify the distinction between Manim versions in index.rst by {user}`irvanalhaq9` in {pr}`4131`
* Add instructions for installing system utilities `cairo` and `pkg-config` via Homebrew on MacOS by {user}`behackl` in {pr}`4146`
* Add missing line break in Code of Conduct's conflict of interest policy by {user}`Hasan-Mesbaul-Ali-Taher` in {pr}`4185`
* Fix links to Pango website by {user}`ragibson` in {pr}`4217`
* Replace poetry with uv in the README by {user}`xinoehp512` in {pr}`4226`
* Improve docstring for `interpolate` method in `Mobject` class by {user}`irvanalhaq9` in {pr}`4149`
* Add docstrings to `Line` and remove `None` handling for `path_arc` parameter by {user}`irvanalhaq9` in {pr}`4223`
* Add docstring to :meth:`Mobject.family_members_with_points` by {user}`irvanalhaq9` in {pr}`4128`
* Update incorrect docstring for :attr:`ManimConfig.gui_location` property by {user}`SAYAN02-DEV` in {pr}`4254`
* Fix formatting of color space documentation by {user}`behackl` in {pr}`4274`
* Enhance and Paraphrase Description of ManimCE in README.md by {user}`irvanalhaq9` in {pr}`4141`
* docs: add explanation about the rate_func in the custom animation by {user}`pedropxoto` in {pr}`4278`
* Fixed artifact in docstring of Animation by {user}`barollet` in {pr}`4283`
* Rename update function `dot_position` to `update_label` in `.add_updater` example by {user}`irvanalhaq9` in {pr}`4196`
* Fix Microsoft typo in `TexFontTemplateLibrary` scene in `example_scenes/advanced_tex_fonts.py` by {user}`alterdim` in {pr}`4305`
* Improved readability, grammar, as well as added docstrings for consistency by {user}`NASAnerd05` in {pr}`4267`
* Add docstrings for `ChangingDecimal` and `ChangeDecimalToValue` by {user}`haveheartt` in {pr}`4346`
* Fix Sphinx exceptions when trying to build documentation via latex / as pdf by {user}`behackl` in {pr}`4370`
* Added license information to documentation landing page by {user}`Nikil-D-Gr8` in {pr}`3986`
* Set the default Python version to 3.13 in the uv installation guide by {user}`henrikmidtiby` in {pr}`4480`
### Maintenance and Testing
* Change project management tool from poetry to uv by {user}`behackl` in {pr}`4138`
* Re-add ffmpeg as dependency within Docker image by {user}`behackl` in {pr}`4150`
* Add tests for Matrix, DecimalMatrix, IntegerMatrix by {user}`pdrzan` in {pr}`4279`
* Add tests for polylabel utility by {user}`giolucasd` in {pr}`4269`
* Add support for `pycodestyle W` rule in Ruff by {user}`KaiqueDultra` in {pr}`4276`
* Fix files with few MyPy typing errors by {user}`henrikmidtiby` in {pr}`4263`
* Explicitly mention all files that mypy should ignore in the `mypy.ini` configuration file by {user}`henrikmidtiby` in {pr}`4306`
* Remove dead code from `scene.py` and `vector_space_scene.py` by {user}`henrikmidtiby` in {pr}`4310`
* Add type annotations to `scene.py` and `vector_space_scene.py` by {user}`henrikmidtiby` in {pr}`4260`
* Replace setup-texlive-action in CI workflow by {user}`behackl` in {pr}`4326`
* Adding type annotations to polyhedra.py and matrix.py by {user}`henrikmidtiby` in {pr}`4322`
* Handling typing errors in text/numbers.py by {user}`henrikmidtiby` in {pr}`4317`
* Move `configure_pygui` into a `Scene` method and remove `manim.gui` by {user}`chopan050` in {pr}`4314`
* Add typing annotations to svg_mobject.py by {user}`henrikmidtiby` in {pr}`4318`
* Add type annotations to `mobject/svg/brace.py` and default to `label_constructor=Text` in `BraceText` by {user}`henrikmidtiby` in {pr}`4309`
* Add classes `MethodWithArgs`, `SceneInteractContinue` and `SceneInteractRerun` inside new module `manim.data_structures` by {user}`chopan050` in {pr}`4315`
* Fix typo in import of OpenGLCamera in `utils/hashing.py` by {user}`fmuenkel` in {pr}`4352`
* Add type annotations to `manim/renderer/shader.py` by {user}`henrikmidtiby` in {pr}`4350`
* Add type annotations to `tex_mobject.py` by {user}`henrikmidtiby` in {pr}`4355`
* Add type annotations to `three_d_camera.py` by {user}`henrikmidtiby` in {pr}`4356`
* Revert change of default value for tex_environment by {user}`henrikmidtiby` in {pr}`4358`
* Add type hints to `scene_file_writer.py`, `section.py`, and `zoomed_scene.py` by {user}`fmuenkel` in {pr}`4133`
* Add type annotations for most of `camera` and `mobject.graphing` by {user}`henrikmidtiby` in {pr}`4125`
* Add `VectorNDLike` type aliases by {user}`chopan050` in {pr}`4068`
* Add type annotations to `dot_cloud.py`, `vectorized_mobject_rendering.py` and `opengl_three_dimensions.py` by {user}`henrikmidtiby` in {pr}`4359`
* Add type annotations to `indication.py` by {user}`henrikmidtiby` in {pr}`4367`
* Add type annotations to `composition.py` by {user}`henrikmidtiby` in {pr}`4366`
* Add type annotations to `growing.py` by {user}`henrikmidtiby` in {pr}`4368`
* Add type annotations to `movement.py` by {user}`henrikmidtiby` in {pr}`4371`
* Exclude check for cyclic imports by CodeQL by {user}`behackl` in {pr}`4384`
* Refactor imports from `collections.abc`, `typing` and `typing_extensions` for Python 3.9 by {user}`chopan050` in {pr}`4353`
* Add type annotations to `opengl_renderer_window.py` by {user}`fmuenkel` in {pr}`4363`
* Rename `SceneFileWriter.save_final_image()` to `save_image()` by {user}`fmuenkel` in {pr}`4378`
* Add type annotations to `text_mobject.py` by {user}`henrikmidtiby` in {pr}`4381`
* Rename types like `RGBA_Array_Float` to `FloatRGBA` and add types like `FloatRGBA_Array` by {user}`chopan050` in {pr}`4386`
* Add type annotations to `opengl_geometry.py` by {user}`henrikmidtiby` in {pr}`4396`
* Add type annotations to `moving_camera.py` by {user}`henrikmidtiby` in {pr}`4397`
* Add type annotations to `opengl_mobject.py` by {user}`RBerga06` in {pr}`4398`
* Fix failing pre-commit tests by {user}`cclauss` in {pr}`4434`
* Add type annotations to `cairo_renderer.py` by {user}`fmuenkel` in {pr}`4393`
* Fix type errors and add typings for `Mobject.apply_function()`, its derivatives, and other utility functions by {user}`godalming123` in {pr}`4228`
* Bump macOS image from deprecated macos-13 to macos-15-intel by {user}`chopan050` in {pr}`4481`
* Prepare new release `v0.19.1` and bump minimum required Python version to 3.10 by {user}`behackl` in {pr}`4490`
### Dependency Version Changes
* Bump typing extensions minimum version by {user}`JasonGrace2282` in {pr}`4121`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4122`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4140`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4148`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4181`
* Bump astral-sh/setup-uv from 5 to 6 by {user}`dependabot`[bot] in {pr}`4234`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4204`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4391`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4405`
* Bump actions/setup-python from 5 to 6 by {user}`dependabot`[bot] in {pr}`4433`
* Bump actions/checkout from 4 to 5 by {user}`dependabot`[bot] in {pr}`4418`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4409`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4460`
* [pre-commit.ci] pre-commit autoupdate by {user}`pre-commit-ci`[bot] in {pr}`4467`
* Bump github/codeql-action from 3 to 4 by {user}`dependabot`[bot] in {pr}`4466`
* Bump astral-sh/setup-uv from 6 to 7 by {user}`dependabot`[bot] in {pr}`4465`
* Bump actions/upload-artifact from 4 to 5 by {user}`dependabot`[bot] in {pr}`4464`
## New Contributors
* {user}`BenKirkels` made their first contribution in {pr}`4144`
* {user}`Hasan-Mesbaul-Ali-Taher` made their first contribution in {pr}`4185`
* {user}`ragibson` made their first contribution in {pr}`4217`
* {user}`thehugwizard` made their first contribution in {pr}`4202`
* {user}`xinoehp512` made their first contribution in {pr}`4226`
* {user}`SAYAN02-DEV` made their first contribution in {pr}`4254`
* {user}`Akshat-Mishra-py` made their first contribution in {pr}`4251`
* {user}`pdrzan` made their first contribution in {pr}`4279`
* {user}`pedropxoto` made their first contribution in {pr}`4278`
* {user}`giolucasd` made their first contribution in {pr}`4269`
* {user}`KaiqueDultra` made their first contribution in {pr}`4276`
* {user}`ishu9bansal` made their first contribution in {pr}`4291`
* {user}`StevenH34` made their first contribution in {pr}`4213`
* {user}`alterdim` made their first contribution in {pr}`4305`
* {user}`mohiuddin-khan-shiam` made their first contribution in {pr}`4324`
* {user}`elshorbagyx` made their first contribution in {pr}`4332`
* {user}`NASAnerd05` made their first contribution in {pr}`4267`
* {user}`ra1u` made their first contribution in {pr}`4003`
* {user}`AbhilashaTandon` made their first contribution in {pr}`4099`
* {user}`nubDotDev` made their first contribution in {pr}`4286`
* {user}`haveheartt` made their first contribution in {pr}`4346`
* {user}`xnov18` made their first contribution in {pr}`4375`
* {user}`Nikil-D-Gr8` made their first contribution in {pr}`3986`
* {user}`RBerga06` made their first contribution in {pr}`4398`
* {user}`Nikhil172913832` made their first contribution in {pr}`4440`
* {user}`SASHAKT1290` made their first contribution in {pr}`4452`
* {user}`Brainsucker92` made their first contribution in {pr}`4469`
* {user}`NightyStudios` made their first contribution in {pr}`4470`
* {user}`Morkunas` made their first contribution in {pr}`4478`
* {user}`GuiCT` made their first contribution in {pr}`4479`
* {user}`godalming123` made their first contribution in {pr}`4228`
* {user}`jakekinchen` made their first contribution in {pr}`4484`
* Fix `ImageMobject` 3D rotation/flipping and remove resampling algorithms `lanczos` (`antialias`), `box` and `hamming` by {user}`chopan050` in {pr}`4266`
* Fix `YELLOW_C` and add `PURE_CYAN`, `PURE_MAGENTA` and `PURE_YELLOW` by {user}`chopan050` in {pr}`4562`
### Highlights 🌟
* Rewrite MathTex to make it more robust regarding splitting by {user}`henrikmidtiby` in {pr}`4515`
The MathTex implementation has been updated to make it more robust and fix a number of issues.
A beneficial side effect is that named groups in svg files can now be accessed through SVGMobject.
* Add new Animation Builder `Mobject.always` by {user}`JasonGrace2282` in {pr}`4594`
This new feature is a convenience wrapper around `add_updater` that allows adding
updaters to a mobject in an intuitive and easy-to-read way. Example usage in a scene:
```python
d = Dot()
s = Square()
d.always.next_to(s, UP)
self.add(s, d)
self.play(s.animate.to_edge(LEFT))
```
### New Features ✨
* Add a `seed` config option + `--seed` CLI option for reproducible randomness in rendered scenes by {user}`arnaud-ma` in {pr}`4532`
### Enhancements 🚀
* Enable `strict=True` for `zip()` where safe by {user}`Oll-iver` in {pr}`4547`
### Bug Fixes 🐛
* using `color` instead of `fill_color` with MathTeX for node labels by {user}`Schefflera-Arboricola` in {pr}`4501`
* fix: infinite recursion caused by accessing color of a highlighted Ta… by {user}`BHearron` in {pr}`4435`
* Prevent potential `UnboundLocalError` in `PolarPlane` by {user}`RinZ27` in {pr}`4557`
* Fixed division by 0 in `turn_animation_into_updater` by {user}`SoldierSacha` in {pr}`4567`
* Fix TOCTOU Race Conditions when creating directories by {user}`SoldierSacha` in {pr}`4587`
* Resolve more race conditions potentially happening during directory creation by {user}`SoldierSacha` in {pr}`4589`
* Fix `c2p`/`coords_to_point` method call with single flat list or 1D array input by {user}`danielalanbates` in {pr}`4596`
### Documentation 📚
* Enable rendered documentation of `RandomColorGenerator` by {user}`arnaud-ma` in {pr}`4533`
* Remove pin to Python 3.13 in installation docs by {user}`chopan050` in {pr}`4534`
* Fix broken aquabeam OpenGL link using Wayback Machine by {user}`behackl` in {pr}`4545`
* Add type annotations and docstrings in `opengl_renderer.py` by {user}`arnaud-ma` in {pr}`4537`
* docs: improve `TransformFromCopy` docstring by {user}`GoThrones` in {pr}`4597`
### Infrastructure & Build 🔨
* Install missing dependencies in release pipeline by {user}`behackl` in {pr}`4531`
### Code Quality & Refactoring 🧹
* Rework and consolidate release changelog script, add previously skipped changelog entries by {user}`behackl` in {pr}`4568`
* Remove `__future__.annotations` from required imports by {user}`JasonGrace2282` in {pr}`4571`
* Cleaned up `mypy.ini` by {user}`henrikmidtiby` in {pr}`4584`
* Add `py.typed` to declare manim as having type hints by {user}`Timmmm` in {pr}`4553`
* Fix assertion in `ImageMobjectFromCamera.interpolate_color()` by {user}`chopan050` in {pr}`4593`
* Reduce dependency on scipy - replace `scipy.special.comb` with `math.comb` by {user}`fmuenkel` in {pr}`4598`
### Type Hints 📝
* Add type annotations to `rotation.py` by {user}`fmuenkel` in {pr}`4535`
* Add type annotations to `opengl_compatibility.py` by {user}`fmuenkel` in {pr}`4585`
* Add type annotations to `image_mobject.py` by {user}`henrikmidtiby` in {pr}`4458`
* Add type annotations to `opengl_image_mobject.py` by {user}`fmuenkel` in {pr}`4536`
* Add type annotations to `point_cloud_mobject.py` by {user}`fmuenkel` in {pr}`4586`
## New Contributors
* {user}`arnaud-ma` made their first contribution in {pr}`4533`
* {user}`Schefflera-Arboricola` made their first contribution in {pr}`4501`
* {user}`BHearron` made their first contribution in {pr}`4435`
* {user}`RinZ27` made their first contribution in {pr}`4557`
* {user}`SoldierSacha` made their first contribution in {pr}`4567`
* {user}`Oll-iver` made their first contribution in {pr}`4547`
* {user}`GoThrones` made their first contribution in {pr}`4597`
* {user}`danielalanbates` made their first contribution in {pr}`4596`
* Use ``TypeVar`` when you want to "link" type hints as being the same type.
Consider ``Mobject.copy``, which returns a new instance of the same class.
It would be type-hinted as:
..code:: py
T = TypeVar("T")
def copy(self: T) -> T: ...
* Use ``typing.Iterable`` whenever the function works with *any* iterable, not a specific type.
* Prefer ``numpy.typing.NDArray`` over ``numpy.ndarray``
..code:: py
import numpy as np
if TYPE_CHECKING:
import numpy.typing as npt
def foo() -> npt.NDArray[float]:
return np.array([1, 0, 1])
* If a method returns ``self``, use ``typing_extensions.Self``.
..code:: py
if TYPE_CHECKING:
from typing_extensions import Self
class CustomMobject:
def set_color(self, color: ManimColor) -> Self:
...
return self
* If the function returns a container of a specific length each time, consider using ``tuple`` instead of ``list``.
..code:: py
def foo() -> tuple[float, float, float]:
return (0, 0, 0)
* If a function works with a parameter as long as said parameter has a ``__getitem__``, ``__iter___`` and ``__len__`` method,
the typehint of the parameter should be ``collections.abc.Mapping``. If it also supports ``__setitem__`` and/or ``__delitem__``, it
should be marked as ``collections.abc.MutableMapping``.
* Typehinting something as ``object`` means that only attributes available on every Python object should be accessed,
like ``__str__`` and so on. On the other hand, literally any attribute can be accessed on a variable with the ``Any`` typehint -
it's more freeing than the ``object`` typehint, and makes mypy stop typechecking the variable. Note that whenever possible,
try to keep typehints as specific as possible.
* If objects are imported purely for type hint purposes, keep it under an ``if typing.TYPE_CHECKING`` guard, to prevent them from
being imported at runtime (helps library performance). Do not forget to use the ``from __future__ import annotations`` import to avoid having runtime ``NameError`` exceptions.
..code:: py
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from manim.typing import Vector3D
# type stuff with Vector3D
Missing Sections for typehints are:
-----------------------------------
* Mypy and numpy import errors: https://realpython.com/python-type-checking/#running-mypy
"""Given an array of points, set them as corner of the Vmobject."""
* ``**kwargs`` has no typehint
* Mobjects have the typehint "Mobject", e.g.
..code:: py
def match_color(self, mobject: "Mobject"):
"""Match the color with the color of another :class:`~.Mobject`."""
return self.set_color(mobject.get_color())
* Colors have the typehint ``Color``, e.g.
..code:: py
def set_color(self, color: Color = YELLOW_C, family: bool = True):
"""Condition is function which takes in one arguments, (x, y, z)."""
* As ``float`` and ``Union[int, float]`` are the same, use only ``float``
* For numpy arrays use the typehint ``np.ndarray``
* Functions that does not return a value should get the type hint ``None``. (This annotations help catch the kinds of subtle bugs where you are trying to use a meaningless return value. )
..code:: py
def height(self, value) -> None:
self.scale_to_fit_height(value)
* Parameters that are None by default should get the type hint ``Optional``
..code:: py
def rotate(
self,
angle,
axis=OUT,
about_point: Optional[Sequence[float]] = None,
**kwargs,
):
pass
* The ``__init__()`` method always should have None as its return type.
* Functions and lambda functions should get the typehint ``Callable``
@ -211,7 +211,7 @@ is imported and Python has read and defined the ``ToyExample`` class (but,
read carefully: *no instance of this class has been created yet*).
At this point, the interpreter is about to enter the ``tempconfig`` context
manager. Even if you have not seen Manim's ``tempconfig`` before, it's name
manager. Even if you have not seen Manim's ``tempconfig`` before, its name
already suggests what it does: it creates a copy of the current state of the
configuration, applies the changes to the key-value pairs in the passed
dictionary, and upon leaving the context the original version of the
@ -266,7 +266,7 @@ The scene then asks its renderer to initialize the scene by calling
Inspecting both the default Cairo renderer and the OpenGL renderer shows that the ``init_scene``
method effectively makes the renderer instantiate a :class:`.SceneFileWriter` object, which
basically is Manim's interface to ``ffmpeg`` and actually writes the movie file. The Cairo
basically is Manim's interface to ``libav`` (FFMPEG) and actually writes the movie file. The Cairo
renderer (see the implementation `here <https://github.com/ManimCommunity/manim/blob/main/manim/renderer/cairo_renderer.py>`__) does not require any further initialization. The OpenGL renderer
does some additional setup to enable the realtime rendering preview window, which we do not go
into detail further here.
@ -310,8 +310,8 @@ the order they are called, these customizable methods are:
After these three methods are run, the animations have been fully rendered,
and Manim calls :meth:`.CairoRenderer.scene_finished` to gracefully
complete the rendering process. This checks whether any animations have been
played -- and if so, it tells the :class:`.SceneFileWriter` to close the pipe
to ``ffmpeg``. If not, Manim assumes that a static image should be output
played -- and if so, it tells the :class:`.SceneFileWriter` to close the output
file. If not, Manim assumes that a static image should be output
which it then renders using the same strategy by calling the render loop
(see below) once.
@ -385,7 +385,7 @@ describing the control points in between ("handles").
..hint::
To learn more about Bézier curves, take a look at the excellent
online textbook `A Primer on Bézier curves <https://pomax.github.io/bezierinfo/>`__
by `Pomax <https://twitter.com/TheRealPomax>`__ -- there is an playground representing
by `Pomax <https://twitter.com/TheRealPomax>`__ -- there is a playground representing
Please be aware that there are different, incompatible versions
of Manim available. Check our :ref:`installation FAQ <different-versions>`
Please be aware that there are different, incompatible versions of Manim available.
This version, the Community Edition of Manim (`ManimCE <https://github.com/ManimCommunity/manim>`_),
is a separate project maintained by the community, but it was forked from `3b1b/manim <https://github.com/3b1b/manim>`_,
the original Manim created and open-sourced by Grant Sanderson, creator of `3Blue1Brown <https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw>`_ educational math videos.
@ -327,6 +327,13 @@ Generally, you start with the starting number and add only some part of the valu
So, the logic of calculating the number to display at each step will be ``50 + alpha * (100 - 50)``.
Once you set the calculated value for the :class:`~.DecimalNumber`, you are done.
..note::
If you're creating a custom animation and want to use a ``rate_func``, you must explicitly apply
``self.rate_func(alpha)`` to the parameter you're animating. For example, try switching the rate
function to ``rate_functions.there_and_back`` to observe how it affects the counting behavior.
Once you have defined your ``Count`` animation, you can play it in your :class:`~.Scene` for any duration you want for any :class:`~.DecimalNumber` with any rate function.
..manim:: CountingScene
@ -343,7 +350,7 @@ Once you have defined your ``Count`` animation, you can play it in your :class:`
If you installed Manim in the recommended way, using the
Python management tool ``uv``, then you either need to make sure the corresponding
virtual environment is activated (follow the instructions printed on running ``uv venv``),
or you need to remember to prefix the ``manim`` command in the console with ``uv run``;
that is, ``uv run manim ...``.
Overview
********
@ -28,45 +38,38 @@ use to modify ``Mobject``\s.
Starting a new project
**********************
Start by creating a new folder. For the purposes of this guide, name the folder ``project``:
Start by creating a new folder::
..code-block:: bash
manim init project my-project --default
project/
This folder is the root folder for your project. It contains all the files that Manim needs to function,
The ``my-project`` folder is the root folder for your project. It contains all the files that Manim needs to function,
as well as any output that your project produces.
Animating a circle
******************
1. Open a text editor, such as Notepad. Copy the following code snippet into the window:
1. Open a text editor, such as Notepad. Open the file ``main.py`` in the ``my-project`` folder.
It should look something like this:
.. code-block:: python
.. code-block:: python
from manim import *
from manim import *
class CreateCircle(Scene):
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
self.play(Create(circle)) # show the circle on screen
class CreateCircle(Scene):
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
self.play(Create(circle)) # show the circle on screen
2. Save the code snippet into your project folder with the name ``scene.py``.
..code-block:: bash
2. Open the command line, navigate to your project folder, and execute
the following command:
project/
└─scene.py
..code-block:: bash
3. Open the command line, navigate to your project folder, and execute
the following command:
..code-block:: bash
manim -pql scene.py CreateCircle
manim -pql main.py CreateCircle
Manim will output rendering information, then create an MP4 file.
Your default movie player will play the MP4 file, displaying the following animation.
@ -113,7 +116,7 @@ Now let's look at the next two lines:
class CreateCircle(Scene):
def construct(self):
...
[...]
Most of the time, the code for scripting an animation is entirely contained within
the :meth:`~.Scene.construct` method of a :class:`.Scene` class.
@ -192,7 +195,7 @@ Positioning ``Mobject``\s
Next, let's go over some basic techniques for positioning ``Mobject``\s.
1. Open ``scene.py``, and add the following code snippet below the ``SquareToCircle``method:
1. Open ``scene.py``, and add the following code snippet below the ``SquareToCircle``class:
..code-block:: python
@ -268,11 +271,9 @@ and animating those method calls with ``.animate``.
self.play(Create(square)) # show the square on screen
self.play(square.animate.rotate(PI / 4)) # rotate the square
self.play(Transform(square, circle)) # transform the square into a circle
self.play(
ReplacementTransform(square, circle)
) # transform the square into a circle
self.play(
circle.animate.set_fill(PINK, opacity=0.5)
square.animate.set_fill(PINK, opacity=0.5)
) # color the circle on screen
2. Render ``AnimatedSquareToCircle`` by running the following command in the command line:
@ -293,8 +294,8 @@ The following animation will render:
self.play(Create(square)) # show the square on screen
self.play(square.animate.rotate(PI / 4)) # rotate the square
self.play(ReplacementTransform(square, circle)) # transform the square into a circle
self.play(circle.animate.set_fill(PINK, opacity=0.5)) # color the circle on screen
self.play(Transform(square, circle)) # transform the square into a circle
self.play(square.animate.set_fill(PINK, opacity=0.5)) # color the circle on screen
The first ``self.play`` creates the square. The second animates rotating it 45 degrees.
The third transforms the square into a circle, and the last colors the circle pink.
@ -342,12 +343,61 @@ the corners of the square appear to contract slightly as they move into the posi
for the first square to transform into the second one.
In ``DifferentRotations``, the difference between ``.animate``'s interpretation of rotation and the
``Rotate`` method is far more apparent. The starting and ending states of a ``Mobject`` rotated 360 degrees
``Rotate`` method is far more apparent. The starting and ending states of a ``Mobject`` rotated 180 degrees
are the same, so ``.animate`` tries to interpolate two identical objects and the result is the left square.
If you find that your own usage of ``.animate`` is causing similar unwanted behavior, consider
using conventional animation methods like the right square, which uses ``Rotate``.
``Transform`` vs ``ReplacementTransform``
*****************************************
The difference between ``Transform`` and ``ReplacementTransform`` is that ``Transform(mob1, mob2)`` transforms the points
(as well as other attributes like color) of ``mob1`` into the points/attributes of ``mob2``.
``ReplacementTransform(mob1, mob2)`` on the other hand literally replaces ``mob1`` on the scene with ``mob2``.
The use of ``ReplacementTransform`` or ``Transform`` is mostly up to personal preference. They can be used to accomplish the same effect, as shown below.
..code-block:: python
class TwoTransforms(Scene):
def transform(self):
a = Circle()
b = Square()
c = Triangle()
self.play(Transform(a, b))
self.play(Transform(a, c))
self.play(FadeOut(a))
def replacement_transform(self):
a = Circle()
b = Square()
c = Triangle()
self.play(ReplacementTransform(a, b))
self.play(ReplacementTransform(b, c))
self.play(FadeOut(c))
def construct(self):
self.transform()
self.wait(0.5) # wait for 0.5 seconds
self.replacement_transform()
However, in some cases it is more beneficial to use ``Transform``, like when you are transforming several mobjects one after the other.
The code below avoids having to keep a reference to the last mobject that was transformed.