-
Notifications
You must be signed in to change notification settings - Fork 594
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
Unpin numpy 2 #3115
Unpin numpy 2 #3115
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3115 +/- ##
==========================================
- Coverage 76.31% 73.98% -2.34%
==========================================
Files 109 109
Lines 12515 12438 -77
==========================================
- Hits 9551 9202 -349
- Misses 2964 3236 +272
|
@@ -81,7 +81,7 @@ def is_constant( | |||
def _(a: NDArray, axis: Literal[0, 1] | None = None) -> bool | NDArray[np.bool_]: | |||
# Should eventually support nd, not now. | |||
if axis is None: | |||
return (a == a.flat[0]).all() | |||
return bool((a == a.flat[0]).all()) |
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.
This makes the function return a bool
instead of a np.bool_
scalar as the type hints say.
The two types behave almost identically but have a different repr with numpy 2, so this change passes the doctests.
@@ -1,3 +1,5 @@ | |||
"""Geary's C autocorrelation.""" |
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.
I didn’t change anything in the two metrics modules, just reordered and reformatted (and replaced the removed np.float_
with np.float64
, which in numpy 1.x are identical)
>>> int(adata.obs['n_genes'].min()) | ||
1 |
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.
more repr changes: this is shown as np.int64(1)
without the cast to int
@@ -173,7 +173,7 @@ def test_download_failure(): | |||
*DS_MARKS[ds], | |||
], | |||
) | |||
for ds in set(sc.datasets.__all__) - DS_DYNAMIC | |||
for ds in sorted(set(sc.datasets.__all__) - DS_DYNAMIC) |
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.
This fixes pytest -n auto
. Pytest complained locally that different jobs collected “different tests” which were just differently sorted.
Sorry does this mean it doesn't work with numpy 2? |
It doesn’t. We could also
Sadly(?) Python doesn’t allow packages to add constraint to other packages’ dependencies, else we could tell the resolver that all currently release skmisc versions are incompatible with numpy 2 |
Are we in a rush? We are upper bounding right now anyway on the current release, no? I would just wait. |
We’re not upper-bounding in 1.10.1. |
We discussed outside @flying-sheep - we will release with the bound then and just wait here? |
release done, we can wait here … |
Looks like there is a release out for the Hopefully this fixes it |
Co-authored-by: Philipp A <[email protected]>
Other things done:
Rename some variables and reorder functions so the diff between the metrics is minimal for a future unification
Skip seurat v3 tests with numpy 2 because skmisc isn’t ready: Support for numpy 2.0 has2k1/scikit-misc#34
This will skip the seurat v3 tests for all but the minimum versions test job for now, but I think that’s OK?