I can create an uncertainty array from a pair of arrays, one representing nominal values and one representing error values. However, I cannot seem to figure out how to pass a list or array of Uncertainty values to create a new np.array of Uncertainty values.
Indeed, this implementation of array seems to prevent such:
def __array__(self, t=None) -> np.ndarray:
warnings.warn(
"The uncertainty is stripped when downcasting to ndarray.",
NumpyDowncastWarning,
stacklevel=2,
)
return np.asarray(self._nom)
ndarrays can hold object types (which is what makes PintArrays) work.
I can create an uncertainty array from a pair of arrays, one representing nominal values and one representing error values. However, I cannot seem to figure out how to pass a list or array of Uncertainty values to create a new np.array of Uncertainty values.
Indeed, this implementation of array seems to prevent such:
ndarrays can hold object types (which is what makes PintArrays) work.