ManimCommunity / ManimCommunity/manim
opengl: deprecate unused dim parameter on OpenGLMobject
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Source
Two related sites in `manim/mobject/opengl/opengl_mobject.py`
(as of HEAD ):
Line 156 — the parameter declaration in `OpenGLMobject.__init__`:
```
def __init__(
self,
color: ParsableManimColor | Sequence[ParsableManimColor] = WHITE,
opacity: float = 1,
dim: int = 3, # TODO, get rid of this
...
```
Line 185 — the instance attribute assignment:
`self.dim: int = dim # TODO, get rid of this`
## Problem
The `dim` parameter on `OpenGLMobject.__init__` is paired with two in-source TODOs asking for its removal. The parameter is declared with a default of `3`, stored as `self.dim`, and does not appear to be consulted anywhere in the constructor or in obvious downstream code paths. It looks like a vestigial parameter from an earlier version of the class.
Because `dim` is a public constructor parameter, code outside the project may pass it explicitly. Direct removal would be a breaking change.
## Suggested approaches
- Audit all references to `dim` and `self.dim` across the codebase (including subclasses of `OpenGLMobject`) to confirm the parameter is genuinely unused.
- Deprecate the parameter with a `DeprecationWarning` when callers pass it explicitly, suggesting they stop doing so.
- After a deprecation period, remove the parameter and the attribute.
- Apply the same treatment to any subclass `__init__` that forwards `dim` to `super().__init__()`.
Contributor guide
Research direction
Start in manim/mobject/opengl/opengl_mobject.py at OpenGLMobject.__init__ lines 156 and 185. Audit all references to dim and self.dim across the codebase, including subclasses that forward dim to super().__init__(). Done means the unused public parameter has a documented deprecation path, explicit callers receive the intended warning, and affected subclasses are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100