enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.28k stars 282 forks source link

BUG: Use numpy.import_array instead of import_array() #1266

Closed larsoner closed 10 months ago

larsoner commented 11 months ago

Struggling through https://github.com/conda-forge/mayavi-feedstock/pull/75 I hit this clang error:

  #warning "Using deprecated NumPy API, disable it with " \
   ^
  tvtk/src/array_ext.c:2712:3: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
    import_array();

Which led me to find https://stackoverflow.com/questions/52828873/how-does-import-array-in-numpy-c-api-work and try the workarounds there, have them ultimately not work, and finally just use of cimport numpy; numpy.import_array() in https://github.com/conda-forge/mayavi-feedstock/pull/75 . Not 100% sure it's the right change but hopefully it's okay.