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])
Parsed raw simulations with separate input-event arrays, spike labels, voltage traces, and metadata.
Parameters
inputsnp.ndarray- required. Raw input events (simulations,time,2*segments), with excitatory channels followed by inhibitory channels before the converter applies E/I signs.
spikesnp.ndarray- required. Binary output spike labels (simulations,time).
somanp.ndarray- required. Raw soma voltage in millivolts, shaped (simulations,time).
metadatadict[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
Parse a public NeuronIO simulation pickle into (sim, time, channel) arrays.
Parameters
pathstr | 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]
Convert raw NeuronIO pickle files to deterministic .npz shards.
Parameters
input_pathstr | Path- required. Raw NeuronIO pickle file or directory to discover and convert.
output_dirstr | Path- required. Directory receiving converted shards and their manifest.
shard_sizeint- keyword-only, default=128. Maximum sample count in each converted shard.
window_sizeint | None- keyword-only, default=None. Native timesteps per extracted window.
window_strideint | None- keyword-only, default=None. Native timestep distance between successive window starts.
ignore_startint- keyword-only, default=0. Initial native timesteps excluded by the declared path.
y_soma_thresholdfloat- keyword-only, default=-55.0. Upper voltage clipping threshold in millivolts.
y_train_soma_biasfloat- keyword-only, default=-67.7. Voltage bias subtracted before target scaling, in millivolts.
y_train_soma_scalefloat- 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
Build an E/I sign vector with positive excitatory channels followed by negative inhibitory channels.
Parameters
num_inputint- required. Input-channel count.
Returns
signsnp.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
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
somanp.ndarray- required. Raw soma voltage array in millivolts.
thresholdfloat- default=-55.0. Upper clipping threshold in millivolts.
biasfloat- default=-67.7. Millivolt bias subtracted after clipping.
scalefloat- default=0.1. Multiplier converting biased millivolt values to the training coordinate.
Returns
normalizednp.ndarray- Float32 array matching soma.shape, equal to (minimum(soma,threshold)-bias)*scale.