-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
from numpy_quaddtype import QuadPrecDType, QuadPrecision
import numpy as np
x=np.array([1,2,3], dtype=QuadPrecDType())
i=np.argsort(x)
fails for me (numpy version 2.5.0.dev0+git20260109.f254f12) because of a lack of comparison function:
In [3]: np.argsort(x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
File ~/miniforge3/envs/nptest2/lib/python3.13/site-packages/numpy/_core/fromnumeric.py:54, in _wrapfunc(obj, method, *args, **kwds)
53 try:
---> 54 return bound(*args, **kwds)
55 except TypeError:
56 # A TypeError occurs if the object does have such a method in its
57 # class, but its signature is not identical to that of NumPy's. This
(...) 61 # Call _wrapit from within the except clause to ensure a potential
62 # exception has a traceback chain.
TypeError: type does not have compare function
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 np.argsort(x)
File ~/miniforge3/envs/nptest2/lib/python3.13/site-packages/numpy/_core/fromnumeric.py:1213, in argsort(a, axis, kind, order, stable)
1100 @array_function_dispatch(_argsort_dispatcher)
1101 def argsort(a, axis=-1, kind=None, order=None, *, stable=None):
1102 """
1103 Returns the indices that would sort an array.
1104
(...) 1211
1212 """
-> 1213 return _wrapfunc(
1214 a, 'argsort', axis=axis, kind=kind, order=order, stable=stable
1215 )
File ~/miniforge3/envs/nptest2/lib/python3.13/site-packages/numpy/_core/fromnumeric.py:63, in _wrapfunc(obj, method, *args, **kwds)
54 return bound(*args, **kwds)
55 except TypeError:
56 # A TypeError occurs if the object does have such a method in its
57 # class, but its signature is not identical to that of NumPy's. This
(...) 61 # Call _wrapit from within the except clause to ensure a potential
62 # exception has a traceback chain.
---> 63 return _wrapit(obj, method, *args, **kwds)
File ~/miniforge3/envs/nptest2/lib/python3.13/site-packages/numpy/_core/fromnumeric.py:43, in _wrapit(obj, method, *args, **kwds)
40 # As this already tried the method, subok is maybe quite reasonable here
41 # but this follows what was done before. TODO: revisit this.
42 arr, = conv.as_arrays(subok=False)
---> 43 result = getattr(arr, method)(*args, **kwds)
45 return conv.wrap(result, to_scalar=False)
TypeError: type does not have compare function
Let me know if I'm doing something wrong here. Otherwise thanks for investigating.
Metadata
Metadata
Assignees
Labels
No labels