manim icon indicating copy to clipboard operation
manim copied to clipboard

`CurvesAsSubmobjects` error messages contain hardcoded class names

Open nikolajmunk opened this issue 3 months ago • 7 comments

The class CurvesAsSubmobjects throws two custom error messages for when it either has no submobjects or it has no submobjects with points: https://github.com/ManimCommunity/manim/blob/cafc63919eb03d398d7038a8c82e591b12de8da5/manim/mobject/types/vectorized_mobject.py#L2858-L2874 These error messages contain a hardcodes class name, causing issues if CurvesAsSubmobjects is subclassed. This should be fixed.

This implementation was originally a response to a hardcoded class name in the throw_error_if_no_points method of Mobject, but that has since been made dynamic (#4927) so this override is now unnecessary. It's possible that the "no submobjects with points" case might need special handling in CurvesAsSubmobjects, but it should likely be based on the error message produced in Mobject.throw_error_if_no_points. Or perhaps Mobject needs a throw_error_if_no_submobjects_with_points method? Not sure, use your best judgment.

This issue is labeled "good first issue" and is intended for a human who wants to start contributing to the library, so AI-generated pull requests are discouraged. Say hi either here or on Discord if you are interested in familiarising yourself with the codebase, we're happy to provide pointers.

nikolajmunk avatar Sep 01 '26 19:09 nikolajmunk

I have updated the scope of this issue a bit in order to avoid treating symptoms. I'll let the authors of the 6 (!) open PRs regarding this know, plus update them on the intention behind "good first issue" in this repo. (If you want to send a slop PR, check one of the other, non-"good first issue"-issues; contributions are appreciated.)

behackl avatar Sep 22 '26 23:09 behackl

@behackl are the LLMs (including yours) not overcomplicating this? Mobject already handles the throw_error_if_no_points correctly as of #4927, so it seems like this issue can be solved by simply removing the special case. Or am I missing something?

nikolajmunk avatar Sep 23 '26 07:09 nikolajmunk

No, it is quite likely it was a bit too late for me yesterday so that I missed that. I'll take another look in a few hours to clean this up. Thanks for the heads-up!

behackl avatar Sep 23 '26 07:09 behackl

For the record, that was at least my intention with this issue at the beginning - my hope was that a new contributor would spot that CurvesAsSubmobjects is basically reimplementing the behavior of its superclass and that they would get to do a nice, clean, negative-LOC diff to boost their confidence 😄

nikolajmunk avatar Sep 23 '26 07:09 nikolajmunk

I'll have a go at this issue, nvm my group choose that we are working on a different repo

Constant-Sudo avatar Oct 14 '26 05:10 Constant-Sudo

Hi! I'd like to work on this issue as part of a university course. Could it be assigned to me if no one else is working on it? Thanks!

patilmandar2003 avatar Oct 18 '26 04:10 patilmandar2003

16. Hi! I'd like to work on this issue as part of a university course. Could it be assigned to me if no one else is working on it? Thanks!

There is already an open PR, so I would recommend to look for another issue.

GniLudio avatar Oct 18 '26 07:10 GniLudio