an.capabilities.subjects#
The core’s two non-asset subjects: the engine (a renderer) and the environment.
Core study §2.13: a requirement can name what the engine draws (which shot
kinds it claims, which optional members it implements — previz’s rule, “a flag
can never disagree with the code”) and what the environment has (ffmpeg, a
browser, LaTeX, an API key). Each gets one minimal, real analyser here, owned by
the core and registered on import of an.capabilities:
engine— derived from the renderer object’s implemented members:engine.render(keys: theShot.renderervalues it claims) and oneengine.<member>per optional member it implements. When theEngineprotocol (P3) lands, its optional members joinENGINE_OPTIONAL_MEMBERSand nothing else changes. A stub whoserenderalways raises still claims its renderer here — the protocol cannot tell yet, and saying so is better than a declared flag that could lie.space.<name>: the view spaces it lowers (an#257), from aview_spacesmember, elseDFLT_ENGINE_VIEW_SPACES.environment— cheap probes only (PATHlookups, an import spec —env.manimismanimandmanimkitboth importable —, the Playwright browser cache, the presence of API-key variables — never their values). No subprocess, no import of the probed package.
Both analysers take their evidence as doc so a test can inject it:
environment_affordances(probe={"which": {...}, "env": {...}}).
>>> profile = environment_affordances(probe={"which": {"ffmpeg"}, "env": {}, "modules": set(), "browsers": False})
>>> sorted(profile)
['env.ffmpeg']
Module Attributes
|
|
|
|
Optional engine members a renderer may implement, each afforded as |
|
|
|
|
|
|
Functions
|
What a renderer (or a registered renderer's name) affords, from its members. |
|
What this machine affords: tools on PATH, a browser, API keys set. |
- an.capabilities.subjects.ENGINE_ANALYSER_VERSION: str = '3'#
engine.measure_durationjoined the derivation (an#279). “3”:engine.paint_orderjoined it (an#430).- Type:
”2”
- an.capabilities.subjects.ENGINE_OPTIONAL_MEMBERS: tuple[str, ...] = ('compile', 'preview', 'render_frames', 'seek', 'measure_duration')#
Optional engine members a renderer may implement, each afforded as
engine.<member>when it is a callable attribute of the renderer.measure_durationis how a whole-shot renderer that OWNS ITS CLOCK (Manim: only its ownplay/waitcalls decide how long a shot runs) says so — the core asks it for the length before laying out the film (an#279).
- an.capabilities.subjects.ENVIRONMENT_ANALYSER_VERSION: str = '2'#
env.manimjoined the derivation (an#279).- Type:
”2”
- an.capabilities.subjects.ENV_KEYS: dict[str, tuple[tuple[str, ...], str]] = {'env.key.anthropic': (('ANTHROPIC_API_KEY',), 'set ANTHROPIC_API_KEY (needed by `an iterate` and the vision verifier)'), 'env.key.elevenlabs': (('ELEVEN_API_KEY', 'ELEVENLABS_API_KEY'), 'set ELEVEN_API_KEY (needed by the ElevenLabs voices)')}#
capability: (environment variables, remedy)— afforded when any is set.
- an.capabilities.subjects.ENV_MODULES: dict[str, tuple[tuple[str, ...], str]] = {'env.manim': (('manim', 'manimkit'), "pip install 'an[manim]' (Manim Community Edition and manimkit; on Linux first `apt install libcairo2-dev libpango1.0-dev`)")}#
capability: (python modules, remedy)— afforded when EVERY module is importable (an import spec only: the module is never imported to find out).
- an.capabilities.subjects.ENV_TOOLS: dict[str, tuple[tuple[str, ...], str]] = {'env.ffmpeg': (('ffmpeg',), 'install ffmpeg (`brew install ffmpeg` on macOS, `apt install ffmpeg` on Debian)'), 'env.latex': (('latex', 'pdflatex', 'xelatex'), 'install a TeX distribution (MacTeX / TeX Live) so `latex` is on PATH'), 'env.node': (('node',), 'install Node.js (`brew install node`)'), 'env.rhubarb': (('rhubarb',), 'install Rhubarb Lip Sync (`brew install rhubarb-lipsync`)')}#
capability: (executables, remedy)— afforded when any executable is on PATH.
- an.capabilities.subjects.engine_affordances(renderer)[source]#
What a renderer (or a registered renderer’s name) affords, from its members.
>>> class Fake: ... supported_renderers = ("toy",) ... def render(self, shot, ctx): ... ... def preview(self, shot): ... >>> engine_affordances(Fake()) {'engine.render': {'keys': ['toy']}, 'engine.preview': {}}