API reference

NeuronIO conversion

Signatures, parameters, return contracts, and source for neuronio conversion.

Overview

The converter reads raw NeuronIO teacher traces and creates deterministic shards. Standard soma normalization clips at -55 mV and applies (v_mV-bias)*scale with bias=-67.7 and scale=0.1. Preserve conversion metadata: normalized targets cannot recover clipped spike peaks.

Source revision: caef7be03abd. Public export index.

RawNeuronIO

axosim.neuronio_raw.RawNeuronIO(inputs: np.ndarray, spikes: np.ndarray, soma: np.ndarray, metadata: dict[str, object])

Source

Parsed raw simulations with separate input-event arrays, spike labels, voltage traces, and metadata.

Parameters

inputs np.ndarray
required. Raw input events (simulations,time,2*segments), with excitatory channels followed by inhibitory channels before the converter applies E/I signs.
spikes np.ndarray
required. Binary output spike labels (simulations,time).
soma np.ndarray
required. Raw soma voltage in millivolts, shaped (simulations,time).
metadata dict[str, object]
required. Simulation counts, duration, synapse count, segment types, and available segment-to-soma distances extracted from the raw file.

Attributes

Constructor fields are retained as read-only attributes.

parse_neuronio_pickle

axosim.neuronio_raw.parse_neuronio_pickle(path: str | Path) -> RawNeuronIO

Source

Parse a public NeuronIO simulation pickle into (sim, time, channel) arrays.

Parameters

path str | Path
required. Filesystem location to read or write; see the operation's persistence contract.

Returns

RawNeuronIO

convert_neuronio_pickles

axosim.neuronio_raw.convert_neuronio_pickles(input_path: str | Path, output_dir: str | Path, *, shard_size: int=128, window_size: int | None=None, window_stride: int | None=None, ignore_start: int=0, y_soma_threshold: float=DEFAULT_Y_SOMA_THRESHOLD, y_train_soma_bias: float=DEFAULT_Y_TRAIN_SOMA_BIAS, y_train_soma_scale: float=DEFAULT_Y_TRAIN_SOMA_SCALE) -> list[Path]

Source

Convert raw NeuronIO pickle files to deterministic .npz shards.

Parameters

input_path str | Path
required. Raw NeuronIO pickle file or directory to discover and convert.
output_dir str | Path
required. Directory receiving converted shards and their manifest.
shard_size int
keyword-only, default=128. Maximum sample count in each converted shard.
window_size int | None
keyword-only, default=None. Native timesteps per extracted window.
window_stride int | None
keyword-only, default=None. Native timestep distance between successive window starts.
ignore_start int
keyword-only, default=0. Initial native timesteps excluded by the declared path.
y_soma_threshold float
keyword-only, default=-55.0. Upper voltage clipping threshold in millivolts.
y_train_soma_bias float
keyword-only, default=-67.7. Voltage bias subtracted before target scaling, in millivolts.
y_train_soma_scale float
keyword-only, default=0.1. Scale converting the biased voltage to the training target coordinate.

Returns

list[Path]

create_neuronio_input_type

axosim.neuronio_raw.create_neuronio_input_type(num_input: int) -> np.ndarray

Source

Build an E/I sign vector with positive excitatory channels followed by negative inhibitory channels.

Parameters

num_input int
required. Input-channel count.

Returns

signs np.ndarray
Float32 vector (num_input,) with +1 in its first half and -1 in its second half; num_input must be even.

normalize_soma

axosim.neuronio_raw.normalize_soma(soma: np.ndarray, threshold: float=DEFAULT_Y_SOMA_THRESHOLD, bias: float=DEFAULT_Y_TRAIN_SOMA_BIAS, scale: float=DEFAULT_Y_TRAIN_SOMA_SCALE) -> np.ndarray

Source

Clip soma voltage and convert it to the normalized training coordinate.

Returns normalized soma targets after clipping teacher voltage at threshold and applying (voltage-bias)*scale. The default threshold is -55.0 mV, bias is -67.7 mV, and scale is 0.1.

Parameters

soma np.ndarray
required. Raw soma voltage array in millivolts.
threshold float
default=-55.0. Upper clipping threshold in millivolts.
bias float
default=-67.7. Millivolt bias subtracted after clipping.
scale float
default=0.1. Multiplier converting biased millivolt values to the training coordinate.

Returns

normalized np.ndarray
Float32 array matching soma.shape, equal to (minimum(soma,threshold)-bias)*scale.

Search guides, examples, and API signatures.