Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with Numpy 2.0, remove setup.cfg and more #85

Merged
merged 13 commits into from
Apr 22, 2024

Conversation

saimn
Copy link
Contributor

@saimn saimn commented Apr 8, 2024

@cmccully - with Numpy 2.0 coming soon we will need to publish new wheels built with Numpy 2.0 (so they will be compatible with both Numpy 1.x and 2.0).

Also did various infrastructure updates to get rid of warnings etc.


include_dirs = [np.get_include(), UTIL_DIR]
libraries = []

if 'CFLAGS' in os.environ:
extra_compile_args = os.environ['CFLAGS'].split()
else:
extra_compile_args = ['-g', '-O3', '-funroll-loops', '-ffast-math']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmccully - Not sure if we should have those flags by default, especially -ffast-math which is an option that people should use carefully (https://simonbyrne.github.io/notes/fastmath/)

@saimn
Copy link
Contributor Author

saimn commented Apr 17, 2024

test_median_clean is failing when running tests for the cp311-win_amd64 wheel...
Not the first time we have a problem with this test (#71, #82, #66 (comment)) so probably something that should be investigated more in detail, for now I will just mark it as xfail.

      def test_median_clean(testdata):
          imdata, crmask = testdata
          # Because our image only contains single cosmics, turn off
          # neighbor detection. Also, our cosmic rays are high enough
          # contrast that we can turn our detection threshold up.
          _mask, clean = detect_cosmics(imdata, readnoise=10., gain=1.0,
                                        sigclip=6, sigfrac=1.0, cleantype='median')
      
          assert (clean[crmask] != imdata[crmask]).sum() == crmask.sum()
      
          # Run it again on the clean data. We shouldn't find any new cosmic rays
          _mask2, _clean2 = detect_cosmics(clean, readnoise=10., gain=1.0,
                                           sigclip=6, sigfrac=1.0, cleantype='median')
  >       assert _mask2.sum() == 0
  E       assert 100 == 0

@saimn
Copy link
Contributor Author

saimn commented Apr 17, 2024

@cmccully - PR is ready, do you want to have a look ?

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - I think we should also switch to the OpenAstronomy wheel building workflow but I'm happy to do that in a follow-up PR.

@astrofrog
Copy link
Member

As this is mainly infrastructural, I think we should go ahead and merge so that other packages can work properly with Numpy 2.0. However, I don't have permission to merge, so need to find someone who does.

@pllim
Copy link
Member

pllim commented Apr 22, 2024

@astrofrog , I updated the team, you should be able to merge now.

@astrofrog astrofrog merged commit cbdec83 into astropy:main Apr 22, 2024
11 checks passed
@saimn saimn deleted the numpy-2.0 branch April 22, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants