Commit graph

12 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
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
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
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
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
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
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
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
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