MCPcopy
hub / github.com/hyperopt/hyperopt / test_pin_thread_on

Method test_pin_thread_on

hyperopt/tests/integration/test_spark.py:610–624  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

608 self.assertEqual(spark_trials.count_successful_trials(), 5)
609
610 def test_pin_thread_on(self):
611 if not self._pin_mode_enabled:
612 raise unittest.SkipTest()
613
614 spark_trials = SparkTrials(parallelism=2)
615 self.assertTrue(spark_trials._spark_pinned_threads_enabled)
616 self.assertTrue(spark_trials._spark_supports_job_cancelling)
617 fmin(
618 fn=lambda x: x + 1,
619 space=hp.uniform("x", -1, 1),
620 algo=rand.suggest,
621 max_evals=5,
622 trials=spark_trials,
623 )
624 self.assertEqual(spark_trials.count_successful_trials(), 5)

Callers

nothing calls this directly

Calls 3

SparkTrialsClass · 0.90
fminFunction · 0.90

Tested by

no test coverage detected