mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
Fix linting on master branch (#6174)
This commit is contained in:
@@ -59,7 +59,7 @@ class AutoMLSearcherTest(unittest.TestCase):
|
||||
|
||||
self.assertEqual(len(searcher.next_trials()), 0)
|
||||
for i, trial in enumerate(trials):
|
||||
rewards = [x for x in range(i, i + 10)]
|
||||
rewards = list(range(i, i + 10))
|
||||
random.shuffle(rewards)
|
||||
for reward in rewards:
|
||||
searcher.on_trial_result(trial.trial_id, {"reward": reward})
|
||||
|
||||
@@ -590,7 +590,7 @@ class HyperbandSuite(unittest.TestCase):
|
||||
def testRemove(self):
|
||||
"""Test with 4: start 1, remove 1 pending, add 2, remove 1 pending."""
|
||||
sched, runner = self.schedulerSetup(4)
|
||||
trials = sorted(list(sched._trial_info), key=lambda t: t.trial_id)
|
||||
trials = sorted(sched._trial_info, key=lambda t: t.trial_id)
|
||||
runner._launch_trial(trials[0])
|
||||
sched.on_trial_result(runner, trials[0], result(1, 5))
|
||||
self.assertEqual(trials[0].status, Trial.RUNNING)
|
||||
|
||||
@@ -202,7 +202,7 @@ def RunnerHandler(runner):
|
||||
path = parts.path
|
||||
|
||||
if path == "/trials":
|
||||
return [t for t in runner.get_trials()]
|
||||
return list(runner.get_trials())
|
||||
else:
|
||||
trial_id = path.split("/")[-1]
|
||||
return runner.get_trial(trial_id)
|
||||
|
||||
Reference in New Issue
Block a user