Need to expose problem execution information in dwavesampler
Current Problem Problem execution information:- When you run problem using dwave sampler , it will be helpful to get back problem execution information Ex:- problem id status of job error message if any
It will be helpful to keep track of problem you submitted or provide extra information to support in case of failure
Proposed Solution Expose problem execution information as an option when problem is executed Ex:- response = sampler.sample_ising({0: -1, 1: 1}, {}) response object can have this debugging information about problem execution problemid , status etc
Would like to have this infomation available in dwavesampler https://docs.dwavesys.com/docs/latest/c_rest_api_3.html
Alternatives Considered This infomation is available in cloud client but not in dwavesampler
Thanks @hemantbpawar. In the DWaveSampler (and in SampleSets created from a future), we are limited to the Future API. The sample set is future-like in that it does not resolve until it is read and it has some methods like .done() and we have some other methods requested (see https://github.com/dwavesystems/dimod/issues/479).
We could generate an issue on the cloud-client to save some of the values (like id, solved_on and submitted_on) that are kept as attributes on the future, but not saved in the result.
We could also an .exception() method to the SampleSet.
But for values like eta_min and status, it is not obvious how to propogate them to the user through the Python Future API.
@randomir pointed out that rather than the cloud-client dumping values like id into the .result, it would be better for the DWaveSampler to read them off in the hook.
Another approach would be keeping the SampleSet._future around even after it is resolved and then the remote_status etc can be read off of it. The downside is that depending on the number of samples etc, it is semi expensive to keep around.
A third approach would be adding the problem id (or maybe the whole future) to the exception raised when resolving the sample set. E.g.
try:
sampleset.resolve()
except Exception as err:
job_id = err.future.id