Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] pygrass – test_pygrass_doctests fails with Numpy 2 #4116

Open
nilason opened this issue Jul 31, 2024 · 1 comment
Open

[Bug] pygrass – test_pygrass_doctests fails with Numpy 2 #4116

nilason opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working Python Related code is in Python
Milestone

Comments

@nilason
Copy link
Contributor

nilason commented Jul 31, 2024

test_pygrass_doctests fails with Python 3.12 and Numpy 2.0.1 at least on Mac, which is a regression compared to current CI setup with Python 3.11 and Numpy 1.26.4.

test_pygrass_doctests

./python/grass/pygrass – test_pygrass_doctests

❌ Test failed

Test	test_pygrass_doctests
Testsuite	./python/grass/pygrass
Test file	./python/grass/pygrass/testsuite/test_pygrass_doctests.py
Status	FAILED
Return code	1
Number of tests	10
Successful tests	9
Failed tests	1
Percent successful	90%
Test duration	0:00:00.458122
Supplementary files

standard output (stdout)
standard error output (stderr)
Standard error output (stderr)

Building topology for vector map <Utils_test_vector@__python_grass_pygrass_test_pygrass_doctests_Mac_1722423178195_local_28327>...
Registering primitives...

Building areas...
0..9..18..27..36..45..54..63..72..81..90..100
Attaching islands...
0..50..100
Attaching centroids...
0..25..50..75..100
....Building topology for vector map <test_vect_2@__python_grass_pygrass_test_pygrass_doctests_Mac_1722423178195_local_28327>...
Registering primitives...

F.WARNING: Illegal filename <cénsus>. Character <Ã> not allowed.

....
======================================================================
FAIL: get_raster_for_points (grass.pygrass.utils)
Doctest: grass.pygrass.utils.get_raster_for_points
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/micromamba/envs/grass-env/lib/python3.12/doctest.py", line 2256, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for grass.pygrass.utils.get_raster_for_points
  File "etc/python/grass/pygrass/utils.py", line 229, in get_raster_for_points

----------------------------------------------------------------------
File "etc/python/grass/pygrass/utils.py", line 278, in grass.pygrass.utils.get_raster_for_points
Failed example:
    l[0]  # doctest: +ELLIPSIS
Expected:
    (1, 10.0, 6.0, 1)
Got:
    (1, 10.0, 6.0, np.int32(1))
----------------------------------------------------------------------
File "etc/python/grass/pygrass/utils.py", line 280, in grass.pygrass.utils.get_raster_for_points
Failed example:
    l[1]  # doctest: +ELLIPSIS
Expected:
    (2, 12.0, 6.0, 1)
Got:
    (2, 12.0, 6.0, np.int32(1))


----------------------------------------------------------------------
Ran 10 tests in 0.207s
FAILED (failures=1)
@nilason nilason added the bug Something isn't working label Jul 31, 2024
@nilason nilason added this to the 8.5.0 milestone Jul 31, 2024
@echoix
Copy link
Member

echoix commented Jul 31, 2024

See #4100

@nilason nilason changed the title [Bug] test_pygrass_doctests fails with Python 3.12 [Bug] pygrass – test_pygrass_doctests fails with Python 3.12 Jul 31, 2024
@nilason nilason added the Python Related code is in Python label Jul 31, 2024
@nilason nilason changed the title [Bug] pygrass – test_pygrass_doctests fails with Python 3.12 [Bug] pygrass – test_pygrass_doctests fails with Numpy 2 Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

No branches or pull requests

2 participants