dimod.SampleSet.done#
- SampleSet.done()[source]#
Return True if a pending computation is done.
Used when a
SampleSet
is constructed withSampleSet.from_future()
.Examples
This example uses a
Future
object directly. Typically aExecutor
sets the result of the future (see documentation forconcurrent.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