-
Notifications
You must be signed in to change notification settings - Fork 452
Open
Description
Pyre Bug
Bug description
pyre incorrectly reports undefined attribute errors for standard NumPy functions (array, sqrt,fft) when using NumPy v2.x.
Reproduction steps
Test code:
import numpy as np
def calculate_square_root() -> None:
arr = np.array([1, 4, 9, 16, 25])
sqrt_arr = np.sqrt(arr)
print(sqrt_arr)
if __name__ == "__main__":
calculate_square_root()Versions:
- python = "3.11.4"
- numpy = "2.3.2"
- pyre-check = "0.9.23"
Run output:
/Users/kumbasar/repo/PyreNumpy2/.venv/bin/python /Users/kumbasar/repo/PyreNumpy2/src/test.py
[1. 2. 3. 4. 5.]
Process finished with exit code 0Expected behavior
pyre should recognize standard NumPy functions and attributes without reporting type errors. Like this:
ƛ No type errors foundLogs
pyre reports false type errors for standard NumPy 2.x functions.
Console log:
(.venv) ➜ PyreNumpy2 poetry run pyre --version none --strict
Configuration file exists at /Users/kumbasar/Library/Preferences/pypoetry, reusing this directory.
Consider moving TOML configuration files to /Users/kumbasar/Library/Application Support/pypoetry, as support for the legacy directory will be removed in an upcoming release.
ƛ Cannot find a watchman root. Incremental check will not be functional since no filesystem updates will be sent to the Pyre server.
ƛ Found 1 type error!
src/test1.py:6:10 Undefined attribute [16]: Module `numpy` has no attribute `array`.Log file: pyre_rage.log
Additional context
Maybe the stub file is not updated for NumPy v2.x
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels