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),
InvalidSplit(String),
}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.
InvalidSplit(String)
A train/test split is invalid — it leaks information across the boundary (a subject appears in both partitions, or a window is shared) or is degenerate (an empty partition). ADR-155 §Tier-1.2.
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.
Trait Implementations§
Source§impl Debug for DatasetError
impl Debug for DatasetError
Source§impl Display for DatasetError
impl Display for DatasetError
Source§impl Error for DatasetError
impl Error for DatasetError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DatasetError> for TrainError
impl From<DatasetError> for TrainError
Source§fn from(source: DatasetError) -> Self
fn from(source: DatasetError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for DatasetError
impl !UnwindSafe for DatasetError
impl Freeze for DatasetError
impl Send for DatasetError
impl Sync for DatasetError
impl Unpin for DatasetError
impl UnsafeUnpin for DatasetError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more