manim
manim copied to clipboard
opengl: deprecate unused dim parameter on OpenGLMobject
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
dimandself.dimacross the codebase (including subclasses ofOpenGLMobject) to confirm the parameter is genuinely unused. - Deprecate the parameter with a
DeprecationWarningwhen 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 forwardsdimtosuper().__init__().