Skip to content

Commit

Permalink
add doctrings to remaining geometry classes (#18)
Browse files Browse the repository at this point in the history
* add doctrings to remaining geometry classes

* style: pre-commit fixes

* Update riemapp/geometry.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Saransh <[email protected]>
  • Loading branch information
3 people authored Sep 29, 2022
1 parent d812559 commit 8e5a29d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions riemapp/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,43 @@ def __repr__(self) -> str:


class Polygon(manim.Polygon):
"""
Constructs a shape consisting of one close loop of vertices.
An alias class for manim.Polygon.
Args:
*vertices:
Polygon's vertices points
"""

def __init__(
self, *vertices: Sequence[Sequence[float]], **kwargs: dict[str, Any]
) -> None:
self.vertices = vertices
manim.Polygon.__init__(self, *vertices, **kwargs)

def __repr__(self) -> str:
return f"Polygon(vertices={[v for v in self.vertices]})"
return f"Polygon(vertices={[v for v in self.vertices]}) (alias for manim.Rectangle)"


class RegularPolygon(manim.RegularPolygon):
"""
Constructs a n-sided regular Polygon.
An alias class for manim.RegularPolygon.
Args:
n:
number of sides of the RegularPolygon
"""

def __init__(self, n: int, **kwargs: dict[str, Any]) -> None:
self.n = n
manim.RegularPolygon.__init__(self, self.n, **kwargs)

def __repr__(self) -> str:
return f"RegularPolygon(n={self.n})"
return f"RegularPolygon(n={self.n}) (alias for manim.Rectangle)"


class Triangle(manim.Triangle):
Expand Down

0 comments on commit 8e5a29d

Please sign in to comment.