How to use the dwave.inspector to inspect a problem that was run in the past?
Is it possible to use the dwave.inspector to inspect a problem that was run in the past? How? This is what I am trying:
>>> import dwave.inspector
>>> inspector.show(problemId='f9b3bb79-1584-4fbb-88ea-81340df68b11')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'inspector' is not defined
>>> dwave.inspector.show(problemId='f9b3bb79-1584-4fbb-88ea-81340df68b11')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/siddjain/opt/anaconda3/envs/dwave/lib/python3.8/site-packages/dwave/inspector/__init__.py", line 181, in show
data = from_objects(*args, **kwargs)
File "/Users/siddjain/opt/anaconda3/envs/dwave/lib/python3.8/site-packages/dwave/inspector/adapters.py", line 852, in from_objects
raise ValueError(
ValueError: invalid combination of arguments provided: if data capture not enabled, problem/response/solver have to be specified; also, make sure a structured problem is being inspected
If inspecting a problem using the problem id is not possible, then what data do I need to persist to be able to inspect it in future. Code explaining the answer would be appreciated.
Comments
Hi Siddharth,
Currently, Ocean does not provide a method to fetch and inspect problems you submitted in the past.
However, for an active session, problem ID can be used to inspect a submitted problem, provided data capture is enabled at the time of problem submission. This can be done by placing the import dwave.inspector statement at the beginning of your program or before the sample function call is made.
If data capture is not enabled prior to sampling, you would have to provide all the relevant data explicitly to the show() function call. For a description of accepted arguments, refer to the function calls that start with show_ on this page here that call the show() function. Here are some code examples to refer to: https://github.com/dwavesystems/dwave-inspector/tree/master/examples.
Instead of storing the relevant data, I would suggest resubmitting the old problem with data capture enabled.
I hope this helps! Please let me know if you have any other questions.
Please sign in to leave a comment.