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

Compatibility with NumPy 2.0 #14

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog

## Version 0.1 (development)
## Version 0.2.0

- Feature A added
- FIX: nasty bug #1729 fixed
- add your changes here!
- Changes to support NumPy's 2.0 release.

## Version 0.1.0 - 0.1.3

First release of the package to access, download and save
datasets.
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
"""

# import pytest

# only if certificates are not available for local testing
# from gypsum_client.config import REQUESTS_MOD
# REQUESTS_MOD["verify"] = False
10 changes: 5 additions & 5 deletions tests/test_polish_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,31 +120,31 @@ def test_polish_dataset_attempts_integer_conversions():
sce = SingleCellExperiment(assays={"counts": mat})

y = polish_dataset(sce)
assert y.assays["counts"].dtype == np.int_
assert np.issubdtype(y.assays["counts"].dtype, np.integer)

mat = np.random.poisson(0.1, (100, 10)).astype(float)
sce = SingleCellExperiment(assays={"counts": sparse.csr_matrix(mat)})

y = polish_dataset(sce)
assert sparse.issparse(y.assays["counts"])
assert y.assays["counts"].dtype == np.int_
assert np.issubdtype(y.assays["counts"].dtype, np.integer)

mat = np.random.poisson(3, (100, 10)) * 1.5
sce = SingleCellExperiment(assays={"counts": mat})

y = polish_dataset(sce)
assert y.assays["counts"].dtype == np.float_
assert np.issubdtype(y.assays["counts"].dtype, np.floating)


def test_polish_dataset_works_with_na_values():
mat = np.random.poisson(0.1, (100, 10))
mat = mat.astype(np.float_)
mat = mat.astype(np.float64)
mat.ravel()[np.random.choice(mat.size, 10, replace=False)] = np.nan
sce = SingleCellExperiment(assays={"counts": sparse.csr_matrix(mat)})

y = polish_dataset(sce)
assert sparse.issparse(y.assays["counts"])
assert y.assays["counts"].dtype == np.float_
assert np.issubdtype(y.assays["counts"].dtype, np.floating)


def test_polish_dataset_forbids_highly_nested_altexps():
Expand Down
Loading