-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PrimitiveJob serializable #12963
base: main
Are you sure you want to change the base?
Conversation
One or more of the following people are relevant to this code:
|
@@ -93,9 +93,6 @@ def __init__(self, *, shape: ShapeInput = (), **data): | |||
def __len__(self): | |||
return len(self._data) | |||
|
|||
def __setattr__(self, *_): | |||
raise NotImplementedError | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok to remove this? This __setattr__
is preventing the serialization of the job result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you answer the question, @ihincks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#12787 asked the same question.
Pull Request Test Coverage Report for Build 10423431976Details
💛 - Coveralls |
Summary
In
qiskit-ibm-runtime
we want to add job methods to ourQiskitRuntimeLocalService
(Issue Qiskit/qiskit-ibm-runtime#1607). In order to savePrimitiveJob
objects locally we need a way to serialize them. It's currently not serializable due to the use ofThreadPoolExecutor
:qiskit/qiskit/primitives/primitive_job.py
Lines 47 to 48 in 35d0954
Credit to @t-imamichi
Details and comments