Skip to content

Commit

Permalink
Rename AlgoType to AlgoT
Browse files Browse the repository at this point in the history
Why:

*Type is an invalid name according to pylint. They recommend using the
suffix T instead of Type: pylint-dev/pylint#6003 (comment)
  • Loading branch information
bouthilx committed Jul 4, 2022
1 parent e97f31e commit 0e0af47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/orion/core/worker/primary_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 0e0af47

Please sign in to comment.