Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
encode numpy int64 (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 authored Jun 12, 2023
1 parent 79bafc6 commit afbd43c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qiskit_ibm_provider/utils/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def default(self, obj: Any) -> Any: # pylint: disable=arguments-differ
return {"__type__": "ndarray", "__value__": obj.tolist()}
value = _serialize_and_encode(obj, np.save, allow_pickle=False)
return {"__type__": "ndarray", "__value__": value}
if isinstance(obj, np.int64):
return {"__type__": "int", "__value__": int(obj)}
if isinstance(obj, set):
return {"__type__": "set", "__value__": list(obj)}
if isinstance(obj, Result):
Expand Down

0 comments on commit afbd43c

Please sign in to comment.