Skip to content
Merged

Docs #347

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c808ca9
add output of manim -h to the documentation, as a poor man documentat…
leotrs Aug 15, 2020
9e43912
document config system and general changes in the description of each…
leotrs Aug 15, 2020
e11418d
run black
leotrs Aug 15, 2020
5a7eea3
MacOS
PgBiel Aug 15, 2020
4880210
update
leotrs Aug 16, 2020
a539a40
Merge branch 'master' into docs
leotrs Aug 16, 2020
d2a5ff2
Add configuration.rst back to the toctree. Add the contributing guide…
leotrs Aug 16, 2020
d094efe
add the symlinks
leotrs Aug 16, 2020
ab78278
fix length of underlines
leotrs Aug 16, 2020
f8fae7a
update contributing guidelines
leotrs Aug 16, 2020
aa5cb79
resolve merge conflicts
leotrs Aug 16, 2020
fee423d
Update CONTRIBUTING.md
leotrs Aug 17, 2020
63a7972
Update CONTRIBUTING.md
leotrs Aug 17, 2020
47e5d8a
Update CONTRIBUTING.md
leotrs Aug 17, 2020
909c93b
Update CONTRIBUTING.md
leotrs Aug 17, 2020
9406590
fix indices
leotrs Aug 17, 2020
058e6cc
some updates from the team
leotrs Aug 18, 2020
21eafe5
merge conflicts
leotrs Aug 18, 2020
56cdb7a
update document
leotrs Aug 18, 2020
f0ff2f0
Update CONTRIBUTING.md
leotrs Aug 20, 2020
e9a48ea
Update CONTRIBUTING.md
leotrs Aug 20, 2020
c98c80e
update
leotrs Aug 20, 2020
0f34d12
Merge branch 'docs' of github.com:ManimCommunity/manim into docs
leotrs Aug 20, 2020
428a316
solve merge conflicts
leotrs Aug 25, 2020
cd2555f
remove old files
leotrs Aug 25, 2020
ca16dcb
docs update
leotrs Aug 25, 2020
7dc24ad
add some module docstrings
leotrs Aug 25, 2020
f1c6cf6
add some breathing room in the generated autosummaries
leotrs Aug 25, 2020
b86b16e
edit template so it generates cleaner output
leotrs Aug 25, 2020
2031f75
document add and remove
leotrs Aug 25, 2020
721cb07
document new conf.py option
leotrs Aug 25, 2020
e38a4db
remove blank line
leotrs Aug 25, 2020
8a1f039
updates from code review
leotrs Aug 26, 2020
88d56b1
update from code review
leotrs Aug 27, 2020
4eab0cc
updates from code review
leotrs Aug 28, 2020
25e82d2
final update from code review
leotrs Aug 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
td {
padding: 0px 10px 0px 10px;
}
18 changes: 9 additions & 9 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
.. autoclass:: {{ objname }}

