mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-10 12:23:22 +08:00
Fix lint errors
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
from typing import List
|
||||
from typing import TYPE_CHECKING
|
||||
import warnings
|
||||
|
||||
@@ -63,9 +62,7 @@ def get_param_importance_from_trials_cache(
|
||||
|
||||
cache_key = f"{study_id}:{objective_id}"
|
||||
with param_importance_cache_lock:
|
||||
cache_n_trial, cache_importance = param_importance_cache.get(
|
||||
cache_key, (0, {"param_importances": []})
|
||||
)
|
||||
cache_n_trial, cache_importance = param_importance_cache.get(cache_key, (0, []))
|
||||
if n_completed_trials == cache_n_trial:
|
||||
return cache_importance
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ from optuna.storages import BaseStorage
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import TypedDict
|
||||
from typing import Optional
|
||||
from typing import TypedDict
|
||||
|
||||
NoteType = TypedDict(
|
||||
"NoteType",
|
||||
@@ -29,7 +29,7 @@ def note_ver_key(trial_id: Optional[int]) -> str:
|
||||
return f"dashboard:{trial_id}:note_ver"
|
||||
|
||||
|
||||
def note_str_key_prefix(trial_id: int) -> str:
|
||||
def note_str_key_prefix(trial_id: Optional[int]) -> str:
|
||||
prefix = "dashboard:note_str:"
|
||||
if trial_id is None:
|
||||
return prefix
|
||||
|
||||
Reference in New Issue
Block a user