From 4b62918c03439b1fe5de95f027d64b32c10a1dcb Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Fri, 17 Jun 2022 18:04:52 -0400 Subject: MAINT: RuntimeError for unexpected integer overflow --- numpy/lib/arraysetops.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'numpy/lib/arraysetops.py') 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 " -- cgit v1.2.1