radiens_core.models.dataset
Dataset metadata, time-range selection, and curation protocol graph models.
| TYPE ALIAS | DESCRIPTION |
|---|---|
TransformParams |
Union of all transform parameter types (or |
| CLASS | DESCRIPTION |
|---|---|
BandParams |
Parameters for band-pass or band-stop filter transform nodes. |
BulkSinkParams |
Parameters for BULK_SINK transform nodes. |
BulkSourceParams |
Parameters for BULK_SOURCE transform nodes. |
CARParams |
Parameters for Common Average Reference transform nodes (no fields). |
DatasetMetadata |
Metadata for a linked dataset. |
DownsampleParams |
Parameters for downsample transform nodes. |
FileInfo |
Filesystem entry metadata returned by |
HighLowPassParams |
Parameters for high-pass or low-pass filter transform nodes. |
NotchParams |
Parameters for notch filter transform nodes. |
PairedRefParams |
Parameters for paired reference transform nodes. |
ProtocolSpec |
Minimal summary of a saved protocol. |
RadiensFileType |
Recording file type. |
SinkParams |
Parameters for SINK transform nodes. |
SliceChannelsParams |
Parameters for channel-slice transform nodes. |
SliceTimeParams |
Parameters for time-slice transform nodes. |
SourceParams |
Parameters for SOURCE transform nodes. |
TimeRangeSpec |
Semantic time range specification with embedded mode. |
TransformEdge |
A directed edge connecting two nodes in a protocol graph. |
TransformNode |
A node in a curation protocol transform graph. |
TransformNodeType |
Transform node type for curation protocol graphs. |
TrsMode |
Time range selection mode. |
VirtualRefParams |
Parameters for virtual reference transform nodes. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
FlexDataset |
|
FlexTimeRange |
|
Attributes
FlexDataset
module-attribute
FlexDataset = DatasetMetadata | str | Path
DatasetMetadata, a dataset ID, or a file path.
A string is treated as a path when it contains a path separator (e.g. ./rec.xdat),
otherwise as a dataset ID. Pass a Path for a file in the working directory.
FlexTimeRange
module-attribute
FlexTimeRange = TimeRangeSpec | Sequence[float]
TimeRangeSpec, or a [start, end] list or tuple in seconds of stream time.
[start, end] reads that span, and an infinite edge is open: [t, inf] reads from
t to the end of the data, and [-inf, inf] reads all of it, as None does where a
method accepts it. [duration, nan] reads the most recent duration seconds; only
get_signals() accepts it.
The server clips the range to the data it holds when the call runs, so a recording still
being written reads up to its current end, and the result reports the range served. With
an older Radiens server, ranges are resolved against DatasetMetadata.time_range
instead, which for a growing recording is its extent when the server first loaded it.
Type Aliases
TransformParams
TransformParams = (
HighLowPassParams
| BandParams
| NotchParams
| CARParams
| VirtualRefParams
| PairedRefParams
| SliceTimeParams
| SliceChannelsParams
| DownsampleParams
| SourceParams
| SinkParams
| BulkSourceParams
| BulkSinkParams
| None
)
Union of all transform parameter types (or None for parameter-free nodes).
Classes
BandParams
Bases: BaseModel
Parameters for band-pass or band-stop filter transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
high_frequency |
Upper cutoff frequency in Hz.
TYPE:
|
low_frequency |
Lower cutoff frequency in Hz.
TYPE:
|
order |
Filter order;
TYPE:
|
BulkSinkParams
Bases: BaseModel
Parameters for BULK_SINK transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
file_type |
Output recording file format.
TYPE:
|
path |
Output directory path.
TYPE:
|
suffix |
Appended to each input's base name after an underscore to name its output.
TYPE:
|
Attributes
suffix
instance-attribute
suffix: str
Appended to each input's base name after an underscore to name its output.
BulkSourceParams
Bases: BaseModel
Parameters for BULK_SOURCE transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
sources |
One entry per input dataset.
TYPE:
|
Attributes
CARParams
DatasetMetadata
Bases: BaseModel
Metadata for a linked dataset.
Returned by link_data_file() and similar operations.
Contains everything needed to query signals from this dataset.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Dataset ID assigned when the file was linked; accepted wherever a dataset argument is.
TYPE:
|
base_name |
Recording file name without directory or extension.
TYPE:
|
path |
Directory containing the recording.
TYPE:
|
file_type |
Type of the recording file.
TYPE:
|
time_range |
Extent of the dataset in stream time; see
TYPE:
|
channel_metadata |
Channel configuration and metadata.
TYPE:
|
associated_spikes_ids |
Every spikes fileset the server has registered for this recording, sorted. Includes sorts launched by other clients, such as the desktop apps. Empty if the recording has none. |
DownsampleParams
FileInfo
Bases: BaseModel
Filesystem entry metadata returned by list_directory.
| ATTRIBUTE | DESCRIPTION |
|---|---|
path |
Directory containing the file.
TYPE:
|
base_name |
File name without directory or extension.
TYPE:
|
file_type |
Type of the recording file.
TYPE:
|
dataset_uid |
Identifier stored in the recording's own metadata; not the same as
TYPE:
|
num_channels |
Number of channels in the file.
TYPE:
|
duration_sec |
Total duration of the recording in seconds.
TYPE:
|
sample_rate |
Sampling rate in Hertz.
TYPE:
|
num_bytes |
Size of the file in bytes.
TYPE:
|
HighLowPassParams
NotchParams
Bases: BaseModel
Parameters for notch filter transform nodes.
Note
The notch filter is always second-order, so it takes no order.
| ATTRIBUTE | DESCRIPTION |
|---|---|
bandwidth |
Width of the rejection band in Hz. Must be positive.
TYPE:
|
frequency |
Center frequency to reject in Hz.
TYPE:
|
notch_frequency |
Deprecated alias of
TYPE:
|
PairedRefParams
Bases: BaseModel
Parameters for paired reference transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ref_channel |
Native channel index of the reference electrode.
TYPE:
|
target_channel |
Native channel index of the channel to re-reference.
TYPE:
|
ProtocolSpec
RadiensFileType
SinkParams
SliceChannelsParams
SliceTimeParams
SourceParams
Bases: BaseModel
Parameters for SOURCE transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
base_name |
Base filename (without extension or directory).
TYPE:
|
dataset_id |
ID of the linked dataset, for reference only: the server opens the source from
TYPE:
|
file_type |
Recording file format.
TYPE:
|
path |
Directory path containing the dataset.
TYPE:
|
Attributes
dataset_id
class-attribute
instance-attribute
dataset_id: str = ''
ID of the linked dataset, for reference only: the server opens the source from
path, base_name and file_type.
TimeRangeSpec
Bases: BaseModel
Semantic time range specification with embedded mode.
Use factory methods to create specs with clear semantics:
t0 = meta.time_range.sec[0] spec = TimeRangeSpec.subset(t0, t0 + 10) # First 10 seconds spec = TimeRangeSpec.lookback(5.0) # Last 5 seconds spec = TimeRangeSpec.full() # Entire recording
| ATTRIBUTE | DESCRIPTION |
|---|---|
mode |
Time range selection mode.
TYPE:
|
start |
Start time or duration depending on the mode.
TYPE:
|
end |
End time for subset mode.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
from_list |
Create from a |
full |
All of the data. |
is_full |
Check if this is a full-range specification. |
lookback |
The most recent |
resolve |
Resolve to a concrete TimeRange. |
subset |
Time range |
to_array |
Convert to |
to_head |
From |
Attributes
Functions
from_list
classmethod
from_list(time_range: list[float], mode: TrsMode | None = None) -> TimeRangeSpec
Create from a [start, end] or [duration, nan] list; see FlexTimeRange.
lookback
classmethod
lookback(duration: float) -> TimeRangeSpec
The most recent duration seconds. Only get_signals() accepts it.
resolve
Resolve to a concrete TimeRange.
| PARAMETER | DESCRIPTION |
|---|---|
dataset_metadata
|
Dataset metadata used to obtain
TYPE:
|
fs
|
Sampling rate override. Defaults to the dataset's rate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TimeRange | None
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
subset
classmethod
subset(start: float, end: float) -> TimeRangeSpec
Time range [start, end) in seconds of stream time; see TimeRange.sec.
An infinite end reads to the end of the data. A range past the dataset's end is accepted, because a recording still being written grows past its linked extent.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
to_array
Convert to [start, end], [start, inf] for to_head(), or [duration, nan].
to_head
classmethod
to_head(start: float) -> TimeRangeSpec
From start seconds of stream time to the end of the data.
TransformEdge
Bases: BaseModel
A directed edge connecting two nodes in a protocol graph.
Use the source and target fields to specify connectivity
by node ID.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Edge ID (auto-generated UUID if not provided).
TYPE:
|
source |
ID of the source transform node.
TYPE:
|
target |
ID of the target transform node.
TYPE:
|
TransformNode
Bases: BaseModel
A node in a curation protocol transform graph.
Construct nodes using the factory class methods for convenience:
src = TransformNode.source(dataset_meta)
hp = TransformNode.highpass(frequency=300.0)
snk = TransformNode.sink("filtered", "/output", RadiensFileType.XDAT)
edges = [
TransformEdge(source=src.id, target=hp.id),
TransformEdge(source=hp.id, target=snk.id),
]
Then pass [src, hp, snk] and edges to
VidereClient.set_protocol().
Note
Each factory method sets the correct type and params for its
transform. When constructing manually, the params object must match
the type (e.g., CAR_REF requires params=CARParams()).
| METHOD | DESCRIPTION |
|---|---|
bandpass |
Create a |
bandstop |
Create a |
bulk_sink |
Create a |
bulk_source |
Create a |
car |
Create a |
downsample |
Create a |
highpass |
Create a |
lowpass |
Create a |
notch |
Create a |
paired_ref |
Create a |
sink |
Create a |
slice_channels |
Create a |
slice_time |
Create a |
source |
Create a |
virtual_ref |
Create a |
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Node ID (auto-generated UUID if not provided).
TYPE:
|
params |
Operation parameters; see each factory method for the expected type.
TYPE:
|
type |
Transform operation this node performs.
TYPE:
|
Attributes
id
class-attribute
instance-attribute
Node ID (auto-generated UUID if not provided).
params
class-attribute
instance-attribute
params: TransformParams = None
Operation parameters; see each factory method for the expected type.
Functions
bandpass
classmethod
bandpass(
low_frequency: float, high_frequency: float, order: int | None = None
) -> TransformNode
bandstop
classmethod
bandstop(
low_frequency: float, high_frequency: float, order: int | None = None
) -> TransformNode
bulk_sink
classmethod
bulk_sink(suffix: str, path: str, file_type: RadiensFileType) -> TransformNode
Create a BULK_SINK node.
| PARAMETER | DESCRIPTION |
|---|---|
suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
path
|
Output directory path.
TYPE:
|
file_type
|
Output recording file format.
TYPE:
|
bulk_source
classmethod
bulk_source(datasets: list[DatasetMetadata]) -> TransformNode
Create a BULK_SOURCE node from multiple linked datasets.
| PARAMETER | DESCRIPTION |
|---|---|
datasets
|
Metadata for all input datasets.
TYPE:
|
downsample
classmethod
downsample(factor: int) -> TransformNode
Create a DOWNSAMPLE node.
| PARAMETER | DESCRIPTION |
|---|---|
factor
|
Downsampling factor (e.g., 2, 4, 10).
TYPE:
|
highpass
classmethod
highpass(frequency: float, order: int | None = None) -> TransformNode
lowpass
classmethod
lowpass(frequency: float, order: int | None = None) -> TransformNode
notch
classmethod
notch(frequency: float, bandwidth: float) -> TransformNode
paired_ref
classmethod
paired_ref(ref_channel: int, target_channel: int) -> TransformNode
sink
classmethod
sink(base_name: str, path: str, file_type: RadiensFileType) -> TransformNode
Create a SINK node.
| PARAMETER | DESCRIPTION |
|---|---|
base_name
|
Output base filename (without extension or directory).
TYPE:
|
path
|
Output directory path.
TYPE:
|
file_type
|
Output recording file format.
TYPE:
|
slice_channels
classmethod
slice_channels(channels: list[int]) -> TransformNode
slice_time
classmethod
slice_time(start_sec: float, end_sec: float) -> TransformNode
source
classmethod
source(dataset: DatasetMetadata) -> TransformNode
Create a SOURCE node from a linked dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Metadata for the input dataset (returned by
TYPE:
|
virtual_ref
classmethod
virtual_ref(ref_channel: int) -> TransformNode
Create a VIRTUAL_REF node.
| PARAMETER | DESCRIPTION |
|---|---|
ref_channel
|
Native channel index of the reference electrode.
TYPE:
|
TransformNodeType
TrsMode
Bases: IntEnum
Time range selection mode.
| ATTRIBUTE | DESCRIPTION |
|---|---|
SUBSET |
|
TO_HEAD |
From
|
FROM_HEAD |
The most recent
|
VirtualRefParams
Bases: BaseModel
Parameters for virtual reference transform nodes.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ref_channel |
Native channel index of the reference electrode.
TYPE:
|