Skip to content

Improve Line Class: Add Docstrings, Remove None Handling for path_arc, and Simplify Logic #4223

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

irvanalhaq9
Copy link
Contributor

@irvanalhaq9 irvanalhaq9 commented Apr 20, 2025

Overview: What does this pull request change?

  1. In Line: Set default path_arc to 0, removed None Handling related to path_arc, and simplify _account_for_buff()
  2. In Line: Add docstring

Motivation and Explanation

Explanation 1:

  • Removed None Handling for path_arc: The need for handling None before was because it was set to be the default value of path_arc. By changing the default to float 0, handling None becomes unnecessary. This simplifies the logic and eliminates the check for None. Changing the type of path_arc to just float also aligns with the method signatures of set_points_by_ends() and _account_for_buff(), where the type hint for path_arc is float only.
  • Removed Irrelevant TODO Comment: The TODO comment related to handling None for path_arc is removed, as it is no longer needed.
  • Removed Redundant return statement.

Explanation 2:

  • Added Docstrings: Docstrings have been added to improve code documentation and readability.
  • Added Example Usage: Example usage has been added to the docstring.

Links to added or changed documentation pages

https://manimce--4223.org.readthedocs.build/en/4223/reference/manim.mobject.geometry.line.Line.html

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

1 participant