Data Readers¶
Signal readers for time series data.
HDF5Signals ¶
Temporal reader: reads named 1-D datasets from HDF5 files.
Uses np.memmap for contiguous datasets (~2x faster than h5py), falls back to h5py for chunked/compressed datasets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str]
|
dataset column names to extract |
required |
dataset
|
str | None
|
HDF5 group name containing the datasets, None for root |
None
|
Source code in tsfast/tsdata/readers.py
read ¶
Read columns into pre-allocated array -> [seq_len, n_features].
Source code in tsfast/tsdata/readers.py
file_len ¶
HDF5Attrs ¶
Scalar reader: reads named HDF5 attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str]
|
attribute names to extract |
required |
dataset
|
str | None
|
HDF5 group name containing the attributes, None for root |
None
|
dtype
|
dtype
|
output data type |
float32
|
Source code in tsfast/tsdata/readers.py
Resampled ¶
Resampled(block: HDF5Signals, fs_idx: int | None = None, dt_idx: int | None = None, fast_resample: bool = True)
Wraps a temporal reader, reading in original space and resampling to target rate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
HDF5Signals
|
temporal reader with read(path, l_slc, r_slc) and file_len(path) |
required |
fs_idx
|
int | None
|
column index of sampling rate, scaled by resampling factor |
None
|
dt_idx
|
int | None
|
column index of time step, scaled by resampling factor |
None
|
fast_resample
|
bool
|
use linear interpolation (True) or FFT resampling (False) |
True
|
Source code in tsfast/tsdata/readers.py
read ¶
Read and resample a window. l_slc/r_slc are in resampled coordinates.
Source code in tsfast/tsdata/readers.py
CSVSignals ¶
Cached ¶
FilenameScalar ¶
Scalar reader: extracts numbers from filenames via regex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
str
|
regex with capture groups to extract from the filename stem |
'(\\d+\\.?\\d*)'
|
Source code in tsfast/tsdata/readers.py
read ¶
Search filename stem and return captured groups as float32 array.