Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing issues related to dtype=object arrays in interpolation routines (
#1655) * Ensure the distances to computed linear-interpolation weights from are stored as arrays. Without this, NumPy implicitly generates arrays but makes them ragged (dtype=object), which is bad for performance and disabled in newer versions. * Failure to convert to array implies it is not a suitable input array. In older NumPy, this would silently create an array-of-object, but that has a wrong shape too. * Ensure interpolation weight is computed with the correct array type. * Ensure mesh coordinate calculations are not carried out with dtype=object. This would previously happen because meshgrids are passed in as ragged arrays, and NumPy does not convert the rows to float dtype as should happen. * For integral data, interpolating on integral points may not be appropriate. One of the tests samples from an integral grid at non-integral points. This failed after the explicit conversion introduced in c90044a. Falling back to `float` fixes the test case, though perhaps it would be better to select a dedicated meshing dtype. * Add warning when falling back to `float` for interpolation coefficients. When this happens it is likely that the used did something like starting from an integer mesh, but in that case linear interpolation does not seem very appropriate.
- Loading branch information