bencher.results.manim_cartesian =============================== .. py:module:: bencher.results.manim_cartesian .. autoapi-nested-parse:: Cartesian product animation for bencher sweep visualisation. Uses a PIL-based renderer for fast frame-by-frame rendering. No manim dependency required. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bencher/results/manim_cartesian/cartesian_product_cfg/index /autoapi/bencher/results/manim_cartesian/cartesian_product_scene/index Classes ------- .. autoapisummary:: bencher.results.manim_cartesian.CartesianProductCfg bencher.results.manim_cartesian.SweepVar Functions --------- .. autoapisummary:: bencher.results.manim_cartesian.from_bench_cfg bencher.results.manim_cartesian.render_animation Package Contents ---------------- .. py:class:: CartesianProductCfg Configuration describing an N-dimensional Cartesian product sweep. ``all_vars`` includes every dimension — input variables *and* meta variables (repeat, over_time). They are all first-class dimensions of the product. .. attribute:: all_vars Every dimension of the Cartesian product. .. attribute:: result_names Names of the result variables being collected. .. py:attribute:: all_vars :type: list[SweepVar] :value: [] .. py:attribute:: result_names :type: list[str] :value: [] .. py:attribute:: strobe_color :type: tuple[int, int, int] :value: (80, 80, 80) .. py:attribute:: strobe_pad :type: int :value: 12 .. py:attribute:: strobe_mark_size :type: int :value: 2 .. py:attribute:: strobe_mark_gap :type: int :value: 4 .. py:attribute:: strobe_mark_row_h :type: int :value: 16 .. py:attribute:: strobe_border_radius :type: int :value: 4 .. py:attribute:: strobe_base_border_w :type: int :value: 2 .. py:property:: ndim :type: int Number of dimensions. .. py:property:: shape :type: tuple[int, Ellipsis] Shape of the result tensor. .. py:property:: total_cells :type: int Total number of cells in the Cartesian product. .. py:class:: SweepVar A single dimension of the Cartesian product. .. attribute:: name Human-readable variable name (e.g. "theta", "repeat"). .. attribute:: values The sampled values for this dimension. .. py:attribute:: name :type: str .. py:attribute:: values :type: list[Any] :value: [] .. py:function:: from_bench_cfg(bench_cfg) -> CartesianProductCfg Build a :class:`CartesianProductCfg` from a ``BenchCfg`` instance. Uses ``bench_cfg.all_vars`` (input_vars + meta_vars) so that repeat and over_time are included as full dimensions — they are just more dimensions of the Cartesian product. This mirrors the extraction pattern in ``DimsCfg.__init__`` (``bench_cfg.py``). .. py:function:: render_animation(cfg: bencher.results.manim_cartesian.cartesian_product_cfg.CartesianProductCfg, width: int = 400, height: int = 300, fps: int = 15, step_frames: int = 4, output_dir: str = 'cachedir/cartesian') -> str Render the dimensional extrusion animation. :param cfg: Sweep configuration. :type cfg: CartesianProductCfg :param width: Video resolution. :type width: int :param height: Video resolution. :type height: int :param fps: Frames per second. :type fps: int :param step_frames: Frames to show each extrusion step (per sub-copy). :type step_frames: int :param output_dir: Directory for the output video. :type output_dir: str :returns: Path to the output animation file. :rtype: str