Skip to content

Fixed NumberLine get_number_mobjects() and get_labels()#4638

Open
BillyLjm wants to merge 2 commits intoManimCommunity:mainfrom
BillyLjm:NumberLine
Open

Fixed NumberLine get_number_mobjects() and get_labels()#4638
BillyLjm wants to merge 2 commits intoManimCommunity:mainfrom
BillyLjm:NumberLine

Conversation

@BillyLjm
Copy link

@BillyLjm BillyLjm commented Mar 14, 2026

Overview: What does this pull request change?

Closes issue #2473, fixes NumberLine.get_number_mobjects() and the adjacent NumberLine.get_labels().

Motivation and Explanation: Why and how do your changes improve the library?

  • NumberLine.get_number_mobjects() used an unimplemented function and would a throw an error if used. This simply fixes it to use the return the mobject of all ticks in the number line.
  • NumberLine.get_labels() did not return the same thing as NumberLine.add_labels() which seems like a bug. So I fixed it to return self.labels, and default to the existing implementation if the attribute is not accessible.

Links to added or changed documentation pages

None

Further Information and Comments

None

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

@BillyLjm BillyLjm changed the title Fixed NumberLine get_number_mobject() and get_labels() Fixed NumberLine get_number_mobjects() and get_labels() Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant