Commit graph

507 commits

Author SHA1 Message Date
Darylgolden
6018ebf445 Revert "Merge branch 'main' of https://github.com/ManimCommunity/manim"
This reverts commit e7f9d23aa7, reversing
changes made to afe91d02b6.
2023-07-31 15:29:39 +08:00
Benjamin Hackl
1cd0f43982
Fixed expand animation for :class:.ManimBanner (#3298)
* fixed "a" appearing before shapes

* added animation test for ManimBanner

* added xelatex to linux pipeline

* xelatex -> xetex
2023-07-18 14:36:20 -07:00
Benjamin Hackl
820bfc7bf0
Fixed errors reported by `flake8` (#3231)
* 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>
2023-05-04 22:14:27 -07:00
JinchuLi2002
0902eef61f
Enables Use of input_to_graph_point() by CurvesAsSubmobjects Instances (#3190)
* CurvesAsSubmobjects preserve points.

* Override point_from_proportion() instead

* fixed typo

* added test

* added underscore for helper method

---------

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2023-04-25 12:22:27 +00:00
Frédéric Crozatier
c98f3c786c
Added :class:.DiGraph, a mobject representing directed graphs (#2974)
* Directed graphs

* use type instead of isinstance

* respect object boundary

* refactor graph with GenericGraph

* update tests

* fix doc string

* custom tips override default, and more documentation

* improve docstring situation, move examples to concrete classes

* further improve docstrings

* refactor: remove graph_type, simplify handling of tip_config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed superfluous import

* fixed two tests

---------

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>
2023-04-06 13:40:23 +02:00
Benjamin Hackl
a6651bee94
New tip shape :class:.StealthTip, allow specifying tip shape of :class:.NumberLine (#3201)
* 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>
2023-04-05 20:05:48 +02:00
Kevin Lubick
1b4049a01a
Add warning if font is not found for Text, Code, and MarkupText (#3046)
* 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>
2023-03-30 13:47:53 +02:00
Matthew Lee
117563e1f0
Added :meth:.set_opacity_by_tex method for setting the opacity of parts of Tex mobjects (#3159)
* 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>
2023-03-29 08:33:13 +02:00
coreyp1
80795d8361
Added support for individualized radius values in :meth:.Polygram.round_corners (#3155)
* 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>
2023-03-28 22:13:12 +02:00
Kevin Lubick
1edcd99250
Speed up width/height/depth by reducing copying (#3180)
* 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>
2023-03-28 21:03:03 +02:00
Kevin Lubick
1e8b349e00
Reduce memory allocations when building SVGMobject (#3182)
* 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>
2023-03-28 20:48:29 +02:00
Benjamin Hackl
409ffc6cb8
Fixed behavior of Wait with specified stop_condition (#3152)
* 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>
2023-02-24 11:48:16 +01:00
pre-commit-ci[bot]
b3e51e391e
[pre-commit.ci] pre-commit autoupdate (#3141)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pycqa/isort: 5.11.4 → 5.12.0](https://github.com/pycqa/isort/compare/5.11.4...5.12.0)
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)

* [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>
2023-02-07 01:52:17 +01:00
Kevin Lubick
b54743e81d
Add scene.replace() and use in ReplacementTransform (#3042)
* 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>
2023-01-27 12:23:33 +01:00
Tristan Schulz
7d7c5055d4
Fixed opengl Surface with reordering initialization process (#3089)
* Fixed opengl Surface with disabling refresh of shader wrapper id in constructor

* Reordered Elements in constructor of opengl_vectorized_mobject to fix initialization dependency issues
2022-12-26 01:47:17 +01:00
Benjamin Hackl
f4aa88c368
Increased minimal version of `pytest` (#3066)
* upgrade pytest to ^7.2

* rename msg to reason in pytest.mark.skip
2022-12-08 14:08:47 +01:00
Naveen M K
c4eeb2efb8
Always use `/` when calling LaTeX (#3061)
* Add a test to reproduce #3060

* Always use `/` when calling LaTeX

Using `\` isn't supported by LaTeX and simply errors out
saying it can't find the file. In this commit, the path is
converted to POSIX like path (ie. use `/`) before calling
LaTeX.

Fixes https://github.com/ManimCommunity/manim/issues/3060
2022-12-06 13:17:15 +01:00
Benjamin Hackl
ab57a6eb35
Frame comparison pixel threshold (#3053)
* implemented threshold for number of pixel value errors

* fix implementation, throw proper warning

* added test for pixel value error threshold

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove forgotten debug print

* introduce constants for frame_comparison tolerance

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename constant

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-01 17:38:44 +00:00
Hugues Devimeux
2044ef8abc
Removed unused `GraphicalUnitTester` (#3054)
* Removed graphicalUnitTester

* Removed reference about it in teh docs
2022-11-30 22:10:13 +01:00
Alexander Vázquez
388504307a
Implemented :class:.LineJointTypes for both Cairo and OpenGL renderer (#3016)
* LineJoins added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added joint type enum, refactored proposed implementation

* added test for joint types

* added documentation

* let LineJointType.AUTO be rendered like before

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update added example in basic.py to reflect changed implementation

* fix RTD build

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* moved rendered example in 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>
2022-11-13 16:14:55 -07:00
Benjamin Hackl
93f916587b
Fixed rendering SVG paths with multiple move commands (#3019)
* implement missing VMobject.resize_points

* ensure that VMobject.start_new_path *actually* starts a new path

* add missing imports

* doctest resize_array

* added test with weird dvisvgm generated svg

* black

* [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: Naveen M K <naveen521kk@gmail.com>
2022-11-13 06:24:45 +00:00
Benjamin Hackl
bd844f46d8
Replaced renderer strings with :class:.RendererType enum entries (#3017)
* remove unused constants

* remove deprecated --use_opengl_renderer flag

* remove unnecessary workaround with class initialization

* add OpenGLMobject.name to get rid of one renderer check

* add VMobject.n_points_per_curve property to get rid of more renderer checks

* replace renderer string checks with enum check

* added mobject.utils module with renderer-dependent class getters

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* ensure that capitalization of passed renderer type is irrelevant

* remove unused entries from mobject.utils.__all__

* fixed isort ignore in manim.__init__

* fixed lower-case casting of passed renderer

* fixed doctests

* more documentation + doctests for mobject.utils

* removed incorrect paragraph about ConverToOpenGL metaclass

* added docstring for RendererType enum

* renderer compatibility section in plugin dev documentation

* added mobject.utils to reference manual

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove actual doctest (it ran the compatibility code)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
2022-11-13 06:14:35 +00:00
NotWearingPants
95bca6f24b
Convert all types of parameters in docstrings to proper type annotations (#2988)
* Converted types in docstrings to type annotations

* `isort .`

* `black .`

* Additional docstrings type annotation fixes

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-11-10 07:17:21 +01:00
Duc Phat
5ca1763068
fix: Align lines correctly when passing faded_line_ratio property to NumberPlane (#2894) (#2920)
* fix: Align lines correctly when passing `faded_line_ratio` property to NumberPlane (#2894)

* regenerated test data

* removed unnecessary check for empty input

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-11-05 12:18:11 +00:00
NotWearingPants
bf0ea29338
Fixed `CLI.tex_template_file` config file setting (#2992)
* fix `CLI.tex_template_file` config setting

* added test for tex_template_file set in .cfg

* create a new config object for testing instead of working within tempconfig

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Benjamin Hackl <mail@behackl.dev>
2022-11-02 22:52:20 +00:00
NotWearingPants
9d1f066d63
Migrate more os.path to pathlib (#2980)
* Migrate more `os.path` to `pathlib`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix type errors with recent pathlib code

* pathlib fixes

* more pathlib fixes

* remove unused imports introduced by pathlib migration

* convert `open()` calls to pathlib

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Migrate tex_file_writing to pathlib

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* converted more old code to pathlib, and fixed a bug in module_ops

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix test failures

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix test failures

* Apply suggestions from code review

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: Benjamin Hackl <devel@benjamin-hackl.at>
2022-10-30 08:28:26 +01:00
Benjamin Hackl
3c172e2a8a
Fixed setting `run_time of :class:.Succession` after creating the animation object (#3003)
* fixed run_time scaling of Succession

* added test for Succession run_time set after initialization
2022-10-29 07:33:29 +00:00
Benjamin Hackl
b3b90ef346
Rewrote unstable tests for :mod:.text_mobject to be non-graphical (#2982)
* removed text test control data

* rewrote text tests to be non-graphical

* [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>
2022-10-26 19:52:08 +02:00
NotWearingPants
206db54af5
Migrate more os.path to pathlib in tests (#2991)
* Migrate more `os.path` to `pathlib` in tests

* Convert test fixtures to pathlib

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix mypy errors in tests

* migrate another pathlib instance

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>
2022-10-26 19:51:38 +02:00
Benjamin Hackl
309c9d41eb
Ported improved implementation of :class:.SVGMobject from 3b1b/manim (#2898)
* port SVGMobject from 3b1b/manim

* added svgelements as dependency

* revert change of default values

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* set default stroke_width of svg elements to 0 if not set

* fix handling of circles with different rx/ry

* turn more methods into staticmethods

* removed duplicated method

* set/adapt stroke-width of some test SVGs

* updated control data

* forgot some control data

* fixed init_colors in tex_mobject and text_mobject

* minor changes, added docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* module docstring, removed import

* vector_to_coords changed again

* nail sphinx version to below 5.1 to fix rtd (?)

* update test_text control data for science

* changed Brace to use VMobjectFromSVGPath

* remove unused classes and methods depending on old SVG path implementation

* remove style_utils and svg_path modules

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change test_text to use monospace font

* restore geometry.polygram

* added get_mobject_type_class auxiliary method; changed polyline implementation to ad-hoc approach

* restore test_text to previous version

* skip Use tags as svgelements already populates them

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-28 18:02:53 +02:00
Kevin Lubick
c4f1d202a9
Prevent TransformMatchingTex from crashing when there is nothing to fade (#2846)
* Prevent TransformMatchingTex from crashing when there is nothing to fade

Fixes #2845 and adds tests.

I originally tried to make FadeTransformPieces not crash if it was given two Mobjects with no submobjects, but I couldn't quite get that to work. This is probably the less invasive of a change.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* use Tex arrows

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update expectations after Tex change

* Address feedback

This makes FadeTransform::ghost_to more robust to receiving an empty target. It is currently unspecified what should happen, so how about just fading in place?

* [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>
2022-09-24 16:22:42 +02:00
Benjamin Hackl
22ae67e47f
Fixed bug with propagation of `tex_template value when using tempconfig` (#2888)
* added tex_template to keys of config dict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added missing argument to tempconfig call

* decouple config.tex_template and config.tex_template_file, simple tex_template default

* changed template => changed file hashes

* added dedicated tempconfig reset test

* black

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
2022-07-22 16:21:46 +00:00
Benjamin Hackl
ce9acddd41
Improved performance of `test_threed.py` (#2893)
* lower resolution of surfaces in 3D tests to greatly improve performance

* regenerated test data

* print test execution time by default
2022-07-22 14:21:03 +00:00
Alex Lembcke
4f42ad5664
Enabled filling color by value for :class:.OpenGLSurface, replaced `colors keyword argument of :meth:.Surface.set_fill_by_value with colorscale` (#2186)
* Enable filling color by value for OpenGLSurface.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added doc string and removed unused deprecated_params

* Added docstring and made method private.

* Fixed spelling error.

* Update manim/mobject/types/opengl_surface.py

Agreed.

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Fixed typings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added None type as part of color checking

* Another attempt at fixing the color typings

* Made some of the requested modifications.

* Fixed failing tests.

* Added tests for Cairo method.

* One minor change to test plot_surface.

* Fixed typo in docstring.

* Removed passing in of axes.

* Removed axes in tests.

* Fixed typo, mixed up u and v.

* Fixed docstring typo, updated format to recommended.

* Fixed one more typo in docstring.

* One last time editing the docstring.

* Add deprecation import to opengl_surface.

* Added import for Surface and OpenGLSurface to coordinate_systems.

* Hoping this fixes the example for the docs.

* Addes colorscale_axis to plot_surface

* Forgot to update the docstring.

* added proper deprecation, made change temporarily backwards compatible

* [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>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-07-13 18:44:12 +02:00
ad_chaos
f1c5b6b372
Use tempconfig for every scene render (#2567)
* Use tempconfig instead of modifying the config

* Extended the -a flag test

* Update 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>
2022-07-12 22:22:32 +02:00
Joshua Mankelow
999d81ee92
Fixed issue with `manim init scene SCENE_NAME filename.py and removed necessity of main.py` to be present in working directory (#2870)
* Fixed .py issue with manim init scene SCENE_NAME filename.py and removed necessity of main.py file to be present.

* fixed a problem when passing file name

* added interface test

* [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>
2022-07-12 22:21:31 +02:00
Joshua Mankelow
9b731037d9
Moved functionality over from manim new to manim init and added deprecation warning for manim new (#2842)
* moved functionality over from manim new to manim init and deprecated manim new

* Updated tests to fit new functionality

* added a test for project creation using manim init project

* [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>
2022-07-10 09:00:07 +02:00
ad_chaos
677e88ef96
Refactor tests (#2866)
* start test reorganization

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* move boolean ops

* move more tests

* Move more tests

* more reorganization

* more movements

* mostly finish up reorganization

* Finish reorganization tests in parent dir

* try moving interface tests back

* Move test_commands over

* fix relative path to templates

Co-authored-by: Darylgolden <darylgolden@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-09 21:10:30 +00:00
Sparsh Goenka
6c58f4a777
Added :class:.ChangeSpeed, an animation wrapper that allows to smoothly change the speed at which an animation is played (#2749)
* Added speedmodifier.py

* fix bugs, stable state

* rate_func, comments

* Add docs

* add `ChangedWait`

* run_time override for AnimationGroup

* fix AnimationGroup

* change example

* [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

* fix docstrings

* small improvements

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

fix AnimationGroup

fix AnimationGroup...

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add_updater for changed speed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename vars

* Remove `ChangedWait`,
Set default `rate_func` for `Wait` to `linear`

* fix `Succession`

* fix updaters

* fix docs

* rename vars

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* convert lambdas into funcs

* Add tests.

* reduced test run time and regenerated control data

* Update manim/animation/speedmodifier.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* include new module in docbuild

* added module docstring

* fixed non-rendering examples in documentation

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>
Co-authored-by: Benjamin Hackl <benjamin.hackl@aau.at>
2022-07-06 16:39:55 +02:00
Tristan Schulz
9359331eff
Add vectorized plotting functionality to improve performance (#2739)
* enhancement(ParametricFunction, CoordinateSystem, Axes, NumberLine): vectorized coords_to_points,plot,plot_parametric_function; added Numberline:number_to_point_array

* test(plot_log_x_axis_vectorized): added test for vectorized plotting

* extend(angle_of_vector): added test for angle_of_vector with ndarray as input

* fix(frames_comparison): fix naming of test data to be able to write and read the file name because ':' is forbidden

* test(plot): add more vectorized tests, added use_vectorized fixture to make life simpler

* fix(coordinate_system,number_line,scale): vectorizing functions and fixing bugs

* enhancement(NumberLine): vectorized number_to_point and added test

* enhancement(NumberLine): added tests for point_to_number, added example to doc

* enhancement(CoordinateSystem): added test for coords_to_point_vectorized and vectorized coords_to_point

* enhancement(Axes): vectorized point_to_coords and added tests

* Minor formatting fixes and doctests

* fixed flake hint with generator expression

* Create __init__.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update documentation for antiderivative

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Raghav Goel <raghavgd2h@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/graphing/functions.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/graphing/coordinate_systems.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* fixed wrong indentation

* stop doctest from leaking change in global config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change code block type

* [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: Raghav Goel <raghavgd2h@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-06-19 18:10:34 +02:00
Simeon Widdis
3ae46a4c13
Fix TransformMatchingAbstractBase Mobject leaks (#2826)
* Clean up ghost Mobject in TransformMatchingAbstractBase

TransformMatchingAbstractBase does Fade transitions when no mismatch handling is defined, the current implementation leaves an invisible object behind when it's applied. This commit adds handling to clean it up.

Co-Authored-By: Andrew Yang <4412798+AndrewYY@users.noreply.github.com>

* Add tests for TransformMatching default mismatch behavior

* Document new interpolation behavior

* Add TransformMatching code review changes

* Revert "Add TransformMatching code review changes"

This reverts commit 6de61ecbba.

* Revert "Revert "Add TransformMatching code review changes""

Mistakes were made, we need to revert deeper.

This reverts commit 7bd9f4ebea.

Co-authored-by: Andrew Yang <4412798+AndrewYY@users.noreply.github.com>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-06-19 10:39:54 +02:00
Simeon Widdis
bcb5233259
Add documentation and testing for Transform's path_func behavior (#2771)
* Add graphical tests for Transform with paths

* Rewrite path function setting in Transform

Currently setting the path function in Transform is done unintuitively,
this commit reorders the path_func assignment to make it more clear what
it's doing.

Passes 609 tests / Skips 12 tests

* Add Parameter DocString to Transform class

* Add Transform test for conflicting path settings

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/animation/transform.py

Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-06-19 01:56:15 +02:00
mooncaker816
b583720ac2
Fixed bug in :meth:.VMobject.proportion_from_point that caused proportions greater than 1 to be returned (#2770)
* fix bug #2627

* Update manim/utils/bezier.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* add test case for bug #2627

* [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>
Co-authored-by: Tristan Schulz <mrdiverlp@gmail.com>
2022-06-18 12:23:16 -04:00
Baroudi Aymen
bdf7b73ce1
Replace assert with np.testing assertions (#2743)
* Replace assert with np.testing assertions

Using np.testing.assert_array_equal() gives a more readable output.

* Replace assert of np.all with assert_array_equal()

* Replace assert with np.testing assertions

for np.allclose assertions

* Fix np.testing assertion

assert_array_equal takes two argument

* changed some more asserts to np.testing.assert_*

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-06-07 11:39:35 +00:00
Benjamin Hackl
48747a74d9
Refactored structure of documentation; added :doc:FAQ section <faq/index> (#2732)
* move tutorials -> tutorials_guide

* change title in tutorials_guides

* rename: a_deeper_look -> output_and_config

* splitting Tutorials

* reorder index (sidebar), move some top level sections elsewhere

* rename some tutorials

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* replace recommonmark with rest for rendering md files

* fixed broken references

* fixed **all** warnings and errors during docbuild

* faq: help, more structure for landing page

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix deprecation tests

* prepare some sort of skeleton for installation faq

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* ensure that pip from poetry venv is used in pipeline

* added myst-parser as dev dependency

* remove fixed sphinx version from requirement.txt, don't re-install dependencies

* move and improve versions and troubleshooting content to FAQ

* resolve broken references

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* help blacken-docs

* new: navigating the docs

* make different versions question more prominent

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed order of tutorials

* added explicit references to building blocks and quickstart tutorial

* docs -> doc

* change a page-reference to a paragraph-reference

* pypi manimlib, split answer regarding chocolatey failing

* added a note on #beginner-resources

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-27 08:45:31 +00:00
nyabkun
1bffb1d7a7
Fix Code mobject wrong indentation (#2725) 2022-05-23 21:05:54 +00:00
WillSoltas
ce4ac5162b
Added Axes Tip Resize Functionality according to Axes documentation (#2661)
* Added Axes Tip Resize Functionality according to Axes class documentation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changed Default Tip Size Values to Conform with Global Defaults

* Fixed width kwarg usage on circle/square tips

* Fixed ratio-impacted default tip width for vectors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed Left-over Prints :)

Co-authored-by: Will Soltas <willsoltas@Wills-MacBook-Pro-2.local>
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>
2022-05-09 19:40:19 +00:00
niklebedenko
cfd006aa7f
Matrix brackets (#2709)
* Fixed bracket warping for matrices

* fixed bodge for bracket splitting

* changed default value, removed old import

* updated VectorScene test

Co-authored-by: niklebedenko <nananananabatman>
2022-05-09 19:37:40 +00:00
Jonathan Alpert
7a13f0e969
Migrate from os.path to pathlib in Testing Scripts (#2685)
* updated styling

* final commit

* fixed style

* removed exist_ok=true

* added parents=True

* potentially .exists() is the problem

* fixed style'

* fixed style on revisions

* style check processed

* Update tests/helpers/graphical_units.py

Co-authored-by: ad_chaos <90276965+Kiran-Raj-Dev@users.noreply.github.com>

* fixed changes

* made get_dir_layout also accept path.

* removed small auto import error

Co-authored-by: ad_chaos <90276965+Kiran-Raj-Dev@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
2022-04-24 10:48:11 +00:00
Jason Villanueva
32b714a898
Improved CLI help page styling (#1975)
* First draft of cloup/click update

* Added some customizability via cfg files

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed test_command epilogs

* Adjusted logic for overriding theme

* Update main help page, no_args_is_help, and documentation

* Removed help shorthand '-h'

* Apply suggestions from code review

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update poetry lock again, update DefaultGroup snippet

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>
2022-04-24 10:05:23 +00:00