nschloe / meshio

:spider_web: input/output for many mesh formats
MIT License
1.93k stars 397 forks source link

[BUG] package broken in numpy==2 #1450

Closed kinnala closed 8 months ago

kinnala commented 8 months ago

Describe the bug Soon there will be a backwards-incompatible release of numpy. As a consequence, np.string_ will be removed, see the migration guide:

https://numpy.org/devdocs/numpy_2_0_migration_guide.html

I tried using meshio against a nightly build of numpy==2 and noticed that it does not work because of missing np.string_. I was able to do some things that I depend on by replacing each occurence of np.string_ by np.bytes_ within meshio codebase, as suggested by the migration guide. I did not run the full meshio test suite so there might be other things to consider.

To Reproduce

  1. Install numpy==2 from https://anaconda.org/scientific-python-nightly-wheels/numpy
  2. Try doing import meshio then meshio.read and/or meshio.write and meshio.Mesh