astro-informatics / ssht

Fast and exact spin spherical harmonic transforms
http://astro-informatics.github.io/ssht/
GNU General Public License v3.0
11 stars 2 forks source link

Add `cnp.import_array` for `numpy>=2` #75

Closed paddyroddy closed 4 months ago

paddyroddy commented 4 months ago

Hopefully fixes #74, see https://cython.readthedocs.io/en/stable/src/tutorial/numpy.html#adding-types

mdavezac commented 4 months ago

Perhaps the CI could be made to run with numpy>=2? That way it would be clearer that it works.

paddyroddy commented 4 months ago

Perhaps the CI could be made to run with numpy>=2? That way it would be clearer that it works.

Good idea, will do now

paddyroddy commented 4 months ago

@mdavezac done. Not sure if the tests here are exhaustive enough to know that this will fix downstream, though.

jasonmcewen commented 4 months ago

Are we sure we want to force numpy>=2? This could have downstream implications? @CosmoMatt what are you thoughts?

We might want to pause merging this until we've had a chance to also update other codes.

paddyroddy commented 4 months ago

@jasonmcewen currently ssht is unusable if someone has numpy>=2 in their environment. So as a minimum, if you don't want to support v2 then numpy<2 should be pinned.

jasonmcewen commented 4 months ago

Thanks @paddyroddy . Yes, we may need to pin to numpy 1 in the interium. We should support numpy 2 in the near future but we don't want to break a large number of our codes that use ssht before they've also been updated to support numpy 2.

mdavezac commented 4 months ago

This is just in the ci, it doesn't affect users. Admittedly, it does depend on the test coverage... Though, if it used to fail at the import stage, then at least this change to the coffee and to the ci cover that.

paddyroddy commented 4 months ago

@mdavezac so is this safe to be merged? I don't have the power anyway

paddyroddy commented 3 months ago

@mdavezac will there be a new python release/pre-release?