mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Fix lint errors
This commit is contained in:
@@ -12,6 +12,7 @@ import typing
|
||||
from typing import Any
|
||||
from typing import Callable
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from typing import TypeVar
|
||||
from typing import Union
|
||||
@@ -48,7 +49,7 @@ if typing.TYPE_CHECKING:
|
||||
except ImportError:
|
||||
FrozenStudy = None # type: ignore
|
||||
|
||||
BottleViewReturn = Union[str, bytes, dict[str, Any], BaseResponse]
|
||||
BottleViewReturn = Union[str, bytes, Dict[str, Any], BaseResponse]
|
||||
BottleView = TypeVar("BottleView", bound=Callable[..., BottleViewReturn])
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,21 +2,27 @@ from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import threading
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from typing import Set
|
||||
from typing import Tuple
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from optuna.distributions import BaseDistribution
|
||||
from optuna.trial import FrozenTrial
|
||||
from optuna.trial import TrialState
|
||||
|
||||
|
||||
SearchSpaceSetT = set[tuple[str, BaseDistribution]]
|
||||
SearchSpaceListT = list[tuple[str, BaseDistribution]]
|
||||
|
||||
# In-memory cache
|
||||
cached_extra_study_property_cache_lock = threading.Lock()
|
||||
cached_extra_study_property_cache: dict[int, "_CachedExtraStudyProperty"] = {}
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
SearchSpaceSetT = Set[Tuple[str, BaseDistribution]]
|
||||
SearchSpaceListT = List[Tuple[str, BaseDistribution]]
|
||||
|
||||
|
||||
def get_cached_extra_study_property(
|
||||
study_id: int, trials: list[FrozenTrial]
|
||||
) -> tuple[SearchSpaceListT, SearchSpaceListT, list[tuple[str, bool]], bool]:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import os
|
||||
|
||||
Reference in New Issue
Block a user