summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authorMilesCranmer <miles.cranmer@gmail.com>2022-06-17 18:04:52 -0400
committerMilesCranmer <miles.cranmer@gmail.com>2022-06-17 18:04:52 -0400
commit4b62918c03439b1fe5de95f027d64b32c10a1dcb (patch)
tree81c6188920fd3ff3c074a7cad5bb5bb8d4cf99aa /numpy/lib/arraysetops.py
parent3533b861650cff2de7680f1848cd05826f94d480 (diff)
downloadnumpy-4b62918c03439b1fe5de95f027d64b32c10a1dcb.tar.gz
MAINT: RuntimeError for unexpected integer overflow
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 339f4e60c..8ced2f6d9 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -672,6 +672,13 @@ def in1d(ar1, ar2, assume_unique=False, invert=False, kind=None):
ar2_min]
return outgoing_array
+ elif kind == 'dictionary': # not range_safe_from_overflow
+ raise RuntimeError(
+ "You have specified kind='dictionary', "
+ "but the range of values in `ar2` exceeds the "
+ "maximum integer of the datatype. "
+ "Please set `kind` to None or 'mergesort'."
+ )
elif kind == 'dictionary':
raise ValueError(
"The 'dictionary' method is only "