This commit is contained in:
Contramundum
2023-09-04 15:25:19 +09:00
parent 7b71ae5695
commit 07ea8a642a
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -263,7 +263,7 @@ class PreferentialStudy:
to generate a new trial if this method returns :obj:`True`, and to wait for human
evaluation if this method returns :obj:`False`.
"""
return len(self.best_trials) < get_n_generate(self._study._study_id, self._study._storage)
return len(self.best_trials) < get_n_generate(self._study.system_attrs)
def get_best_trials(study_id: int, storage: optuna.storages.BaseStorage) -> list[FrozenTrial]:
@@ -13,7 +13,7 @@ from ..storage_supplier import StorageSupplier
@parametrize_storages
def test_report_and_get_preferences(storage_supplier: Callable[[], StorageSupplier]) -> None:
with storage_supplier() as storage:
study = optuna.create_study(n_generate=4, storage=storage)
study = optuna.create_study(storage=storage)
study.ask()
study.ask()
+2 -2
View File
@@ -24,7 +24,7 @@ def test_serialize_dict() -> None:
def test_get_study_detail_is_preferential() -> None:
storage = optuna.storages.InMemoryStorage()
study = create_study(storage=storage)
study = create_study(n_generate=4, storage=storage)
study_summaries = get_study_summaries(storage)
assert len(study_summaries) == 1
@@ -46,7 +46,7 @@ def test_get_study_detail_is_not_preferential() -> None:
def test_get_study_summary_is_preferential() -> None:
storage = optuna.storages.InMemoryStorage()
create_study(storage=storage)
create_study(n_generate=4, storage=storage)
study_summaries = get_study_summaries(storage)
assert len(study_summaries) == 1