From e47a0a534c0ea9ba1fba44b92b1e7005583b18bf Mon Sep 17 00:00:00 2001 From: Xavier Bouthillier Date: Mon, 4 Jul 2022 13:23:06 -0400 Subject: [PATCH] Rename AlgoType to AlgoT Why: *Type is an invalid name according to pylint. They recommend using the suffix T instead of Type: https://github.com/PyCQA/pylint/issues/6003#issuecomment-1080008925 --- src/orion/core/worker/primary_algo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/orion/core/worker/primary_algo.py b/src/orion/core/worker/primary_algo.py index 23e1cde12..39b0ca9e5 100644 --- a/src/orion/core/worker/primary_algo.py +++ b/src/orion/core/worker/primary_algo.py @@ -19,14 +19,14 @@ logger = get_logger(__name__) -AlgoType = TypeVar("AlgoType", bound=BaseAlgorithm) +AlgoT = TypeVar("AlgoT", bound=BaseAlgorithm) def create_algo( - algo_type: type[AlgoType], + algo_type: type[AlgoT], space: Space, **algo_kwargs, -) -> SpaceTransformAlgoWrapper[AlgoType]: +) -> SpaceTransformAlgoWrapper[AlgoT]: """Creates an algorithm of the given type, taking care of transforming the space if needed.""" original_space = space from orion.core.worker.transformer import build_required_space @@ -45,7 +45,7 @@ def create_algo( # pylint: disable=too-many-public-methods -class SpaceTransformAlgoWrapper(BaseAlgorithm, Generic[AlgoType]): +class SpaceTransformAlgoWrapper(BaseAlgorithm, Generic[AlgoT]): """Perform checks on points and transformations. Wrap the primary algorithm. 1. Checks requirements on the parameter space from algorithms and create the @@ -64,9 +64,9 @@ class SpaceTransformAlgoWrapper(BaseAlgorithm, Generic[AlgoType]): """ - def __init__(self, space: Space, algorithm: AlgoType): + def __init__(self, space: Space, algorithm: AlgoT): super().__init__(space=space) - self.algorithm: AlgoType = algorithm + self.algorithm: AlgoT = algorithm self.registry = Registry() self.registry_mapping = RegistryMapping( original_registry=self.registry,