-
-
Notifications
You must be signed in to change notification settings - Fork 91
Adopt the array api #885
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
base: main
Are you sure you want to change the base?
Adopt the array api #885
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
=======================================
Coverage ? 97.06%
=======================================
Files ? 8
Lines ? 1531
Branches ? 0
=======================================
Hits ? 1486
Misses ? 45
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
85625f0
to
04293b7
Compare
As a quick FYI I ran the test suite in this PR on a machine with a NVidia GPU with |
@@ -8,17 +8,19 @@ dynamic = ["version"] | |||
description = "Astropy affiliated package" | |||
readme = "README.rst" | |||
license = { text = "BSD-3-Clause" } | |||
requires-python = ">=3.8" | |||
requires-python = ">=3.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adopt Spec 0? Has that been adopted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, misread this -- what is Spectrum 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the move here would be to bump it up to 3.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.11 for a few more months. Then 3.12. I was also thinking about adding the badge saying "Spec 0", e.g. you can see in the README in https://github.com/GalacticDynamics/unxt
@@ -8,17 +8,19 @@ dynamic = ["version"] | |||
description = "Astropy affiliated package" | |||
readme = "README.rst" | |||
license = { text = "BSD-3-Clause" } | |||
requires-python = ">=3.8" | |||
requires-python = ">=3.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2fa76b7
to
3b2b9fc
Compare
These are necessary because upstream dependencies (astropy) explicitly check for numpy arrays rather than using the array API.
Co-authored-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
@nstarman -- thanks again for the thorough review! Can you please give this comment a thumbs-up if you think this is ready for merge? |
Using ccd_data as the argument leads to CCDData's __array__ being called, which returns a numpy array. By using ccd_data.data we get the raw data in whatever format the array library keeps it.
Properly set uncertainty unit in gain_correct
new_data never has a .data the way the test is written
5c81f63
to
2a877a9
Compare
This PR makes the necessary changes to adopt the array API. There are still some things to sort out:
.data_arr.mask
to.data_arr_mask
constitutes an API change. If it does (and I think it does) then patch things up so that.data_arr.mask
points to.data_arr_mask
array_api_extra
makes handling those easy)Once those are done the next step will be to find an outside reviewer for this...