From d3f464de8b5595f973d3edc083ffd05d3e97f05e Mon Sep 17 00:00:00 2001 From: Bernie Beckerman Date: Mon, 4 Mar 2024 13:03:23 -0800 Subject: [PATCH] address lint+pyre failures (#2244) Summary: Pull Request resolved: https://github.com/facebook/Ax/pull/2244 OSS linter seems to be failing (https://github.com/facebook/Ax/actions/runs/8142510522/job/22252224158). This addresses the observed failures. May be related to https://fb.workplace.com/groups/aeeng/permalink/1603431750415515/ Also moves some pyre-ignores that were out of place, per failing pyre command. Reviewed By: mpolson64 Differential Revision: D54492153 fbshipit-source-id: 3b553f435fb60da6190cfd15ae29e82a336f4aaa --- ax/runners/tests/test_single_running_trial_mixin.py | 5 ++--- ax/service/tests/scheduler_test_utils.py | 5 ++--- ax/service/tests/test_scheduler.py | 3 ++- ax/service/utils/instantiation.py | 3 ++- ax/utils/testing/core_stubs.py | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ax/runners/tests/test_single_running_trial_mixin.py b/ax/runners/tests/test_single_running_trial_mixin.py index 956a61675bf..29b0aeb1521 100644 --- a/ax/runners/tests/test_single_running_trial_mixin.py +++ b/ax/runners/tests/test_single_running_trial_mixin.py @@ -14,9 +14,8 @@ from ax.utils.testing.core_stubs import get_branin_experiment -class SyntheticRunnerWithSingleRunningTrial( - SingleRunningTrialMixin, SyntheticRunner -): ... +class SyntheticRunnerWithSingleRunningTrial(SingleRunningTrialMixin, SyntheticRunner): + pass class SingleRunningTrialMixinTest(TestCase): diff --git a/ax/service/tests/scheduler_test_utils.py b/ax/service/tests/scheduler_test_utils.py index 25669f55c47..d762eaf12d5 100644 --- a/ax/service/tests/scheduler_test_utils.py +++ b/ax/service/tests/scheduler_test_utils.py @@ -96,9 +96,8 @@ def poll_trial_status( return {} -class SyntheticRunnerWithSingleRunningTrial( - SingleRunningTrialMixin, SyntheticRunner -): ... +class SyntheticRunnerWithSingleRunningTrial(SingleRunningTrialMixin, SyntheticRunner): + pass class SyntheticRunnerWithPredictableStatusPolling(SyntheticRunner): diff --git a/ax/service/tests/test_scheduler.py b/ax/service/tests/test_scheduler.py index e52491517db..e6e08dc563c 100644 --- a/ax/service/tests/test_scheduler.py +++ b/ax/service/tests/test_scheduler.py @@ -8,4 +8,5 @@ from ax.service.tests.scheduler_test_utils import AxSchedulerTestCase -class TestAxScheduler(AxSchedulerTestCase): ... +class TestAxScheduler(AxSchedulerTestCase): + pass diff --git a/ax/service/utils/instantiation.py b/ax/service/utils/instantiation.py index 44fbd278eee..791781bf983 100644 --- a/ax/service/utils/instantiation.py +++ b/ax/service/utils/instantiation.py @@ -271,8 +271,9 @@ def _make_fixed_param( parameter_type=( cls._get_parameter_type(type(value)) # pyre-ignore[6] if parameter_type is None + # pyre-ignore[6] else cls._get_parameter_type(PARAM_TYPES[parameter_type]) - ), # pyre-ignore[6] + ), value=value, # pyre-ignore[6] is_fidelity=checked_cast(bool, representation.get("is_fidelity", False)), target_value=representation.get("target_value", None), # pyre-ignore[6] diff --git a/ax/utils/testing/core_stubs.py b/ax/utils/testing/core_stubs.py index 9ee6d749809..0026ffb297c 100644 --- a/ax/utils/testing/core_stubs.py +++ b/ax/utils/testing/core_stubs.py @@ -1990,7 +1990,9 @@ def get_percentile_early_stopping_strategy() -> PercentileEarlyStoppingStrategy: ) -def get_percentile_early_stopping_strategy_with_non_objective_metric_name() -> PercentileEarlyStoppingStrategy: # noqa +def get_percentile_early_stopping_strategy_with_non_objective_metric_name() -> ( + PercentileEarlyStoppingStrategy +): return PercentileEarlyStoppingStrategy( metric_names=["foo"], percentile_threshold=0.25,