[Numpy-discussion] StringDType scalar type

2025-04-28 Thread Mateusz Sokol
Hi all! There's an ongoing discussion about introducing a dedicated scalar type for `StringDType`. One of the remarks was that the scope of the change is large enough so it deserves a separate paragraph in the NEP 55. It's also vital to collect more opinions from the community before the actual

[Numpy-discussion] Making `T` property Array API compatible

2025-04-12 Thread Mateusz Sokol
Hi all! The Array API standard states that `T` property should only be applied to 2-dimensional arrays, in all other cases it should raise an error: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.T To ensure that NumPy also follows this rule, I opened a PR tha

[Numpy-discussion] Re: [EXTERNAL] Copy on __setitem__

2024-12-26 Thread Mateusz Sokol
It looks like general assignment function `array_assign_subscript` calls `PyArray_CopyObject(view, op)` link which in turn always calls `PyArray_DiscoverDTypeAndShape` with `cop

[Numpy-discussion] New Ruff rule for migrating to NumPy 2.0

2024-01-11 Thread Mateusz Sokol
Hi all! Some time ago we added a new rule to Ruff linter, "NPY201", which updates the codebase to a NumPy 2.0 compatible version. You can read about it in the migration guide: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin And on the Ruff docs website: https://docs.astral

[Numpy-discussion] Re: Adding NumpyUnpickler to Numpy 1.26 and future Numpy 2.0

2023-10-11 Thread Mateusz Sokol
Hi! Thank you for all your feedback this week! We have made a decision to take a less disruptive option that we considered and that came up in this discussion. We back out of the `NumpyUnpickler` class solution for reading pickles across major NumPy versions. Instead, we will retain `numpy.core`

[Numpy-discussion] Re: Change in numpy.percentile

2023-10-09 Thread Mateusz Sokol
Just to mention for visibility: Introducing a "nan" option and deprecating nan* functions was considered for 2.0 main namespace refactor but it was deemed large enough to be (hopefully) tackled in a separate story/project. https://github.com/numpy/numpy/issues/24306#issuecomment-1660073584 (first

[Numpy-discussion] [NEP 52] Introduction of `array_utils` public namespace in `np.lib` submodule

2023-08-28 Thread Mateusz Sokol
Hi all! The two most important goals of NEP 52 are cleanups of the top `np` namespace and `np.lib` namespace. A set of functions from `np` and `np.lib.*` submodules has been identified that could establish a new public namespace within the `np.lib` submodule. The issue https://github.com/numpy