-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Separating some things out of #8825, since these are important to decide upon before 4.0, since after we cannot seriously change it any more: for a number of numpy functions, a decision still needs to be made, mostly on whether to stick exactly to the numpy docstring or to make adjustments to parameter defaults that make the function more useful for Quantity
-
np.isclose,np.allclose: these were never all that useful since internally they calculateabs(a - b) < atol + rtol * abs(a)andatolis given as a small number, which is interpreted as dimensionless. ForQuantity, we could either set it to0or assume the units ofa, but in either case it would become inconsistent with the docstring that users actually see. -
np.broadcast_arraysandnp.broadcast_toby default return plain arrays, needingsubok=Trueto work forQuantity. We could change the default if aQuantityis present. Again, the possible issue is that the docstring will no longer be correct.
My own sense is to adjust isclose and allclose, since that allows things to "just work". But the question is how (0 or small number times unit of first).
For broadcast*, though, I think there may be code relying on it always returning plain ndarray, so probably it is best not to change the default.
cc @adrn