radiens_core.models.dataset
DatasetMetadata — immutable metadata for a linked dataset.
Attributes
FlexDataset
module-attribute
DatasetMetadata that also accepts an ID string or file Path.
Resolution from string/path to DatasetMetadata happens inside the client
via _resolve_dataset(). The BeforeValidator validates the input type
and provides clear errors for invalid arguments.
Use with @validate_call::
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
def get_signals(self, dataset: FlexDataset, ...) -> ...:
meta = self._resolve_dataset(dataset)
...
FlexTimeRange
module-attribute
TimeRangeSpec that also accepts list/tuple shorthand.
Use in Pydantic models::
class MyRequest(BaseModel):
time_range: FlexTimeRange
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.
BulkSinkParams
BulkSourceParams
CARParams
Bases: BaseModel
Parameters for Common Average Reference transform nodes (no fields).
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.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for the dataset. |
base_name |
str
|
Base name of the dataset. |
path |
str
|
Full filesystem path to the dataset. |
file_type |
RadiensFileType
|
Type of the recording file. References RadiensFileType. |
time_range |
TimeRange
|
Valid time range for this dataset. References TimeRange. |
channel_metadata |
ChannelMetadata
|
Channel configuration and metadata. References ChannelMetadata. |
parent_dsource_id |
str
|
Identifier for the parent data source. Defaults to "". |
probe_uid |
str
|
Unique identifier for the probe used. Defaults to "". |
associated_spikes_ids |
list[str]
|
Registered spikes datasource IDs discovered when the
recording file was linked (populated by |
DownsampleParams
FileInfo
Bases: BaseModel
Filesystem entry metadata returned by list_directory.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Full filesystem path to the file. |
base_name |
str
|
Base name of the file without directory components. |
file_type |
RadiensFileType
|
Type of the recording file. References RadiensFileType. |
dataset_uid |
str
|
Unique identifier for the dataset. |
num_channels |
int
|
Number of channels in the file. |
duration_sec |
float
|
Total duration of the recording in seconds. |
sample_rate |
int
|
Sampling rate in Hertz. |
num_bytes |
int
|
Size of the file in bytes. |
HighLowPassParams
NotchParams
Bases: BaseModel
Parameters for notch filter transform nodes.
Note
The notch filter is always second-order (scipy.signal.iirnotch).
Unlike other IIR filters, it does not accept a custom order.
PairedRefParams
ProtocolSpec
Bases: BaseModel
Minimal summary of a saved protocol.
Returned by get_protocol and get_all_protocols.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for the protocol. |
node_count |
int
|
Number of nodes defined in the protocol. |
RadiensFileType
Bases: IntEnum
Recording file type. Values match proto common.RadixFileTypes.
SinkParams
SliceChannelsParams
SliceTimeParams
SourceParams
Bases: BaseModel
Parameters for SOURCE transform nodes.
Attributes
dataset_id
class-attribute
instance-attribute
ID of the linked dataset (empty for new sources).
TimeRangeSpec
Bases: BaseModel
Semantic time range specification with embedded mode.
Use factory methods to create specs with clear semantics:
spec = TimeRangeSpec.subset(0, 10) # [0, 10) seconds spec = TimeRangeSpec.lookback(5.0) # Last 5 seconds spec = TimeRangeSpec.full() # Entire recording
Attributes:
| Name | Type | Description |
|---|---|---|
mode |
TrsMode
|
Time range selection mode. References TrsMode. |
start |
float
|
Start time or duration depending on the mode. |
end |
float | None
|
End time for subset mode. Defaults to None. |
Attributes
Functions
from_list
classmethod
Create from [start, end] or [duration, nan] list.
resolve
Resolve to a concrete TimeRange.
dataset_metadata
Dataset metadata used to obtain fs and dataset bounds.
fs
Sampling rate override (used when dataset_metadata is not provided).
TimeRange or None
None for FROM_HEAD mode — caller must use to_array() instead.
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.
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
CurateClient.set_protocol().
Notes
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()).
Attributes
id
class-attribute
instance-attribute
Node ID (auto-generated UUID if not provided).
params
class-attribute
instance-attribute
Operation parameters; see each factory method for the expected type.
Functions
bandpass
classmethod
Create a BANDPASS_FILTER node.
low_frequency:
Lower cutoff frequency in Hz.
high_frequency:
Upper cutoff frequency in Hz.
order:
Filter order; None uses the server default.
bandstop
classmethod
Create a BANDSTOP_FILTER node.
low_frequency:
Lower cutoff frequency in Hz.
high_frequency:
Upper cutoff frequency in Hz.
order:
Filter order; None uses the server default.
bulk_sink
classmethod
Create a BULK_SINK node.
suffix: Suffix appended to each output file's base name. path: Output directory path. file_type: Output recording file format.
bulk_source
classmethod
Create a BULK_SOURCE node from multiple linked datasets.
datasets: Metadata for all input datasets.
downsample
classmethod
Create a DOWNSAMPLE node.
factor: Downsampling factor (e.g., 2, 4, 10).
highpass
classmethod
Create a HIGHPASS_FILTER node.
frequency:
Cutoff frequency in Hz.
order:
Filter order; None uses the server default.
lowpass
classmethod
Create a LOWPASS_FILTER node.
frequency:
Cutoff frequency in Hz.
order:
Filter order; None uses the server default.
notch
classmethod
Create a NOTCH_FILTER node.
The notch filter is always second-order (scipy.signal.iirnotch).
Unlike other IIR filters, it does not accept a custom order.
notch_frequency: Center frequency to reject in Hz. bandwidth: Width of the rejection band in Hz.
paired_ref
classmethod
Create a PAIRED_REF node.
ref_channel: Native channel index of the reference electrode. target_channel: Native channel index of the channel to re-reference.
sink
classmethod
Create a SINK node.
base_name: Output base filename (without extension or directory). path: Output directory path. file_type: Output recording file format.
slice_channels
classmethod
Create a SLICE_CHANNELS node.
channels: System-wide channel indices to keep.
slice_time
classmethod
Create a SLICE_TIME node.
start_sec: Start of the time window in seconds. end_sec: End of the time window in seconds.
source
classmethod
Create a SOURCE node from a linked dataset.
dataset:
Metadata for the input dataset (returned by link_data_file).
TransformNodeType
Bases: IntEnum
Transform node type for curation protocol graphs.
Values match proto common.TransformNodeType.
TrsMode
Bases: IntEnum
Time range selection mode. Values match proto common.TimeRangeSelMode.