[PATCH] Have get_index_dtype follow its documentation and return int32 or int64
authorserge-sans-paille <serge.guelton@telecom-bretagne.eu>
Tue, 19 Jul 2022 17:04:28 +0000 (19:04 +0200)
committerDrew Parsons <dparsons@debian.org>
Tue, 7 Feb 2023 08:49:03 +0000 (08:49 +0000)
This also avoids np.intc which is a portability pain.
Adjust group_sparse signature accordingly.

This should also fix https://github.com/serge-sans-paille/pythran/issues/2002

Gbp-Pq: Name pythran_type_PR16646.patch

scipy/optimize/_group_columns.py

index 99751d28e4e26115a46541dc4c288ef43dc056c3..cc0412f0cec5f4bd5b0c2835920f4914fee40ce3 100644 (file)
@@ -52,10 +52,10 @@ def group_dense(m, n, A):
     return groups
 
 
-#pythran export group_sparse(int, int, int32[], int32[])
-#pythran export group_sparse(int, int, int64[], int64[])
-#pythran export group_sparse(int, int, int32[::], int32[::])
-#pythran export group_sparse(int, int, int64[::], int64[::])
+# pythran export group_sparse(int, int, int32[] or int32[::],
+#                                       int32[] or int32[::])
+# pythran export group_sparse(int, int, int64[] or int64[::],
+#                                       int64[] or int64[::])
 def group_sparse(m, n, indices, indptr):
     groups = -np.ones(n, dtype=np.intp)
     current_group = 0