Skip to content

BUG: numpy.alltrue is missing in numpy 2 and there is no lint or migration guide mention #26493

Closed

Description

@illume

Describe the issue:

numpy.alltrue and maybe other functions are missing, and there's no lint for it

Here it mentions that there should probably be a lint for it. #24306 (comment)

I don't think there's much appetite for a compat package and instead I think we're going to point people to ruff to lint and update their code. If there are cases where it's not straightforward to write code that works the same in both NumPy 1 and 2 we should look closer and see if it's possible to add code in a NumPy 1 bugfix release or in NumPy 2 to ease writing code that works in both versions.

Hi.

We noticed numpy.alltrue was gone, and there's no lint for it. Not sure if there's lints for other missing things... I didn't test for that.

pygame/pygame#4239 (comment)
There's quite a few hits for this function https://github.com/search?q=numpy+alltrue&type=code

Reproduce the code example:

import numpy
numpy.alltrue
  • Note this lint check does not find the missing function.
ruff check test/*.py --select NPY201

Error message:

No response

Python and NumPy Versions:

2.0.0rc2

Runtime Environment:

No response

Context for the issue:

No response

Activity

  1. mattip commented on May 21, 2024

    @mattip
    Member

    As mentioned elsewhere by @mtsokol:

    np.alltrue had a deprecation message since 1.25 version. I think we need to mention it in the migration guide if it's missing.

    .. deprecated:: 1.25.0
        ``alltrue`` is deprecated as of NumPy 1.25.0, and will be
        removed in NumPy 2.0. Please use `all` instead.
    
  2. mtsokol commented on May 24, 2024

    @mtsokol
    Member
  3. illume commented on May 24, 2024

    @illume
    Author

    AWESOME

  4. mtsokol commented on Jun 4, 2024

    @mtsokol
    Member

    Closing as #26517 and astral-sh/ruff#11528 were merged.

  5. added this to the 2.0.0 release milestone on Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions