* Give SurroundingRectangle 2D buffer
* add test for SurroundingRectangle buff parameter
---------
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
* 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.
* 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>
* 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>
* 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>
* 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()
* 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>
* 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
* 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>
* 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 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>
* 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
* 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>
* 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>
* 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>
* 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>
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>
* 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>
* 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>