Code Monkey home page Code Monkey logo

Comments (14)

mikedh avatar mikedh commented on July 23, 2024

Thanks for the list!! I have been running the ruff NPY migration rule but I guess they didn't add ptp (i.e astral-sh/ruff#10646) to that.

Seems like a lot of the other ones are "shapely didn't import" maybe it needs a prerelease or something, I'll take a look.

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Seems like a lot of the other ones are "shapely didn't import" maybe it needs a prerelease or something, I'll take a look.

Oh, sorry, that's probably on my end. Lemme rebuild shapely and see if that helps.

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Yeah, it was my fault. I've fixed the Gentoo Shapely package and updated the list. Thanks!

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Do you want me to try making a pull request, at least for the problems with "obvious" solutions?

from trimesh.

mikedh avatar mikedh commented on July 23, 2024

Yeah a PR would be awesome! I got distracted trying to write a ruff rule in addition to NPY201 for the ndarray.ptp removal but since it's not a simple replacement it does not look easy to do automatically like that.

I wonder why they nuked ptp, and why the deprecation messages didn't show up in pytest.

from trimesh.

mikedh avatar mikedh commented on July 23, 2024

I got the ptp instances in the referenced PR and a precision issue with trimesh.grouping. I think the remaining issues are:

  • sympy is failing to convert a float64 scalar because it goes through a string for precision reasons. Not sure why this wasn't fixed by sympy/sympy#26112
  • trimesh.transformations uses doctests as this was pulled from elsewhere. The string formatting changes break all the doctests which I should probably just suck it up and convert to normal test functions.

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Thanks. With the linked PR applied on top of 4.3.2, I'm down to:

FAILED tests/test_transformations.py::TransformTest::test_doctest - ValueError: TestResults(failed=7, attempted=389)
FAILED tests/test_transformations.py::TransformTest::test_symbolic_euler - ValueError: could not convert string to float: 'np.float64(0.417022004702574)'
FAILED tests/test_transformations.py::TransformTest::test_symbolic_translate - ValueError: could not convert string to float: 'np.float64(0.417022004702574)'
FAILED tests/test_voxel.py::VoxelGridTest::test_roundtrip - AssertionError: assert False
 +  where False = <function allclose at 0x7f4bdf7353b0>(array([[-0.55, -0.55, -0.55],\n       [-0.25,  0.55,  0.55]]), array([[-0.55, -0.55, -0.55],\n       [ 0.55,  0.55,  0.55]]))
 +    where <function allclose at 0x7f4bdf7353b0> = <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'>.allclose
 +      where <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'> = g.np
 +    and   array([[-0.55, -0.55, -0.55],\n       [-0.25,  0.55,  0.55]]) = <trimesh.VoxelGrid(11, 11, 11)>.bounds
 +    and   array([[-0.55, -0.55, -0.55],\n       [ 0.55,  0.55,  0.55]]) = <trimesh.VoxelGrid(np.int64(11), np.int64(11), np.int64(11))>.bounds
FAILED tests/test_section.py::SliceTest::test_cap - assert False
 +  where False = <trimesh.Trimesh(vertices.shape=(6, 3), faces.shape=(8, 3))>.is_watertight
FAILED tests/test_section.py::SliceTest::test_cap_coplanar - assert False
 +  where False = <trimesh.Trimesh(vertices.shape=(3505, 3), faces.shape=(7014, 3))>.is_watertight
FAILED tests/test_section.py::SliceTest::test_slice_onplane - assert False
 +  where False = <trimesh.Trimesh(vertices.shape=(1550, 3), faces.shape=(3132, 3))>.is_watertight
FAILED tests/test_creation.py::CreationTest::test_path_sweep - ValueError: zero-size array to reduction operation maximum which has no identity
FAILED tests/test_creation.py::CreationTest::test_triangulate - AssertionError: assert np.False_
 +  where np.False_ = <function isclose at 0x7f4bdf735530>(np.float64(0.0), 3.1365484905459398)
 +    where <function isclose at 0x7f4bdf735530> = <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'>.isclose
 +      where <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'> = g.np
FAILED tests/test_creation.py::CreationTest::test_triangulate_plumbing - AssertionError: assert np.False_
 +  where np.False_ = <function isclose at 0x7f4bdf735530>(np.float64(0.0), 30768.414982316746)
 +    where <function isclose at 0x7f4bdf735530> = <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'>.isclose
 +      where <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'> = g.np

from trimesh.

mikedh avatar mikedh commented on July 23, 2024

Nice! I think some/most of these are fixed by installing the sympy prerelease?

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

I'm afraid upgrading to sympy 1.12.1rc1 doesn't improve things (though sympy itself stops failing tests).

from trimesh.

mikedh avatar mikedh commented on July 23, 2024

Yeah actually same re: sympy it was just my development machine had silently downgraded numpy.

At least a few of these are mapbox_earcut. It's a pybind thing using numpy which is probably gonna need a PR unfortunately haha:

In [10]: mapbox_earcut.triangulate_float64(vertices, rings)
Out[10]: 
array([99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
       99, 99, 99, 99, 99], dtype=uint32)


from trimesh.

mikedh avatar mikedh commented on July 23, 2024

If you install mapbox-earcut from source test_creation passes. I think it just has to be rebuilt with a newer version of numpy than what it was currently built with.

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Thanks! That gets me down to two failures:

FAILED tests/test_transformations.py::TransformTest::test_doctest - ValueError: TestResults(failed=7, attempted=389)
FAILED tests/test_voxel.py::VoxelGridTest::test_roundtrip - AssertionError: assert False
 +  where False = <function allclose at 0x7f5ccf730b70>(array([[-0.55, -0.55, -0.55],\n       [-0.25,  0.55,  0.55]]), array([[-0.55, -0.55, -0.55],\n       [ 0.55,  0.55,  0.55]]))
 +    where <function allclose at 0x7f5ccf730b70> = <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'>.allclose
 +      where <module 'numpy' from '/usr/lib/python3.11/site-packages/numpy/__init__.py'> = g.np
 +    and   array([[-0.55, -0.55, -0.55],\n       [-0.25,  0.55,  0.55]]) = <trimesh.VoxelGrid(11, 11, 11)>.bounds
 +    and   array([[-0.55, -0.55, -0.55],\n       [ 0.55,  0.55,  0.55]]) = <trimesh.VoxelGrid(np.int64(11), np.int64(11), np.int64(11))>.bounds

The first one seems to be the doctest case, the second one I don't know.

from trimesh.

mikedh avatar mikedh commented on July 23, 2024

I think I got those last 2, and am putting together a PR for mapbox-earcut.

from trimesh.

mgorny avatar mgorny commented on July 23, 2024

Thanks. It seems that the tests pass for me on main right now.

from trimesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.