optuna/direction-and-directions
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Optuna | error | none, edit by hand | All versions |
optuna.create_study raises ValueError: Specify only one of direction and directions. when both direction= and directions= are non-None.
study = optuna.create_study(direction="minimize", directions=["minimize", "maximize"])study = optuna.create_study(directions=["minimize", "maximize"])What the rule reports
Section titled “What the rule reports”Calls to optuna.create_study supplying both non-None direction= and directions= keyword arguments.
How to fix it
Section titled “How to fix it”Keep direction= for single-objective optimization, or directions= for multi-objective optimization.
Diagnostic message
Section titled “Diagnostic message”create_study accepts either direction= for single-objective search or directions= for multi-objective search, not both. Passing both raises ValueError("Specify only one of `direction` and `directions`.").See all rules in the Optuna pack.