Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions qiskit_experiments/data_processing/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ def _data_extraction(self, data: Union[Dict, List[Dict]]) -> np.ndarray:
# The output data format is a standard ndarray with dtype=object with
# arbitrary shape [n_circuits, ...] depending on the measurement setup.
nominal_values = np.asarray(data_to_process, float)
return unp.uarray(
nominal_values=nominal_values,
std_devs=np.full_like(nominal_values, np.nan, dtype=float),
)
with np.errstate(invalid="ignore"):
# Setting std_devs to NaN will trigger floating point exceptions
# which we can ignore. See https://stackoverflow.com/q/75656026
uarray = unp.uarray(
nominal_values=nominal_values,
std_devs=np.full_like(nominal_values, np.nan, dtype=float),
)
return uarray
else:
# Likely level2 counts or level2 memory data. Cannot be typecasted to ufloat.
# The output data format is a standard ndarray with dtype=object with
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/uarray-warning-d4c38566a510e58f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
A ``RuntimeWarning`` will no longer be generated by numpy when running a
data processor on level one data. See `#1071
<https://github.com/Qiskit/qiskit-experiments/issues/1071>_`.