-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added DocStrings for Camera type objects, and updated DocStrings for Scene type objects. #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use Union[a, b] for multiple type possibilities.
- Use
:class:`int`, :class:`float`
| ---------- | ||
| new_height : int, float | ||
| The new height of the entire scene in pixels | ||
| new_width : int, float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
| Returns | ||
| ------- | ||
| int |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class
| Returns | ||
| ------- | ||
| Camera |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:class:`Camera`
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.