Skip to content

Conversation

@Aathish04
Copy link
Member

DocStrings for viable methods of Camera, MovingCamera, ThreeDCamera, MappingCamera and MultiCamera have been added.

Some methods were not mentioned outside of their definitions, and DocStrings for these could be made more detailed.

The previous DocStrings written for classes in manimlib/scene have been updated to follow the numpy documentation format.

Aathish Sivasubrahmanian and others added 4 commits May 20, 2020 15:24
Removed trailing whitespaces.
and BackgroundColoredVMobjectDisplayer
Some methods were not mentioned outside of their definitions, and have less detailed docstrings.
Added DocStrings for Camera type objects, and updated DocStrings for Scene type objects.
def add_fixed_in_frame_mobjects(self, *mobjects):
"""This method allows the mobject to have a fixed position,
even when the camera moves around.
E.G If it was passed through this method, at the top of the frame, it
Copy link
Member

Choose a reason for hiding this comment

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

nit: e.g. should have a . after the g and the two letters needn't both be capitalized.

@PgBiel PgBiel added the documentation Improvements or additions to documentation label May 21, 2020
@Aathish04 Aathish04 requested a review from PgBiel May 21, 2020 19:00
@leotrs leotrs merged commit bb4ae2c into master May 21, 2020
@leotrs leotrs deleted the docs branch May 21, 2020 19:27
Copy link
Member

@PgBiel PgBiel left a comment

Choose a reason for hiding this comment

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

i decided to stop reviewing midway, plz guys next time wait for a pending review
I'll make another PR to fix all this

Some important CONFIG values and local variables to note are:
self.background_image : str, optional
Copy link
Member

Choose a reason for hiding this comment

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

Wrong format for attributes. (Note: with dataclasses we will be able to deal with this more appropriately.)
For now...

"""(...)
    Attributes
    ----------
        background_image : str, optional
            The path to an image that should be the background image.
            If not set, the background is filled with `self.background_color`
    
        pixel_height : int
            (Text here???)
"""

}

def __init__(self, background=None, **kwargs):
"""Initialises the Camera.
Copy link
Member

Choose a reason for hiding this comment

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

Init documentation goes into the class docstring, using "Parameters". (Just move the Parameters section to the class docstring.)

Parameters
----------
new_height : int, float
Copy link
Member

Choose a reason for hiding this comment

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

  1. Use Union[a, b] for multiple type possibilities.
  2. Use :class:`int`, :class:`float`

----------
new_height : int, float
The new height of the entire scene in pixels
new_width : int, float
Copy link
Member

Choose a reason for hiding this comment

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

^

Returns
-------
int
Copy link
Member

Choose a reason for hiding this comment

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

:class:`int`

Parameters
----------
pixel_array : np.array, list, tuple
Copy link
Member

Choose a reason for hiding this comment

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

Union, class

----------
pixel_array : np.array, list, tuple
The pixel array to convert and then set as the camera's pixel array.
convert_from_floats : bool, optional
Copy link
Member

Choose a reason for hiding this comment

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

class

Parameters
----------
pixel_array : np.array, list, tuple
Copy link
Member

Choose a reason for hiding this comment

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

Union, class

----------
pixel_array : np.array, list, tuple
The pixel array to set the background to.
convert_from_floats : bool, optional
Copy link
Member

Choose a reason for hiding this comment

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

class

Returns
-------
Camera
Copy link
Member

Choose a reason for hiding this comment

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

:class:`Camera`

@PgBiel PgBiel restored the docs branch May 22, 2020 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants