@@ -97,7 +97,7 @@ template <typename T> class PandasVector {
9797 }
9898
9999 auto ToNdArray () -> nb::object {
100- const auto ndarray = nb::ndarray<nb::numpy, const T, nb::ndim<1 >>(
100+ const auto ndarray = nb::ndarray<nb::numpy, T, nb::ndim<1 >>(
101101 vec_.data (), {vec_.size ()});
102102
103103 external_view_exists_ = true ;
@@ -236,8 +236,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
236236 }
237237 }
238238
239- auto Lookup (const nb::ndarray<const T, nb::ndim<1 >> &values, nb::object mask)
240- -> nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1>> {
239+ auto Lookup (const nb::ndarray<const T, nb::ndim<1 >> &values, nb::object mask) {
241240 if constexpr (IsMasked) {
242241 if (mask.is_none ()) {
243242 throw std::invalid_argument (" mask must not be None!" );
@@ -284,7 +283,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
284283 nb::capsule owner (locs, [](void *p) noexcept { delete[] (size_t *) p; });
285284
286285 const size_t shape[1 ] = {n};
287- return nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1 >>(locs, 1 , shape,
286+ return nb::ndarray<nb::numpy, Py_ssize_t, nb::ndim<1 >>(locs, 1 , shape,
288287 owner);
289288 }
290289
@@ -318,10 +317,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
318317 return tup[1 ];
319318 }
320319
321- auto GetLabelsGroupby (const nb::ndarray<const T, nb::ndim<1 >> &values)
322- -> std::tuple<nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1>>,
323- nb::object> {
324-
320+ auto GetLabelsGroupby (const nb::ndarray<const T, nb::ndim<1 >> &values) {
325321 nb::call_guard<nb::gil_scoped_release>();
326322 const auto values_v = values.view ();
327323 const auto n = values.shape (0 );
@@ -356,7 +352,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
356352 const size_t shape[1 ] = {n};
357353 nb::capsule owner (labels, [](void *p) noexcept { delete[] (size_t *) p; });
358354 const auto labels_arr =
359- nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1 >>(labels, 1 , shape,
355+ nb::ndarray<nb::numpy, Py_ssize_t, nb::ndim<1 >>(labels, 1 , shape,
360356 owner);
361357 return std::make_tuple (labels_arr, uniques.ToNdArray ());
362358 }
@@ -378,7 +374,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
378374 const auto na_val = use_na_value ? nb::cast<T>(na_value) : T ();
379375
380376 if (return_inverse) { // this is really factorize
381- nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1 >> labels;
377+ nb::ndarray<nb::numpy, Py_ssize_t, nb::ndim<1 >> labels;
382378 if (ignore_na) {
383379 if (use_na_value) {
384380 labels = UniqueWithInverse<true , true >(values, uniques, count_prior,
@@ -442,7 +438,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
442438 [[maybe_unused]] Py_ssize_t na_sentinel,
443439 [[maybe_unused]] T na_value,
444440 [[maybe_unused]] nb::object mask_obj = nb::none())
445- -> nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1>> {
441+ -> nb::ndarray<nb::numpy, Py_ssize_t, nb::ndim<1>> {
446442 if constexpr (IsMasked) {
447443 if (mask_obj.is_none ()) {
448444 throw std::invalid_argument (" mask must not be None!" );
@@ -523,7 +519,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
523519
524520 const size_t shape[1 ] = {n};
525521 nb::capsule owner (labels, [](void *p) noexcept { delete[] (size_t *) p; });
526- return nb::ndarray<nb::numpy, const Py_ssize_t, nb::ndim<1 >>(labels, 1 ,
522+ return nb::ndarray<nb::numpy, Py_ssize_t, nb::ndim<1 >>(labels, 1 ,
527523 shape, owner);
528524 }
529525
0 commit comments