Backend Sessions¶
These modules are useful when you are subclassing a live backend or adjusting the default scene-building behavior.
NEURON Backend¶
neuron ¶
Public NEURON backend entrypoints for live session authoring.
Classes:
| Name | Description |
|---|---|
NeuronSceneBuilder |
Build default morphology geometry and Scene objects for NEURON sessions. |
NeuronSession |
Base class for live NEURON-backed CompNeuroVis sessions. |
NeuronSceneBuilder ¶
Build default morphology geometry and Scene objects for NEURON sessions.
Methods:
| Name | Description |
|---|---|
build_morphology_geometry |
Convert NEURON sections with pt3d data into MorphologyGeometry. |
build_scene |
Build the default morphology-plus-trace Scene for a NEURON session. |
Attributes:
| Name | Type | Description |
|---|---|---|
DISPLAY_FIELD_ID |
|
|
HISTORY_FIELD_ID |
|
|
TRACE_FIELD_ID |
|
build_morphology_geometry
staticmethod
¶
Convert NEURON sections with pt3d data into MorphologyGeometry.
build_scene
staticmethod
¶
build_scene(
*,
geometry: MorphologyGeometry,
display_values: ndarray,
trace_values: ndarray,
trace_segment_ids: ndarray,
trace_times: ndarray,
display_field_id: str | None = None,
history_field_id: str | None = None,
display_unit: str | None = None,
history_unit: str | None = None,
morphology_color_map: str = "scalar",
morphology_color_limits: tuple[float, float]
| None = None,
morphology_color_norm: str = "auto",
trace_title: str = "Trace",
trace_y_label: str = "Value",
trace_y_unit: str | None = None,
controls=None,
actions=None,
title: str = "CompNeuroVis",
control_ids: tuple[str, ...] | None = None,
action_ids: tuple[str, ...] | None = None,
) -> Scene
Build the default morphology-plus-trace Scene for a NEURON session.
NeuronSession ¶
NeuronSession(
*,
dt: float = 0.1,
v_init: float = -65.0,
max_samples: int = 1000,
display_dt: float | None = 0.1,
history_capture_mode: HistoryCaptureMode
| str = HistoryCaptureMode.ON_DEMAND,
title: str = "CompNeuroVis",
)
Bases: BufferedSession, ABC
Base class for live NEURON-backed CompNeuroVis sessions.
Methods:
| Name | Description |
|---|---|
startup_scene |
|
read_updates |
|
is_live |
|
shutdown |
|
emit |
|
build_sections |
Return the NEURON sections that define the model morphology. |
setup_model |
Insert mechanisms, stimuli, or recorders after sections are created. |
control_specs |
|
action_specs |
|
control_order |
|
action_order |
|
trace_view_updates |
|
display_field_id |
|
history_field_id |
|
display_unit |
|
history_unit |
|
morphology_color_map |
|
morphology_color_limits |
|
morphology_color_norm |
|
trace_title |
|
trace_y_label |
|
trace_y_unit |
|
apply_control |
|
apply_action |
|
on_action |
|
on_key_press |
|
on_entity_clicked |
|
should_capture_trace_on_click |
|
record |
Register one NEURON variable ref for batched PtrVector sampling. |
record_many |
Register NEURON variable refs for sampling once per fadvance step. |
on_recorded_samples |
Handle one batched set of values registered with record()/record_many(). |
build_scene |
Build the initial Scene from sampled values and morphology geometry. |
initialize |
Initialize the NEURON model, sample it once, and return the first Scene. |
recorded_values |
|
steps_per_update |
|
idle_sleep |
|
advance |
Advance the simulation and emit incremental frontend updates. |
handle |
|
Attributes:
| Name | Type | Description |
|---|---|---|
HISTORY_CAPTURE_ON_DEMAND |
|
|
HISTORY_CAPTURE_FULL |
|
|
dt |
|
|
v_init |
|
|
max_samples |
|
|
display_dt |
|
|
history_capture_mode |
|
|
title |
|
|
sections |
|
|
geometry |
|
HISTORY_CAPTURE_ON_DEMAND
class-attribute
instance-attribute
¶
history_capture_mode
instance-attribute
¶
build_sections
abstractmethod
¶
Return the NEURON sections that define the model morphology.
setup_model ¶
Insert mechanisms, stimuli, or recorders after sections are created.
record ¶
Register one NEURON variable ref for batched PtrVector sampling.
record_many ¶
Register NEURON variable refs for sampling once per fadvance step.
on_recorded_samples ¶
Handle one batched set of values registered with record()/record_many().
build_scene ¶
Build the initial Scene from sampled values and morphology geometry.
Jaxley Backend¶
jaxley ¶
Public Jaxley backend entrypoints for live session authoring.
Classes:
| Name | Description |
|---|---|
JaxleySceneBuilder |
Build default morphology geometry and Scene objects for Jaxley sessions. |
JaxleySession |
Base class for live Jaxley-backed CompNeuroVis sessions. |
JaxleySceneBuilder ¶
Build default morphology geometry and Scene objects for Jaxley sessions.
Methods:
| Name | Description |
|---|---|
build_morphology_geometry |
Convert Jaxley morphology/network data into MorphologyGeometry. |
build_scene |
Build the default morphology-plus-trace Scene for a Jaxley session. |
Attributes:
| Name | Type | Description |
|---|---|---|
DISPLAY_FIELD_ID |
|
|
HISTORY_FIELD_ID |
|
|
TRACE_FIELD_ID |
|
build_morphology_geometry
staticmethod
¶
build_morphology_geometry(
nodes,
*,
xyzr: list[ndarray] | tuple[ndarray, ...] | None = None,
cell_names: list[str] | tuple[str, ...] | None = None,
) -> MorphologyGeometry
Convert Jaxley morphology/network data into MorphologyGeometry.
build_scene
staticmethod
¶
build_scene(
*,
geometry: MorphologyGeometry,
display_values: ndarray,
trace_values: ndarray,
trace_segment_ids: ndarray,
trace_times: ndarray,
display_field_id: str | None = None,
history_field_id: str | None = None,
display_unit: str | None = None,
history_unit: str | None = None,
morphology_color_map: str = "scalar",
morphology_color_limits: tuple[float, float]
| None = None,
morphology_color_norm: str = "auto",
trace_title: str = "Trace",
trace_y_label: str = "Value",
trace_y_unit: str | None = None,
controls=None,
actions=None,
title: str = "CompNeuroVis",
control_ids: tuple[str, ...] | None = None,
action_ids: tuple[str, ...] | None = None,
) -> Scene
Build the default morphology-plus-trace Scene for a Jaxley session.
JaxleySession ¶
JaxleySession(
*,
dt: float = 0.1,
v_init: float = -70.0,
max_samples: int = 1000,
display_dt: float | None = 0.1,
history_capture_mode: HistoryCaptureMode
| str = HistoryCaptureMode.ON_DEMAND,
title: str = "CompNeuroVis",
)
Bases: BufferedSession, ABC
Base class for live Jaxley-backed CompNeuroVis sessions.
Methods:
| Name | Description |
|---|---|
startup_scene |
|
read_updates |
|
is_live |
|
shutdown |
|
emit |
|
build_cells |
Return one Jaxley cell or an iterable of cells for the session. |
build_network |
Build the Jaxley network from the returned cells. |
setup_model |
Configure channels, stimuli, recordings, or other runtime setup. |
cell_names |
|
control_specs |
|
action_specs |
|
control_order |
|
action_order |
|
trace_view_updates |
|
display_field_id |
|
history_field_id |
|
display_unit |
|
history_unit |
|
morphology_color_map |
|
morphology_color_limits |
|
morphology_color_norm |
|
trace_title |
|
trace_y_label |
|
trace_y_unit |
|
apply_control |
|
apply_action |
|
on_action |
|
on_key_press |
|
on_entity_clicked |
|
should_capture_trace_on_click |
|
build_scene |
Build the initial Scene from sampled values and morphology geometry. |
initialize |
Initialize the Jaxley model, sample it once, and return the first Scene. |
steps_per_update |
|
idle_sleep |
|
refresh_runtime_parameters |
|
refresh_runtime_externals |
|
advance |
Advance the simulation and emit incremental frontend updates. |
handle |
|
Attributes:
| Name | Type | Description |
|---|---|---|
HISTORY_CAPTURE_ON_DEMAND |
|
|
HISTORY_CAPTURE_FULL |
|
|
dt |
|
|
v_init |
|
|
max_samples |
|
|
display_dt |
|
|
history_capture_mode |
|
|
title |
|
|
cells |
|
|
network |
|
|
geometry |
|
HISTORY_CAPTURE_ON_DEMAND
class-attribute
instance-attribute
¶
history_capture_mode
instance-attribute
¶
build_cells
abstractmethod
¶
Return one Jaxley cell or an iterable of cells for the session.
build_network ¶
Build the Jaxley network from the returned cells.
setup_model ¶
Configure channels, stimuli, recordings, or other runtime setup.
build_scene ¶
Build the initial Scene from sampled values and morphology geometry.