Skip to content

Commit

Permalink
Merge branch 'main' into auth-service-update
Browse files Browse the repository at this point in the history
  • Loading branch information
eujing authored Jul 16, 2024
2 parents ad548c0 + 758fbdf commit 325b187
Show file tree
Hide file tree
Showing 32 changed files with 102 additions and 92 deletions.
52 changes: 0 additions & 52 deletions .pylintrc

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ build/pylint.mlos_viz.${CONDA_ENV_NAME}.build-stamp: $(MLOS_VIZ_PYTHON_FILES)

PYLINT_COMMON_PREREQS := build/conda-env.${CONDA_ENV_NAME}.build-stamp
PYLINT_COMMON_PREREQS += $(FORMAT_PREREQS)
PYLINT_COMMON_PREREQS += .pylintrc
PYLINT_COMMON_PREREQS += pyproject.toml

build/pylint.%.${CONDA_ENV_NAME}.build-stamp: $(PYLINT_COMMON_PREREQS)
conda run -n ${CONDA_ENV_NAME} pylint -j0 $(filter %.py,$+)
Expand Down
4 changes: 2 additions & 2 deletions mlos_bench/mlos_bench/environments/base_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Environment(metaclass=abc.ABCMeta):
"""An abstract base of all benchmark environments."""