{% block methods %}
{% if methods %}
{%- if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:nosignatures:
:toctree: .
{% for item in methods if item != '__init__' and item not in inherited_members %}
~{{ name }}.{{ item }}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{%- endif %}
{%- endblock %}

{% block attributes %}
{% if attributes %}
{%- if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{%- endif %}
{% endblock %}
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# This specifies any additional css files that will override the theme's
html_css_files = ['custom.css']
1 change: 1 addition & 0 deletions manim/animation/animation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Animate mobjects."""
from copy import deepcopy

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions manim/animation/composition.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Tools for displaying multiple animations at once."""
import numpy as np

from ..animation.animation import Animation
Expand Down
3 changes: 2 additions & 1 deletion manim/animation/creation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Animate the display or removal of a mobject from a scene."""
from ..animation.animation import Animation
from ..animation.composition import Succession
from ..mobject.types.vectorized_mobject import VMobject
Expand Down Expand Up @@ -131,7 +132,7 @@ def update_submobject_list(self, index):

class AddTextLetterByLetter(ShowIncreasingSubsets):
"""
Add a Text Object letter by letter on the scene. Use time_per_char to change frequency of appearance of the letters.
Add a Text Object letter by letter on the scene. Use time_per_char to change frequency of appearance of the letters.
"""

CONFIG = {
Expand Down
1 change: 1 addition & 0 deletions manim/animation/fading.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Fading in and out of view."""
from ..animation.animation import Animation
from ..animation.animation import DEFAULT_ANIMATION_LAG_RATIO
from ..animation.transform import Transform
Expand Down
1 change: 1 addition & 0 deletions manim/camera/camera.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"A Camera converts the mobjects contained in a Scene into an array of pixels"
from functools import reduce
import itertools as it
import operator as op
Expand Down
8 changes: 1 addition & 7 deletions manim/mobject/geometry.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
"""
geometry.py
-----------

Classes implementing geometric objects, mostly derived from MObject.

"""
"""Mobjects that are simple geometric shapes."""
import warnings
import numpy as np
import math
Expand Down
65 changes: 60 additions & 5 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
MObject: Base classes for all mathematical objects.
"""
"""Base classes for objects that can be displayed."""
from functools import reduce
import copy
import itertools as it
Expand Down Expand Up @@ -30,8 +28,13 @@


class Mobject(Container):
"""
Mathematical Object
"""Mathematical Object: base class for objects that can be displayed on screen.

Attributes
----------
submobjects : :class:`list`
The contained objects.

"""

CONFIG = {
Expand Down Expand Up @@ -69,6 +72,37 @@ def generate_points(self):
pass

def add(self, *mobjects):
"""Add mobjects as submobjects.

The mobjects are added to self.submobjects.

Parameters
----------
mobjects : List[:class:`Mobject`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we aren't expecting lists of mobjects, right?

Suggested change
mobjects : List[:class:`Mobject`]
mobjects : :class:`Mobject`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mobjects is always a list, no? How to specify it is packing all arguments passed?

The mobjects to add.

Returns
-------
:class:`Mobject`
:code:`self`

Raises
------
:class:`ValueError`
When a mobject tries to add itself.

Notes
-----
A mobject cannot contain itself, and it cannot contain a submobject
more than once. If the parent mobject is displayed, the newly-added
submobjects will also be displayed (i.e. they are automatically added
to the parent Scene).

See Also
--------
:meth:`~Mobject.remove`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean this can be shortened to just "remove" but we can let it be i guess


"""
if self in mobjects:
raise ValueError("Mobject cannot contain self")
self.submobjects = list_update(self.submobjects, mobjects)
Expand All @@ -80,6 +114,25 @@ def add_to_back(self, *mobjects):
return self

def remove(self, *mobjects):
"""Remove submobjects.

The mobjects are removed from self.submobjects, if they exist.

Parameters
----------
mobjects : List[:class:`Mobject`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mobjects : List[:class:`Mobject`]
mobjects : :class:`Mobject`

The mobjects to remove.

Returns
-------
:class:`Mobject`
:code:`self`

See Also
--------
:meth:`~Mobject.add`

"""
for mobject in mobjects:
if mobject in self.submobjects:
self.submobjects.remove(mobject)
Expand Down Expand Up @@ -1097,6 +1150,8 @@ def set_z_index_by_z_coordinate(self):


class Group(Mobject):
"""Groups together multiple Mobjects."""

def __init__(self, *mobjects, **kwargs):
if not all([isinstance(m, Mobject) for m in mobjects]):
raise Exception("All submobjects must be of type Mobject")
Expand Down
1 change: 1 addition & 0 deletions manim/mobject/number_line.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Mobject representing a number line."""
import operator as op

from ..constants import *
Expand Down
1 change: 1 addition & 0 deletions manim/mobject/svg/svg_mobject.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Mobjects generated from an SVG file."""
import itertools as it
import re
import os
Expand Down
1 change: 1 addition & 0 deletions manim/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Mobjects that use vector graphics."""
import itertools as it
import sys

Expand Down
1 change: 1 addition & 0 deletions manim/scene/scene.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""A Scene is the canvas of the animation."""
import inspect
import random
import warnings
Expand Down