MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / done

Method done

dwave/cloud/computation.py:446–473  ·  view source on GitHub ↗

Check whether the solver received a response for a submitted problem. Non-blocking call that checks whether the solver has received a response from the remote resource. Returns: Boolean: True if solver received a response. Examples: This exa

(self)

Source from the content-addressed store, hash-verified

444 return self._results_ready_event.wait(timeout)
445
446 def done(self):
447 """Check whether the solver received a response for a submitted problem.
448
449 Non-blocking call that checks whether the solver has received a response
450 from the remote resource.
451
452 Returns:
453 Boolean: True if solver received a response.
454
455 Examples:
456 This example creates a solver using the local system's default
457 D-Wave Cloud Client configuration file, submits a simple QUBO
458 problem to a remote D-Wave resource for 100 samples, and checks a
459 couple of times whether sampling is completed.
460
461 >>> from dwave.cloud import Client
462 >>> client = Client.from_config() # doctest: +SKIP
463 >>> solver = client.get_solver() # doctest: +SKIP
464 >>> u, v = next(iter(solver.edges)) # doctest: +SKIP
465 >>> Q = {(u, u): -1, (u, v): 0, (v, u): 2, (v, v): -1} # doctest: +SKIP
466 >>> computation = solver.sample_qubo(Q, num_reads=100) # doctest: +SKIP
467 >>> computation.done() # doctest: +SKIP
468 False
469 >>> computation.done() # doctest: +SKIP
470 True
471 >>> client.close() # doctest: +SKIP
472 """
473 return self._results_ready_event.is_set()
474
475 def cancel(self):
476 """Try to cancel the problem corresponding to this result.

Callers 8

_add_eventMethod · 0.95
cancelMethod · 0.95
wait_multipleMethod · 0.80
filter_readyMethod · 0.80
addMethod · 0.80
test_wait_manyMethod · 0.80
test_as_completedMethod · 0.80

Calls

no outgoing calls

Tested by 3

test_wait_manyMethod · 0.64
test_as_completedMethod · 0.64