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

tests/test_gltf.py::GLTFTest::test_vertex_colors_import fails with NumPy 2.0.0rc2 #2237

Closed
mgorny opened this issue Jun 7, 2024 · 0 comments · Fixed by #2238
Closed

tests/test_gltf.py::GLTFTest::test_vertex_colors_import fails with NumPy 2.0.0rc2 #2237

mgorny opened this issue Jun 7, 2024 · 0 comments · Fixed by #2238

Comments

@mgorny
Copy link
Contributor

mgorny commented Jun 7, 2024

It seems that 4.4.1 introduced a new failure with NumPy 2. The test seems to pass with NumPy 1.

$ python -m pytest tests/test_gltf.py::GLTFTest::test_vertex_colors_import -vv
========================================================= test session starts =========================================================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0 -- /tmp/trimesh/.venv/bin/python
cachedir: .pytest_cache
rootdir: /tmp/trimesh
configfile: pyproject.toml
plugins: xdist-3.6.1
collected 1 item                                                                                                                      

tests/test_gltf.py::GLTFTest::test_vertex_colors_import FAILED                                                                  [100%]

============================================================== FAILURES ===============================================================
_________________________________________________ GLTFTest.test_vertex_colors_import __________________________________________________

self = <tests.test_gltf.GLTFTest testMethod=test_vertex_colors_import>

    def test_vertex_colors_import(self):
        # get a mesh with face colors
        m = g.get_mesh("cubevc.glb")
        assert len(m.geometry.items()) > 0
    
        mesh = next(iter(m.geometry.items()))[1]
        assert mesh is not None
    
        # Loaded mesh should have vertex colors
        assert hasattr(mesh.visual, "vertex_colors")
    
        # Loaded mesh should have all vertex colors filled with magenta color
        magenta = g.np.array([255, 0, 255, 255])
        for color in mesh.visual.vertex_colors:
            is_magenta = g.np.array_equal(color, magenta)
>           assert is_magenta, f"Imported vertex color is not of expected value: got {color}, expected {magenta}"
E           AssertionError: Imported vertex color is not of expected value: got [  1   0   1 255], expected [255   0 255 255]
E           assert False

tests/test_gltf.py:814: AssertionError
======================================================= short test summary info =======================================================
FAILED tests/test_gltf.py::GLTFTest::test_vertex_colors_import - AssertionError: Imported vertex color is not of expected value: got [  1   0   1 255], expected [255   0 255 255]
assert False
========================================================== 1 failed in 0.28s ==========================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant