ManimCommunity/manim

Confusing/Misleading docstring for cartesian_to_spherical

Open

#3.123 geöffnet am 15. Jan. 2023

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.378 Forks)batch import
good first issue

Repository-Metriken

Stars
 (17.820 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 17h) (4 gemergte PRs in 30 T)

Beschreibung

I was using cartesian_to_spherical in space_ops.py but got confused by the docstring. In there it says it returns (distance, phi, theta) however what the function calls phi and theta is not returned in that order. Because both cartesian_to_spherical and spherical_to_cartesian use this order one can convert back and forth. See https://github.com/ManimCommunity/manim/blob/main/manim/utils/space_ops.py#L736-L776 .

However I think the order is confusing, or at least inconsistent with things like the value trackers of ThreeDCamera.

I'm not sure what the way to tackle issues like this is so although I initially wanted to submit a PR fixing the docstring I don't know if that is even correct anymore.

Contributor Guide