mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Fix test
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user