Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build NumPy 2
name: Build NumPy 1

on:
push:
Expand All @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,9 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-numpy2.txt -r requirements-numpy2-dev.txt
# update bio2zarr for NumPy 2, see https://github.com/sgkit-dev/bio2zarr/issues/256
pip install -U 'numpy<2.1' -U git+https://github.com/sgkit-dev/bio2zarr.git
pip install -r requirements-numpy1.txt -r requirements-numpy1-dev.txt
# - name: Run pre-commit
# uses: pre-commit/[email protected]
- name: Test with pytest and coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -28,6 +28,7 @@ jobs:
sudo apt install graphviz # Needed for documentation
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt -r requirements-doc.txt
pip install -U dask distributed # need latest versions to successully build docs
- name: Run pre-commit
uses: pre-commit/[email protected]
- name: Check for Sphinx doc warnings
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install graphviz # Needed for documentation
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt -r requirements-doc.txt
pip install -U dask distributed # need latest versions to successully build docs
- name: Build Sphinx documentation
run: |
cd docs
Expand Down
7 changes: 5 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ Breaking changes
.. Deprecations
.. ~~~~~~~~~~~~

.. Improvements
.. ~~~~~~~~~~~~
Improvements
~~~~~~~~~~~~

- Add support for NumPy 2.
(:user:`tomwhite`, :pr:`1297`)

.. Bug fixes
.. ~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ scikit-learn
partd
bed-reader
rechunker
cbgen < 1.0.5
cbgen > 1.0.5
bio2zarr @ git+https://github.com/sgkit-dev/bio2zarr.git; platform_system != "Windows"
yarl
matplotlib
Expand Down
3 changes: 2 additions & 1 deletion requirements-numpy2-dev.txt → requirements-numpy1-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ scikit-learn
partd
bed-reader
rechunker
cbgen > 1.0.5
cbgen < 1.0.5
bio2zarr @ git+https://github.com/sgkit-dev/bio2zarr.git; platform_system != "Windows"
yarl
matplotlib
asv
Expand Down
4 changes: 2 additions & 2 deletions requirements-numpy2.txt → requirements-numpy1.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy < 2.1
xarray
numpy < 2
xarray < 2025.03.1
dask[array,dataframe] >= 2023.01.0, <= 2024.8.0
distributed >= 2023.01.0, <= 2024.8.0
scipy
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy < 2
xarray
numpy < 2.2
xarray < 2025.03.1
dask[array,dataframe] >= 2023.01.0, <= 2024.8.0
distributed >= 2023.01.0, <= 2024.8.0
scipy
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.htm
include_package_data = True
python_requires = >=3.10
install_requires =
numpy < 2
xarray
numpy < 2.2
xarray < 2025.03.1
dask[array,dataframe] >= 2022.01.0, <= 2024.8.0
distributed >= 2022.01.0, <= 2024.8.0
scipy
Expand Down Expand Up @@ -60,7 +60,7 @@ plink =
bed-reader
bgen =
rechunker
cbgen < 1.0.5
cbgen > 1.0.5

[coverage:report]
fail_under = 100
Expand Down
2 changes: 1 addition & 1 deletion sgkit/stats/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def count_call_alternate_alleles(ds: Dataset, merge: bool = True) -> Dataset:
# TODO: Add to public API (https://github.com/sgkit-dev/sgkit/issues/282)
AC = count_call_alleles(ds)["call_allele_count"]
AC = AC[..., 1:].sum(dim="alleles").astype("int16")
AC = AC.where(~ds.call_genotype_mask.any(dim="ploidy"), AC.dtype.type(-1))
AC = AC.where(~ds.call_genotype_mask.any(dim="ploidy"), -1)
new_ds = Dataset({"call_alternate_allele_count": AC})
return conditional_merge_datasets(ds, new_ds, merge)

Expand Down
Loading