ManimCommunity / ManimCommunity/manim
AttributeError: NumberLine object has no attribute 'default_numbers_to_display' when calling get_number_mobjects()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
When attempting to use `get_number_mobjects()` on a `NumberLine` object, I encountered the following error:
```
AttributeError: NumberLine object has no attribute 'default_numbers_to_display'
```
It seems like the method `get_number_mobjects()` internally calls `self.default_numbers_to_display()`, but this method is either missing or no longer available in the current implementation of `NumberLine`.
## Expected behavior
Calling `get_number_mobjects()` with no arguments should use default numbers (e.g., from `x_range`) to generate label mobjects.
## How to reproduce the issue
1. Create a `NumberLine` object.
2. Call `get_number_mobjects()` without passing any explicit numbers.
3. Run the scene.
Code for reproducing the problem
```py
from manim import *
class IntroductionToComplexNumbers(Scene):
def construct(self):
# Create real number line
real_number_line = NumberLine(
x_range=[-5, 5, 1],
length=10,
include_tip=False,
)
real_number_line_labels = real_number_line.get_number_mobjects()
self.add(real_number_line, *real_number_line_labels)
```
## Logs
Terminal output
[Logs](https://pastebin.com/bW1jRatq)
## System specifications
System Details
```
Environment
* **OS:** Windows 11
* **Manim version:** (e.g., v0.19.0)
* **Python version:** (e.g., 3.10)
* **Installation:** pip
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the NumberLine implementation and the get_number_mobjects() entry point described in the report. Reproduce the provided scene, then verify that calling the method without arguments no longer raises AttributeError and creates labels from x_range.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100