scikit-hep / awkward

Manipulate JSON-like data with NumPy-like idioms.
https://awkward-array.org
BSD 3-Clause "New" or "Revised" License
827 stars 85 forks source link

For NumPy compatibility, ak.sort's 'stable' (bool) should be 'kind' (str) #615

Closed jpivarski closed 10 months ago

jpivarski commented 3 years ago

The interface to ak.sort and ak.argsort should be more like np.sort and np.argsort.

At this stage, at least, I'll deprecate the stable (bool) option in favor of a kind (str), but leave ascending as it is.

Before doing this, I should create a formal roadmap with scheduled releases, since the deprecation date would not the Feb 1 date, but the one after that, whatever that is (#616).

jpivarski commented 3 years ago

@ianna, since the NumPy default is "quicksort", I can't do this until a quicksort exists.

But we now have a formal roadmap, so if quicksort is available in January or February, then we can set the deprecation for 1.2.0 (April, 2021).

ianna commented 3 years ago

@jpivarski - incidentally NumPy quicksort has been changed to introsort: https://numpy.org/doc/stable/reference/generated/numpy.sort.html

It's the same as in AwkwardArray :-)

agoose77 commented 10 months ago

@jpivarski I think we can close this: Awkward doesn't implement the same sorting routines as NumPy, but we do support kind. Now that we have dedicated NEP-18 entrypoints, we translate the kind to a stable vs non-stable sort.