snnlab.viz
Complete API reference for viz, including exports and every declared module API.
Validate retained recordings, project renderer-neutral diagrams, compose deterministic figure layouts, and encode animations. Rendering must consume retained evidence with consistent physical timelines.
Imports
from snnlab import vizPackage exports
| Export | Defined in / value | Role |
|---|---|---|
Diagram | viz.diagrams | re-export |
DiagramEdge | viz.diagrams | re-export |
DiagramGroup | viz.diagrams | re-export |
DiagramNode | viz.diagrams | re-export |
DiagramTheme | viz.diagrams | re-export |
FigureGrid | viz.figure_grid | re-export |
FigureRect | viz.figure_grid | re-export |
FigureRegion | viz.figure_grid | re-export |
FrameTimeline | viz.animation | re-export |
Panel | viz.scene | re-export |
Recording | viz.contracts | re-export |
RecordingError | viz.contracts | re-export |
Scene | viz.scene | re-export |
Theme | viz.styles | re-export |
__version__ | '0.1.0' | Component format version; distinct from the combined distribution version. |
diagram_to_dot | viz.diagrams | re-export |
exponential_trace | viz.transforms | re-export |
grid_layout | viz.layouts | re-export |
load_snnsim_recording | viz.loaders | re-export |
projection_activity | viz.transforms | re-export |
render_diagram | viz.diagrams | re-export |
representative_frame | viz.transforms | re-export |
save_animation | viz.animation | re-export |
Modules
| Module | Responsibility |
|---|---|
| viz.animation | Timeline sampling and backend encoding helpers. |
| viz.contracts | Renderer-neutral retained evidence. All time-varying signal arrays must share a leading time axis, and dt_ms must be positive and finite. A Recording is not an instruction to rerun a simulation or replace absent evidence. |
| viz.diagrams | Renderer-neutral structural diagrams. Node ids are unique and all edge/group references must resolve. Graphviz renders the generated DOT; SVG and PNG are supported by render_diagram. Diagram styles and labels do not alter the source graph. |
| viz.figure_grid | Deterministic geometry in normalized figure coordinates. Row indices run top to bottom and columns left to right. Weighted tracks, gaps and reserved regions define a stable layout shared by stills and animation frames. |
| viz.layouts | Deterministic geometry helpers with no plotting-backend dependency. |
| viz.loaders | Adapters from native tool artifacts into renderer-neutral recordings. |
| viz.scene | An intentionally thin composition layer over Matplotlib. |
| viz.styles | The default snnviz house-style tokens. |
| viz.transforms | Reusable numerical transforms, independent of Matplotlib. |
Coverage and conventions
This reference includes every top-level non-private function and class, module-owned constant/type alias, declared public method/property, constructor and relevant protocol special method in the modules above. Data-class constructor fields include local inheritance. Third-party inherited APIs belong to their own libraries; underscore-prefixed implementation helpers are excluded. Imported standard-library and third-party names are not snnlab APIs.
Source docstrings are reproduced as text to preserve their parameter notes, examples, equations and formatting. Explicit exceptions are extracted from the implementation; indirect exceptions can also propagate. Expand the implementation panels for complete branch behavior, especially where legacy code has no annotations.
Regenerate with python3.12 docs/scripts/generate_api.py; --check fails if source-derived reference pages drift. Authored explanatory notes live in docs/scripts/api_notes.json.