utils
orchard.optimization.orchestrator.utils
¶
Utility Functions for Study Analysis.
Provides helper functions for working with Optuna studies:
- Extract completed trials
- Check if study has successful completions
- Compute trial statistics
These utilities eliminate code duplication across orchestrator modules.
get_completed_trials(study)
¶
Extract all successfully completed trials from study.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study
|
Study
|
Optuna study instance |
required |
Returns:
| Type | Description |
|---|---|
list[FrozenTrial]
|
list of trials with state == TrialState.COMPLETE |
Example
completed = get_completed_trials(study) len(completed) # Number of successful trials
Source code in orchard/optimization/orchestrator/utils.py
has_completed_trials(study)
¶
Check if study has at least one completed trial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study
|
Study
|
Optuna study instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if at least one trial completed successfully |
Example
if has_completed_trials(study): ... export_best_config(study, cfg, paths)