Commit graph

11 commits

Author SHA1 Message Date
Christopher Besch
3ce4c133dd
Introduced API for scene sections via :meth:.Scene.next_section (#2152)
* feat: added section class

* fix: fixed imports in scene.py

* feat: added section class

* fix: fixed imports in scene.py

* feat: scene file writer update; needs testing

* broken test

* fixed wrong partial movie files

* feat: added animation concatenation for sections

* fix: sections can contains None as partial movie file

* fix: correct section output file names

* fix: removed media folder

* feat: section output able to extract type

* feat: added guarantee_existence tests

* fix: touch file on windows

* fix: touch file on windows

* feat: automatically create control data with --set_test flag

* feat: added tests for sections output folder

* feat: added flag to enable sections

* feat: testing section metadata file

* feat: finished metadata tests; changed enums to be extendable

* fix: removed testing files

* fix: fixed section types

* fix: fixed outdated control data

* fix: fixed simple_scenes.py

* fix: fixed section type documentation example

* feat: added section video metadata to API

* fix: isort should stop destroying the import order for commands.py

* fix: fixed types of section metadata output

* fix: better comments

* ?

* feat: added elaborate test; switched name and type in next_section call

* feat: changed testing terminology: "config" got renamed to "movie metadata"

* fix: removed unicode lambda :<

* fix: fixed control data

* fix: removed test setter

* feat: added tutorial in the documentation

* fix: updated test control data

* fix: fixed double '.' in video tests

* fix: fixed some documentation

* fix: fixed missign JSON file in docs

* fix: implemented proposed changes

* fix: better --save_sections help

* fix: better docstrings

* fix: fixed last docstring...hopefully :>

* feat: custom section output supported

* fix: removed resolved todos

* fix: added debug for movie concatenation back

* fix: removed implemented TODO

* fix: removed doubled log

* fix: changed debug to info log

* fix: fixed log test data
2021-10-20 10:36:24 +02:00
leleogere
522b83cdc7
Improved the implementation of :meth:.CoordinateSystem.get_area to work without Riemann rectangles, added new :meth:.CoordinateSystem.get_area_with_riemann_rectangles (#1990)
* Rename old get_area

* Add the new get_area method

* Test file

* Revert "Test file"

This reverts commit 7588d7aba6.

* Fix the gradient coloring

* Add the bounded parameter

* Add an example and reformat the docstring

* Update get_area_with_riemann_rectangles example in the docstring

* Modify the example in the Example Gallery to use the new get_area

* Modify the test for get_area_with_riemann_rectangles and add a test for get_area

* Add the npz for the tests

* Rename bounded parameter in bounded_graph

* Make the function handle different range for graph and bounded_graph

* Use point instead of get_points()

* Make more specific tests

* Change Sequence type to Tuple

Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.com>

* Update an example to enhance the difference between both `get_area` methods

* Fix a bug not taking into acount x_range

* Change the opacity of the area in the example to better see the area

* Fix a bug for non-overlapping ranges

* Add the exception to the docstring

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

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

* Remove `get_area_with_riemann_rectangles` and fix f-strings

* Remove references to `get_riemann_rectangles`

Co-authored-by: Léo Géré <leo.gere@inrae.fr>
Co-authored-by: Léo Géré <gere@etud.insa-toulouse.fr>
Co-authored-by: Hugues Devimeux <36239975+huguesdevimeux@users.noreply.github.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>
2021-10-02 00:00:17 +00:00
Laith Bahodi
d184d35b7b
Added examples, tests and improved documentation for coordinate_system.py. (#1941)
* add docs for get_x/y_axis_label and rename first parameter

* privatize methods that need to be private

* adjust docs for axis_labels and add buff parameter

* Add documentation and typing for ComplexPlane

* update point_to_coords docs

* add get_lines_to_point

* add example for coords_to_point

* add docs for get_line_to_point

* add example for get_vert/hori_line

* privatize create_label_tex

* add example for get_axis_labels

* add examples for get_x/y_axis_label

* add example for get_graph_label

* example for riemann rectangles

* add example for input_to_graph_point

* add example for get_area and add kwargs to method

* add doctests to slope_of_tangent + angle_of_tangent

* add example for get_secant_slope_group

* add example to get_vertical_lines_to_graph

* add Examples + touch ups

* add example and warning to get_graph

* pre-PR touchups

* revert accidental changes + fix docs error

* fix doctest

* fix doctest

* switch from dosctrings to code-blocks

* attempt at fixing obscure latex error

* Apply suggestions from code review

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

* formatting and general cleanup

* two typos and minor improvement

* add non-graphical tests

* add graphical tests and control data

* fix tests

* more test errors

* add get_z_axis_label

* deprecate get_center_point

* missing return statement on log_func

* Apply suggestions from code review

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

* rewrite failing 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>
2021-08-30 20:21:58 +00:00
Laith Bahodi
f7ed88008b
Add font_size parameter for Tex and Text mobjects. (#1694)
* refactor numbers.py, numbers.py now uses font_size, adjust constants in tex_mobject.py and text_mobject, remove uses of number_scale_value in favour of font_size

* adjust PolarPlane to use font_size instead of scaling

* some of the docs have been changed to use font_size, adjust constant and add font_size to markup text

* accurate scale factors

* code mobject compatibility with font_size

* number_line now takes font_size

* make tests work

* cleanup

* deprecated test raised error, fixed

* typing for NumberLine

* fix misbehaving test

* actually fix set_value

* use native font_size scaling for text_mobject.py

* add constant and adjust BraceLabel

* fix change_label

* drop scale_factor for Title

* add some supers

* maybe fixes import issues

* numberplanetest

* the merge conflict is over and the tests run

* add test for tex_size

* some changes to the docs

* properly deprecate instead of removing

* move deprecations to __init__

* drop the config

* deprecate number_Scale_value

* update version number for deprecation

* adjust test precision

* if TYPE_CHECKING check

* adjust Using Text

* add font_size parameters for numberline and fix bug with decimal_number_config

* make set_value work with opengl

* make kwarg

* fix typo

* another typo

* change dates

* add font_size property for tex_mobjects

* _font_size instead of font_size (prep for prop)

* accidental bugfix, handle separately)

* generalize text2svg

* add font_size property for text_mobject.py

* add check for greater than 0

* Attribute error in dd_labels

* str for attr in hasattr

* rewrite and fix tests

* remove debugging print

* fix error when self.height ==0

* Apply suggestions from code review

Co-authored-by: Darylgolden <darylgolden@gmail.com>

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

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

* revert accidental @deprecated change

* fix error in line_spacing

* slight fixes

* use private attribute when checking for font_size in add_labels()

* raise a Value error when font_size < 0 + improve docs

* Apply suggestions from code review

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

* deprecate azimuth_label_scale and use more descriptive deprecation message

* wrong number of dots for an import

* add font_size property for decimalmobject

* return to using public attribute

* remove redundant constant

* add comment

Co-authored-by: Darylgolden <darylgolden@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>
2021-08-26 20:16:55 -04:00
Laith Bahodi
6eed276330
Removed :class:~.GraphScene, :class:~.NumberLineOld and parameters for :class:~.ChangingDecimal (#1860)
* remove NumberLineOld and GraphScene

* delete graphscene tests, shift plotfunctions test

* rewrite tests and fix __init__.py

* remove deprecation warning

* Update manim/animation/numbers.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-08-04 01:04:18 -04:00
Laith Bahodi
3cd2a27780
Allow non-numerical values to be added to :class:~.NumberLine/:class:~.Axes (#1780)
* add add_labels for number_line

* fix bug in add_numbers

* change to self

* drop add_coordinate_labels

* add somed docs

* improve docs

* forgot :class:

* fix typing

* remove redundancies

* typing error

* dict --> Dict

* introduce scaling in `add_labels` 

quite annoying to manually adjust size (especially without `font_size`)

* added tests

* don't use Text in testing
2021-08-01 18:37:58 -04:00
Hugues Devimeux
b46b860e97
Converted all the graphical tests to the new syntax (Tests PR 3/3). (#1836)
* Added direct decoration support, and auto naming test.

* format

* Misclearnous fixes and improvements of the testing system

* Converted tests.

* Removed ununsed imports

* Added tolerance

* save frames as uint8

* regenerate control data

* migrate other tests that have been added in the meantime

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

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

* try to make pre-commit happy

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>
2021-08-01 13:41:14 +02:00
Laith Bahodi
0561bebe76
Fixed accidental displacement in :class:~.Axes caused by include_numbers/numbers_to_include (#1664)
* the changes

* refactor a bit and change order of dict_merging so that it does not overwrite

* adjust test

* add docstring

* check against None

* implement the suggestion from comments + minor tweaking

* fix get_axis_labels

* adjust y_axis_label value slightly

* adjust test and refactor numberplane to remove redundant parameters

* better solution

* make .add_coordinates() file wide and nuke get_coordinate_labels

* code block

* drop uncessary assignmnets to the axes

* Apply suggestions from code review

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

* include_tips --> tips in the docs

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>
2021-06-20 02:51:10 -04:00
hydrobeam
9e88b64cd4
Upgrades to CoordinateSystem and graphing. (#1161)
* coordinate_systems.py

* number_line.py

* functions.py

* forgot to remove logging

* remove mutables in UnitInterval and restore things that shouldn't have been factored out

* visual changes + add backup in case only two args are given to x_range

* test_axes.py test reworked

* test_axes.py add tips

* coordinate_system + systems test and minor update to .py

* test_functions and mini-rework of funtions.py

* black and graph_scene test

* add defaults for threeDaxes

* all tests pass, threed updates

* make graphscene functional

* formatting

* test_axes_shift fix

* fix the broken test_axes_shift and docs

* forgot negative in docs

* missing commas

* fix broken example in graphscene.py

* forgot comma... again

* line_projection, import cleanup, and variable cleanup

* get_tick_range all numbers

* revert examples.rst

* restore GraphScene, deprecate it, introduce OldNumberLine

* rever test_axes_shift.py

* test_graphscene_reverted

* poetry error

* test_coord_system fix (?)

* unecssary import in graphscene

* black

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

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

* fix tests (?)

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

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

* add rounding for default coord_range + projection docs

* adjust test for rounding

* add zero fix

* used wrong fix

* set_length instead of rescale_to_fit

* fix improper coordinates for default NumberPlane

* update test

* adjust defaults for NumberLine and introduce dynamic scaling

* test adjusted

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

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

* explanations + create axis docs

* parameters for NumberLine`

* NumberPlane documentation mods

* ThreeDAxes docs

* all done

* add colon for docs

* switch oldNUmberLine to NumberLineOld

* docs update for NumberLineOld

* Update manim/mobject/number_line.py

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

* Update manim/mobject/number_line.py

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

* Update manim/mobject/number_line.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

* suggestions from code review

* missing period

* adjust wording for create_axis

* fix merge conflict (?)

* [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>
2021-04-30 20:40:51 +02:00
Benjamin Hackl
7b5d29e9b3
Fix random pipeline TeX failures (#1296)
* try to free us from curse of horse and cucumber

* adapt control data
2021-04-09 10:28:13 +02:00
Benjamin Hackl
e16f9a6cc4
Basic implementation of undirected graphs (#861)
* toying around with a graph using networkx layouting

* basic implementation and documentation of a class for undirected graphs

* import graph module into global namespace

* add graph module to documentation

* poetry: add networkx as a dependency

* remove some debug prints

* sort all extracted mobjects w.r.t. z_index

* add test for z_index (from #327)

* more complex z_index test

* black

* improve imports

* use z_index to have edges below vertices

* add type hints

* rename some tests to make space for graph tests

* fix problem with manual positioning

* add test

* black

* new animate syntax

* document label_fill_color
2020-12-31 21:10:41 +01:00