ntessore / healpix

Python and C package for HEALPix discretisation of the sphere
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

ENH: improved type support for numpy arrays #34

Closed ntessore closed 3 months ago

ntessore commented 3 months ago

This change improves type support for numpy arrays in two ways:

  1. Do not require numpy arrays to be aligned and contiguous. This fixes an issue with conversion from or to arrays of different int width.
  2. Use numpy data types in C interface. Instead of treating numpy array data as the C types int64_t etc., the code now uses npy_int64 etc. to match the NPY_INT64 dtype descriptor.

A related change is to use order instead of nside for the UNIQ pixel indexing functions. This is a backward-incompatible change, but the functions are fairly new and not used much.