pub enum DatasetError {
DataNotFound {
path: PathBuf,
message: String,
},
InvalidFormat {
path: PathBuf,
message: String,
},
IoError {
path: PathBuf,
source: Error,
},
SubcarrierMismatch {
path: PathBuf,
found: usize,
expected: usize,
},
IndexOutOfBounds {
idx: usize,
len: usize,
},
NpyReadError {
path: PathBuf,
message: String,
},
MetadataError {
subject_id: u32,
message: String,
},
Format(String),
DirectoryNotFound {
path: String,
},
NoSubjectsFound {
data_dir: PathBuf,
requested: Vec<u32>,
},
Io(Error),
}Expand description
Errors produced while loading or accessing dataset samples.
Production training code MUST NOT silently suppress these errors.
If data is missing, training must fail explicitly so the user is aware.
The SyntheticCsiDataset is the only source of non-file-system data
and is restricted to proof/testing use.
Variants§
DataNotFound
A required data file or directory was not found on disk.
InvalidFormat
A file was found but its format or shape is wrong.
IoError
A low-level I/O error while reading a data file.
SubcarrierMismatch
The number of subcarriers in the file doesn’t match expectations.
Fields
IndexOutOfBounds
A sample index is out of bounds.
NpyReadError
A numpy array file could not be parsed.
MetadataError
Metadata for a subject is missing or malformed.
Fields
Format(String)
A data format error (e.g. wrong numpy shape) occurred.
This is a convenience variant for short-form error messages where the full path context is not available.
DirectoryNotFound
The data directory does not exist.
NoSubjectsFound
No subjects matching the requested IDs were found.
Io(Error)
An I/O error that carries no path context.
Implementations§
Source§impl DatasetError
impl DatasetError
Sourcepub fn not_found<S: Into<String>>(path: impl Into<PathBuf>, msg: S) -> Self
pub fn not_found<S: Into<String>>(path: impl Into<PathBuf>, msg: S) -> Self
Construct a DatasetError::DataNotFound.
Sourcepub fn invalid_format<S: Into<String>>(path: impl Into<PathBuf>, msg: S) -> Self
pub fn invalid_format<S: Into<String>>(path: impl Into<PathBuf>, msg: S) -> Self
Construct a DatasetError::InvalidFormat.
Sourcepub fn io_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn io_error(path: impl Into<PathBuf>, source: Error) -> Self
Construct a DatasetError::IoError.
Sourcepub fn subcarrier_mismatch(
path: impl Into<PathBuf>,
found: usize,
expected: usize,
) -> Self
pub fn subcarrier_mismatch( path: impl Into<PathBuf>, found: usize, expected: usize, ) -> Self
Construct a DatasetError::SubcarrierMismatch.