Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 16, 2025
1 parent bf6ff78 commit b114dd2
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/authenticator_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsAuth(Protocol[T_co]):
"""Protocol interface for authentication for the cloud services."""

# pylint: disable=unnecessary-ellipsis

def get_access_token(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/config_loader_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@runtime_checkable
class SupportsConfigLoading(Protocol):
"""Protocol interface for helper functions to lookup and load configs."""

# pylint: disable=unnecessary-ellipsis

def get_config_paths(self) -> list[str]:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/host_ops_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsHostOps(Protocol):
"""Protocol interface for Host/VM boot operations."""

# pylint: disable=unnecessary-ellipsis

def start_host(self, params: dict) -> tuple["Status", dict]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsHostProvisioning(Protocol):
"""Protocol interface for Host/VM provisioning operations."""

# pylint: disable=unnecessary-ellipsis

def provision_host(self, params: dict) -> tuple["Status", dict]:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/local_exec_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class SupportsLocalExec(Protocol):
Can be useful for data processing due to reduced dependency management complications
vs the target environment. Used in LocalEnv and provided by LocalExecService.
"""

# pylint: disable=unnecessary-ellipsis

def local_exec(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsNetworkProvisioning(Protocol):
"""Protocol interface for Network provisioning operations."""

# pylint: disable=unnecessary-ellipsis

def provision_network(self, params: dict) -> tuple["Status", dict]:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/os_ops_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsOSOps(Protocol):
"""Protocol interface for Host/OS operations."""

# pylint: disable=unnecessary-ellipsis

def shutdown(self, params: dict, force: bool = False) -> tuple["Status", dict]:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/remote_config_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsRemoteConfig(Protocol):
"""Protocol interface for configuring cloud services."""

# pylint: disable=unnecessary-ellipsis

def configure(self, config: dict[str, Any], params: dict[str, Any]) -> tuple["Status", dict]:
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/services/types/remote_exec_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SupportsRemoteExec(Protocol):
"""Protocol interface for Service types that provide helper functions to run scripts
on a remote host OS.
"""

# pylint: disable=unnecessary-ellipsis

def remote_exec(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@runtime_checkable
class SupportsVMOps(Protocol):
"""Protocol interface for VM provisioning operations."""

# pylint: disable=unnecessary-ellipsis

def vm_provision(self, params: dict) -> tuple["Status", dict]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"""Check how the services get inherited and overridden in child environments."""
import os

from mlos_bench.services.local.temp_dir_context import TempDirContextService
import pytest

from mlos_bench.environments.composite_env import CompositeEnv
from mlos_bench.services.config_persistence import ConfigPersistenceService
from mlos_bench.services.local.local_exec import LocalExecService
from mlos_bench.services.local.temp_dir_context import TempDirContextService
from mlos_bench.tunables.tunable_groups import TunableGroups
from mlos_bench.util import path_join

Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/tests/services/mock_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@runtime_checkable
class SupportsSomeMethod(Protocol):
"""Protocol for some_method."""

# pylint: disable=unnecessary-ellipsis

def some_method(self) -> str:
Expand Down
5 changes: 3 additions & 2 deletions mlos_bench/mlos_bench/tunables/tunable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import copy
import logging
from collections.abc import Iterable, Sequence
from typing import Any, Literal, TypedDict, Required
from typing import Any, Literal, Required, TypedDict

import numpy as np

Expand Down Expand Up @@ -69,7 +69,8 @@ class TunableDict(TypedDict, total=False):


def tunable_dict_from_dict(config: dict[str, Any]) -> "TunableDict":
"""Creates a TunableDict from a regular dict.
"""
Creates a TunableDict from a regular dict.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion mlos_core/mlos_core/spaces/converters/flaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import ConfigSpace
import flaml.tune
import flaml.tune.sample
from flaml.tune.sample import Domain
import numpy as np
from flaml.tune.sample import Domain

if TYPE_CHECKING:
from ConfigSpace.hyperparameters import Hyperparameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
],
)
def test_concrete_space_adapter_type(space_adapter_type: SpaceAdapterType) -> None:
"""Test that all spaceadapter types are listed in the ConcreteSpaceAdapter constraints."""
"""Test that all spaceadapter types are listed in the ConcreteSpaceAdapter
constraints.
"""
assert space_adapter_type.value in ConcreteSpaceAdapter.__args__


Expand Down

0 comments on commit b114dd2

Please sign in to comment.