feat: add TrialPruned error variant and Pruned trial state
- Add `Pruned` variant to `TrialState` - Add `Error::TrialPruned` variant and standalone `TrialPruned` struct with `From<TrialPruned> for Error` for ergonomic `?` usage - Add `state` field to `CompletedTrial` (defaults to `Complete`) - Add `Study::prune_trial()` and `Study::n_pruned_trials()` - `optimize()` and `optimize_with_callback()` detect `TrialPruned` errors via Any downcasting and record pruned trials instead of failing them - `best_trial()` / `best_value()` now filter to only `Complete` trials - Re-export `TrialPruned` from crate root and prelude
This commit is contained in:
@@ -18,4 +18,6 @@ pub enum TrialState {
|
||||
Complete,
|
||||
/// The trial failed with an error.
|
||||
Failed,
|
||||
/// The trial was pruned (stopped early).
|
||||
Pruned,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user