From 8d5f45c08e91e60d59de7d335d943ee25914ca23 Mon Sep 17 00:00:00 2001 From: Kei Ishikawa <30857855+kstoneriv3@users.noreply.github.com> Date: Thu, 4 Mar 2021 23:45:09 +0100 Subject: [PATCH] Add name argument to `OptunaSolverFactory` --- kurobako/solver/optuna.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kurobako/solver/optuna.py b/kurobako/solver/optuna.py index b87f04c..3004048 100644 --- a/kurobako/solver/optuna.py +++ b/kurobako/solver/optuna.py @@ -17,16 +17,18 @@ class OptunaSolverFactory(solver.SolverFactory): def __init__( self, create_study: Callable[[int], optuna.Study], + name: str = "Optuna", use_discrete_uniform: bool = False, warm_starting_trials: int = 0, ): self._create_study = create_study + self._name = name self._use_discrete_uniform = use_discrete_uniform self._warm_starting_trials = warm_starting_trials def specification(self) -> solver.SolverSpec: return solver.SolverSpec( - name="Optuna", + name=self._name, attrs={ "version": "optuna={}, kurobako-py={}".format( get_distribution("optuna").version, get_distribution("kurobako").version