Skip to content

Commit

Permalink
address lint+pyre failures (#2244)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
Bernie Beckerman authored and facebook-github-bot committed Mar 4, 2024
1 parent 85bd5b0 commit d3f464d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions ax/runners/tests/test_single_running_trial_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions ax/service/tests/scheduler_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ def poll_trial_status(
return {}


class SyntheticRunnerWithSingleRunningTrial(
SingleRunningTrialMixin, SyntheticRunner
): ...
class SyntheticRunnerWithSingleRunningTrial(SingleRunningTrialMixin, SyntheticRunner):
pass


class SyntheticRunnerWithPredictableStatusPolling(SyntheticRunner):
Expand Down
3 changes: 2 additions & 1 deletion ax/service/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
from ax.service.tests.scheduler_test_utils import AxSchedulerTestCase


class TestAxScheduler(AxSchedulerTestCase): ...
class TestAxScheduler(AxSchedulerTestCase):
pass
3 changes: 2 additions & 1 deletion ax/service/utils/instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 3 additions & 1 deletion ax/utils/testing/core_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d3f464d

Please sign in to comment.