@classmethod
def new(
def new( # pylint: disable=too-many-arguments
cls,
*,
env_name: str,
Expand Down Expand Up @@ -94,7 +94,7 @@ def new(
service=service,
)

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/composite_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class CompositeEnv(Environment):
"""Composite benchmark environment."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/local/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LocalEnv(ScriptEnv):
# pylint: disable=too-many-instance-attributes
"""Scheduler-side Environment that runs scripts locally."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LocalFileShareEnv(LocalEnv):
to the shared file storage.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/mock_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MockEnv(Environment):
_NOISE_VAR = 0.2
"""Variance of the Gaussian noise added to the benchmark value."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/remote/host_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class HostEnv(Environment):
"""Remote host environment."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/remote/network_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class NetworkEnv(Environment):
but no real tuning is expected for it ... yet.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/remote/os_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class OSEnv(Environment):
"""OS Level Environment for a host."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/remote/remote_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RemoteEnv(ScriptEnv):
e.g. Application Environment
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/remote/saas_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class SaaSEnv(Environment):
"""Cloud-based (configurable) SaaS environment."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/script_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ScriptEnv(Environment, metaclass=abc.ABCMeta):

_RE_INVALID = re.compile(r"[^a-zA-Z0-9_]")

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/schedulers/base_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Scheduler(metaclass=ABCMeta):
# pylint: disable=too-many-instance-attributes
"""Base class for the optimization loop scheduling policies."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
config: Dict[str, Any],
Expand Down
14 changes: 7 additions & 7 deletions mlos_bench/mlos_bench/services/config_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def build_storage(
_LOG.info("Created: Storage %s", inst)
return inst

def build_scheduler(
def build_scheduler( # pylint: disable=too-many-arguments
self,
*,
config: Dict[str, Any],
Expand Down Expand Up @@ -395,8 +395,8 @@ def build_scheduler(
_LOG.info("Created: Scheduler %s", inst)
return inst

def build_environment(
self, # pylint: disable=too-many-arguments
def build_environment( # pylint: disable=too-many-arguments
self,
config: Dict[str, Any],
tunables: TunableGroups,
global_config: Optional[Dict[str, Any]] = None,
Expand Down Expand Up @@ -566,8 +566,8 @@ def build_service(

return self._build_composite_service(config_list, global_config, parent)

def load_environment(
self, # pylint: disable=too-many-arguments
def load_environment( # pylint: disable=too-many-arguments
self,
json_file_name: str,
tunables: TunableGroups,
global_config: Optional[Dict[str, Any]] = None,
Expand Down Expand Up @@ -600,8 +600,8 @@ def load_environment(
assert isinstance(config, dict)
return self.build_environment(config, tunables, global_config, parent_args, service)

def load_environment_list(
self, # pylint: disable=too-many-arguments
def load_environment_list( # pylint: disable=too-many-arguments
self,
json_file_name: str,
tunables: TunableGroups,
global_config: Optional[Dict[str, Any]] = None,
Expand Down
4 changes: 2 additions & 2 deletions mlos_bench/mlos_bench/services/types/config_loader_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def load_config(
Free-format dictionary that contains the configuration.
"""

def build_environment(
self, # pylint: disable=too-many-arguments
def build_environment( # pylint: disable=too-many-arguments
self,
config: dict,
tunables: "TunableGroups",
global_config: Optional[dict] = None,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/base_experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ExperimentData(metaclass=ABCMeta):
RESULT_COLUMN_PREFIX = "result."
CONFIG_COLUMN_PREFIX = "config."

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
experiment_id: str,
Expand Down
6 changes: 3 additions & 3 deletions mlos_bench/mlos_bench/storage/base_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def experiments(self) -> Dict[str, ExperimentData]:
"""

@abstractmethod
def experiment(
def experiment( # pylint: disable=too-many-arguments
self,
*,
experiment_id: str,
Expand Down Expand Up @@ -118,7 +118,7 @@ class Experiment(metaclass=ABCMeta):
This class is instantiated in the `Storage.experiment()` method.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
tunables: TunableGroups,
Expand Down Expand Up @@ -338,7 +338,7 @@ class Trial(metaclass=ABCMeta):
This class is instantiated in the `Storage.Experiment.trial()` method.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
tunables: TunableGroups,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/base_trial_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TrialData(metaclass=ABCMeta):
tunable parameters).
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
experiment_id: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class Experiment(Storage.Experiment):
"""Logic for retrieving and storing the results of a single experiment."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
engine: Engine,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ExperimentSqlData(ExperimentData):
scripts and mlos_bench configuration files.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
engine: Engine,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _schema(self) -> DbSchema:
def __repr__(self) -> str:
return self._repr

def experiment(
def experiment( # pylint: disable=too-many-arguments
self,
*,
experiment_id: str,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class Trial(Storage.Trial):
"""Store the results of a single run of the experiment in SQL database."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
engine: Engine,
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/trial_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class TrialSqlData(TrialData):
"""An interface to access the trial data stored in the SQL DB."""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
engine: Engine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TunableConfigTrialGroupSqlData(TunableConfigTrialGroupData):
(e.g., for repeats), which we call a (tunable) config trial group.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
engine: Engine,
Expand Down
2 changes: 1 addition & 1 deletion mlos_core/mlos_core/optimizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OptimizerFactory:
# pylint: disable=too-few-public-methods

@staticmethod
def create(
def create( # pylint: disable=too-many-arguments
*,
parameter_space: ConfigSpace.ConfigurationSpace,
optimization_targets: List[str],
Expand Down
2 changes: 2 additions & 0 deletions mlos_core/mlos_core/optimizers/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
class BaseOptimizer(metaclass=ABCMeta):
"""Optimizer abstract base class defining the basic interface."""

# pylint: disable=too-many-instance-attributes

def __init__(
self,
*,
Expand Down
2 changes: 1 addition & 1 deletion mlos_core/mlos_core/spaces/adapters/llamatune.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LlamaTuneAdapter(BaseSpaceAdapter): # pylint: disable=too-many-instance-a
discretization is used.
"""

def __init__(
def __init__( # pylint: disable=too-many-arguments
self,
*,
orig_parameter_space: ConfigSpace.ConfigurationSpace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_multi_target_opt(
"""Toy multi-target optimization problem to test the optimizers with mixed numeric
types to ensure that original dtypes are retained.
"""
# pylint: disable=too-many-locals
max_iterations = 10

def objective(point: pd.DataFrame) -> pd.DataFrame:
Expand Down
1 change: 1 addition & 0 deletions mlos_core/mlos_core/tests/optimizers/optimizer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ def test_mixed_numerics_type_input_space_types(
"""Toy problem to test the optimizers with mixed numeric types to ensure that
original dtypes are retained.
"""
# pylint: disable=too-many-locals
max_iterations = 10
if kwargs is None:
kwargs = {}
Expand Down
Loading

0 comments on commit 325b187

Please sign in to comment.