Fix lint errors

This commit is contained in:
c-bata
2022-12-27 15:14:41 +09:00
parent f73d8e0626
commit 49c8f22794
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -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
View File
@@ -1,4 +1,5 @@
from __future__ import annotations
import argparse
import asyncio
import os