manim icon indicating copy to clipboard operation
manim copied to clipboard

opengl: deprecate unused dim parameter on OpenGLMobject

Open Drunsdo opened this issue 5 months ago • 0 comments

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__().

Drunsdo avatar Jun 12 '26 17:06 Drunsdo