summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-11-28 17:43:13 +0100
committerGitHub <noreply@github.com>2022-11-28 17:43:13 +0100
commit4dc5321a3d8d308808a200a3bf621651a5e67f5a (patch)
treec1377cc480147fc402243dc9e5129f5e16b3959a /doc
parentc687f2d16f8ba965828fee3a001844b4952474f5 (diff)
downloadnumpy-4dc5321a3d8d308808a200a3bf621651a5e67f5a.tar.gz
ENH: Slightly improve error when gufunc axes has wrong size (#22675)
* DOC: Slightly improve error when gufunc axes has wrong size My hope was to tweak it into something useful that: a @= b can raise when `b` should have two dimensions and has two axes specified but actually only has one. I didn't succeed, but I still think it a slight improvement to give the ufunc name and the actual core dimensions. * ENH: Use AxisError when gufunc axes appear wrong due to the number of entries This allows catching the error relatively targeted for in-place matmul `a @= b` which may use this path. * MAINT: Restore most TypeErrors (a bit more compexl than nice, but...) * DOC: add a release note Co-authored-by: mattip <matti.picus@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/release/upcoming_changes/22675.compatibility.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/22675.compatibility.rst b/doc/release/upcoming_changes/22675.compatibility.rst
new file mode 100644
index 000000000..f3c08246b
--- /dev/null
+++ b/doc/release/upcoming_changes/22675.compatibility.rst
@@ -0,0 +1,6 @@
+Changed error message and type for bad ``axes`` argument to ``ufunc``
+---------------------------------------------------------------------
+The error message and type when a wrong ``axes`` value is passed to
+``ufunc(..., axes=[...])``` has changed. The message is now more indicative of
+the problem, and if the value is mismatched an ``AxisError`` will be raised.
+A ``TypeError`` will still be raised for invalid input types.