dimod.SampleSet.done#

SampleSet.done()[source]#

Return True if a pending computation is done.

Used when a SampleSet is constructed with SampleSet.from_future().

Examples

This example uses a Future object directly. Typically a Executor sets the result of the future (see documentation for concurrent.futures).

>>> from concurrent.futures import Future
...
>>> future = Future()
>>> sampleset = dimod.SampleSet.from_future(future)
>>> future.done()
False
>>> future.set_result(dimod.ExactSolver().sample_ising({0: -1}, {}))
>>> future.done()
True
>>> sampleset.first.energy
-1.0