Repository navigation
Conversation
|
Thank you for this contribution, this mostly looks right. Thanks for flipping the MRO of Your PR introduces two new tests, |
|
Also, I note that the CI tools failed on building the docs. I'm not sure whether or not this is something caused by your code, but if you get the time, I'd appreciate if you tried building the docs locally to see if you get the same error. |
|
AI-assisted follow-up on the local documentation build request: The normal local Sphinx build stops earlier because this machine has no .. manim:: ImageSmoke
:save_last_frame:
import numpy as np
class ImageSmoke(Scene):
def construct(self):
self.add(ImageMobject(np.full((2, 2, 4), 255, dtype=np.uint8)))With Python 3.13.14, Sphinx 8.2.3 and Pillow 13.0.0, this fails on both the PR head ( Image.fromarray(np.zeros((self.pixel_height, self.pixel_width)), mode="RGBA")
# ValueError: Invalid mode for data typeThe same Sphinx rendering example succeeds on the PR head with Pillow 12.3.0. This reproduces the image-rendering failure independently of the initializer changes. The full HTML build with No Pillow or camera changes have been added to this PR. The request for a personal explanation of the two tests is still awaiting the author's own reply. |
Overview: What does this pull request change?
Uses cooperative initialization for
AxesandSplitScreenCamera, and updates theLinearTransformationSceneandZoomedScenesubclass examples to usesuper().Refs #5067. This covers the axes/camera portion, not the whole issue. Arrow-tip initialization is already being addressed in #4959; this PR leaves
tips.pyand those tests untouched.Motivation and Explanation: Why and how do your changes improve the library?
Axescurrently initializesVGroupandCoordinateSystemexplicitly. Replacing those calls alone would not work:CoordinateSystemcomes afterMobjectin the MRO, andMobjectdoes not forward initialization. This change placesCoordinateSystembeforeVGroupand lets it consume its coordinate options and forward the remaining arguments. Mobject initialization still happens before the coordinate attributes are set, preserving the existing order. A regression checks that a coordinate-system subclass in the MRO is initialized once, with both Cairo and OpenGL.SplitScreenCameracallsCamerabeforeOldMultiCamerahas createdshifted_cameras. The overriddeninit_background()then accesses that missing field. It now initializes its parent once and registers the resized cameras through a small private helper, without repeating initialization or losing the supplied camera options. For odd pixel widths, the right camera gets the remaining width. Tests check initialization count, dimensions and composed pixel arrays.Links to added or changed documentation pages
The
CoordinateSystemdocstring explains cooperative base ordering. The existingLinearTransformationSceneandZoomedScenesubclass examples now usesuper().Further Information and Comments
Local verification on macOS / Python 3.13.14:
git diff --checkpasses.The first full runs exposed a missing Manim console entry point on PATH. After correcting PATH, both baseline and patched suites were rerun successfully. No existing test expectations or control images were changed. A full Sphinx build was not run; hosted checks are separate from these local results.
Codex assisted with the implementation, tests, local checks and this description.
Reviewer Checklist