How to use the dimod.testing.assert_sampler_api function in dimod

To help you get started, we’ve selected a few dimod examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dwavesystems / dimod / tests / test_clipcomposite.py View on Github external
def test_instantiation_smoketest(self):
        sampler = ClipComposite(NullSampler())
        dimod.testing.assert_sampler_api(sampler)
github dwavesystems / dimod / tests / test_exact_solver.py View on Github external
def test_instantiation(self):
        sampler = dimod.ExactSolver()

        dimod.testing.assert_sampler_api(sampler)

        # this sampler has no properties and has no accepted parameters
        self.assertEqual(sampler.properties, {})
        self.assertEqual(sampler.parameters, {})
github dwavesystems / dwave-neal / tests / test_sampler.py View on Github external
def test_instantiation(self):
        sampler = Neal()
        dimod.testing.assert_sampler_api(sampler)
github dwavesystems / dimod / tests / test_null_sampler.py View on Github external
def test_construction(self):
        sampler = dimod.NullSampler()

        dimod.testing.assert_sampler_api(sampler)
github dwavesystems / dimod / tests / test_truncatecomposite.py View on Github external
def test_10(self):
        sampler = TruncateComposite(ExactSolver(), 10)
        dtest.assert_sampler_api(sampler)
        dtest.assert_composite_api(sampler)

        self.assertEqual(sampler.parameters, {})
github dwavesystems / dimod / tests / test_scalecomposite.py View on Github external
def test_api(self):
        sampler = ScaleComposite(dimod.ExactSolver())
        dimod.testing.assert_sampler_api(sampler)
github dwavesystems / dimod / tests / test_random_sampler.py View on Github external
def test_initialization(self):
        sampler = dimod.RandomSampler()

        dtest.assert_sampler_api(sampler)

        self.assertEqual(sampler.properties, {})
        self.assertEqual(sampler.parameters, {'num_reads': []})
github dwavesystems / dimod / tests / test_fixedvariablecomposite.py View on Github external
def test_construction(self):
        sampler = RoofDualityComposite(dimod.ExactSolver())
        dtest.assert_sampler_api(sampler)