MAINT: remove deprecated style argument and deprecations in fromnumeric#30068
MAINT: remove deprecated style argument and deprecations in fromnumeric#30068mattip merged 4 commits intonumpy:mainfrom
style argument and deprecations in fromnumeric#30068Conversation
|
As you can see in the failing stubtest CI jobs, you'll also need to update the .pyi stubs to edit: actually I see now that it's a different issue, I'll have a closer look |
0a478ce to
1457704
Compare
…d cleans up outdated code paths: - Removed the deprecated `style` parameter from `array2string` in `numpy/_core/arrayprint.py`, along with its related documentation and tests. - Replaced the deprecation warning for `np.sum` called on generators with a `TypeError` in `numpy/_core/fromnumeric.py`, since this behavior is now unsupported. - Removed a leftover docstring that was intended to be deleted in PR numpy#26268.
1457704 to
41cebd0
Compare
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
mattip
left a comment
There was a problem hiding this comment.
Looks good, a few formatting/comment nits.
|
|
||
| * The ``style`` parameter has been removed from ``numpy.array2string``. This argument had no effect since Numpy 1.14.0. | ||
|
|
||
| * Calling ``np.sum(generator)`` directly on a generator object now raises a `TypeError`. This behavior was deprecated in NumPy 1.15.0. Use ``np.sum(np.fromiter(generator))`` or the python ``sum`` builtin instead. |
There was a problem hiding this comment.
Why doesn't the linter complain about this long line? Please reflow the note to 88 columns.
There was a problem hiding this comment.
I used to check the linting using the ruff tool. However, I found that it can only check the Python files. In requirements/linter_requirements, only ruff, GitPython, and cython-lint are present. And, I checked that none of these linters check the .rst files in the doc/release/upcoming_changes directory. So, python tools/linter.py passes successfully. Is there any linting tool to check those .rst files?
dfcbaec to
080b499
Compare
Co-authored-by: Matti Picus <matti.picus@gmail.com>
080b499 to
e535e3c
Compare
|
Thanks @Abhi210 |
|
Hmm, this cleanup is causing problems in astropy because the order of positional arguments changed for |
Yea seems like a good idea to me |
|
OK, thanks! See #30139. |
This PR references gh-11521. It removes deprecated functionality and cleans up outdated code paths:
styleparameter fromarray2stringinnumpy/_core/arrayprint.py, along with its related documentation and tests.np.sumcalled on generators with aTypeErrorinnumpy/_core/fromnumeric.py, since this behavior is now unsupported.nonzero#26268.