use thiserror::Error;
#[derive(Debug, Error)]
pub enum TpeError {
#[error("invalid bounds: low ({low}) must be less than or equal to high ({high})")]
InvalidBounds {
low: f64,
high: f64,
},
#[error("invalid log bounds: low must be positive for log scale")]
InvalidLogBounds,
#[error("invalid step: step must be positive")]
InvalidStep,
#[error("categorical choices cannot be empty")]
EmptyChoices,
#[error("parameter conflict for '{name}': {reason}")]
ParameterConflict {
name: String,
reason: String,
},
#[error("no completed trials available")]
NoCompletedTrials,
}
pub type Result<T> = std::result::Result<T, TpeError>;