Closed randomir closed 4 weeks ago
extend dimod.SampleSet with wait_id during construction in SampleSet.from_future()
At least in principal, SampleSet.from_future()
is meant to use with any Future
-like object, the notion of an id
is specific to the cloud-client. On the other hand, this is the only place we use from_future()
so far as I know after years of being more general in principal. So probably not too much of a restriction.
BQM sampler, CQM sampler, as well as the
sample_*
methods ondwave.cloud.Solver
s return aSampleSet
withwait_id()
:But the DQM sampler doesn't:
Root cause:
.wait_id
is set in theFuture.sampleset
property (cloud-client), and since both BQM and CQM samplers defer sampleset contruction to the cloud-client,wait_id
is available. DQM sampler, on the other hand strips and re-attaches labels, so it constructs the sampleset via@dimod.decorators.nonblocking_sample_method
(that doesn't add thewait_id
method).Proposed solution:
dimod.SampleSet
withwait_id
during construction inSampleSet.from_future()
wait_id
in the cloud-clientIt's backwards-compatible, fixes the issue at hand, and will even work with older clients.