[Git][debian-gis-team/dask-image][upstream] New upstream version 2026.5.0+ds

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Wed May 27 21:21:08 BST 2026



Antonio Valentino pushed to branch upstream at Debian GIS Project / dask-image


Commits:
a45998f6 by Antonio Valentino at 2026-05-27T19:48:51+00:00
New upstream version 2026.5.0+ds
- - - - -


9 changed files:

- .github/workflows/test_and_deploy.yml
- HISTORY.rst
- dask_image/ndmeasure/__init__.py
- dask_image/ndmeasure/_utils/_find_objects.py
- pyproject.toml
- tests/test_dask_image/test_ndfilters/test__generic.py
- tests/test_dask_image/test_ndmeasure/test_core.py
- tests/test_dask_image/test_ndmeasure/test_find_objects.py
- + tests/test_dask_image/test_ndmeasure/test_find_objects_no_dataframe.py


Changes:

=====================================
.github/workflows/test_and_deploy.yml
=====================================
@@ -20,10 +20,10 @@ jobs:
 
     steps:
       - name: Checkout source
-        uses: actions/checkout at v5
+        uses: actions/checkout at v6
 
       - name: Setup Conda Environment
-        uses: conda-incubator/setup-miniconda at v3
+        uses: conda-incubator/setup-miniconda at v4
         with:
           python-version: ${{ matrix.python-version }}
           environment-file: continuous_integration/environment-${{ matrix.python-version }}.yml
@@ -34,7 +34,7 @@ jobs:
         shell: bash -l {0}
         run: |
           conda activate dask-image-testenv
-          python -m pip install -e .
+          python -m pip install -e .[dataframe]
           conda list
 
       - name: Run tests
@@ -42,19 +42,40 @@ jobs:
         run: pytest -v --cov=dask_image --cov-report lcov
 
       - name: Coveralls Parallel
-        uses: coverallsapp/github-action at v2.3.6
+        uses: coverallsapp/github-action at v2.3.7
         with:
           github-token: ${{ secrets.github_token }}
           flag-name: run-${{ matrix.test_number }}
           parallel: true
           path-to-lcov: coverage.lcov
 
+  test-minimal:
+    # Verify dask-image works without the optional `dataframe` extras
+    # (i.e. without pandas and dask[dataframe]).
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout source
+        uses: actions/checkout at v6
+
+      - name: Set up Python
+        uses: actions/setup-python at v6
+        with:
+          python-version: "3.12"
+
+      - name: Install dask-image without dataframe extras
+        run: |
+          python -m pip install --upgrade pip
+          python -m pip install -e .[test]
+
+      - name: Run tests (find_objects tests are skipped automatically)
+        run: pytest -v
+
   coveralls:
     needs: test
     runs-on: ubuntu-latest
     steps:
     - name: Coveralls Finished
-      uses: coverallsapp/github-action at v2.3.6
+      uses: coverallsapp/github-action at v2.3.7
       with:
         github-token: ${{ secrets.github_token }}
         parallel-finished: true
@@ -71,7 +92,7 @@ jobs:
     runs-on: ubuntu-latest
     if: contains(github.ref, 'tags')
     steps:
-    - uses: actions/checkout at v5
+    - uses: actions/checkout at v6
     - name: Set up Python
       uses: actions/setup-python at v6
       with:


=====================================
HISTORY.rst
=====================================
@@ -2,6 +2,48 @@
 History
 =======
 
+v2026.05.0 (2026-05-26)
+-----------------------
+
+We're pleased to announce the release of dask-image v2026.05.0!
+
+Highlights
+
+Highlights of this release include making the dask dataframe dependency optional,
+improving packaging and compatibility with Numpy v2.4.
+
+Bug Fixes
+
+* Compatibility with Numpy v2.4 (#425)
+* Fix package discovery in pyproject.toml (#422)
+* Bump tifffile to ensure functionality used in imread tests (#424)
+
+API Changes
+
+* Make dataframe dependencies optional (#429)
+
+Other Pull Requests
+
+* Bump actions/checkout from 5 to 6 (#420)
+* Bump coverallsapp/github-action from 2.3.6 to 2.3.7 (#421)
+* Bump conda-incubator/setup-miniconda from 3 to 4 (#430)
+* Bump actions/checkout from 5 to 6 (#433)
+
+5 authors added to this release (alphabetical)
+
+* `Antonio Valentino <https://github.com/dask/dask-image/commits?author=avalentino>`_ - @avalentino
+* `dependabot[bot] <https://github.com/dask/dask-image/commits?author=dependabot[bot]>`_ - @dependabot[bot]
+* `Genevieve Buckley <https://github.com/dask/dask-image/commits?author=GenevieveBuckley>`_ - @GenevieveBuckley
+* `Marvin Albert <https://github.com/dask/dask-image/commits?author=m-albert>`_ - @m-albert
+* `Thomas Robitaille <https://github.com/dask/dask-image/commits?author=astrofrog>`_ - @astrofrog
+
+
+2 reviewers added to this release (alphabetical)
+
+* `Copilot <https://github.com/dask/dask-image/commits?author=Copilot>`_ - @Copilot
+* `Genevieve Buckley <https://github.com/dask/dask-image/commits?author=GenevieveBuckley>`_ - @GenevieveBuckley
+
+
 v2025.11.0 (2025-11-12)
 -----------------------
 


=====================================
dask_image/ndmeasure/__init__.py
=====================================
@@ -9,7 +9,6 @@ import dask.config as dask_config
 
 import dask.array as da
 import dask.bag as db
-import dask.dataframe as dd
 import numpy as np
 
 from . import _utils
@@ -228,9 +227,21 @@ def find_objects(label_image):
 
     Notes
     -----
-    You must have the optional dependency ``dask[dataframe]`` installed
-    to use the ``find_objects`` function.
+    You must have the optional dependencies ``dask[dataframe]`` and
+    ``pandas`` installed to use the ``find_objects`` function. They can
+    be installed together via the ``dataframe`` extras group:
+    ``pip install dask-image[dataframe]``.
     """
+    try:
+        import pandas  # noqa: F401  # used by the private helpers below
+        import dask.dataframe as dd
+    except ImportError as e:
+        raise ImportError(
+            "dask_image.ndmeasure.find_objects requires the optional "
+            "dependencies `dask[dataframe]` and `pandas`. Install them "
+            "with `pip install dask-image[dataframe]`."
+        ) from e
+
     if label_image.dtype.char not in np.typecodes['AllInteger']:
         raise ValueError("find_objects only accepts integer dtype arrays")
 


=====================================
dask_image/ndmeasure/_utils/_find_objects.py
=====================================
@@ -1,7 +1,5 @@
 import numpy as np
-import pandas as pd
 from dask.delayed import Delayed
-import dask.dataframe as dd
 import dask.config as dask_config
 
 
@@ -24,6 +22,8 @@ def _find_bounding_boxes(x, array_location):
     This alternative function returns a pandas dataframe,
     with one row per object found in the image chunk.
     """
+    import pandas as pd
+
     unique_vals = np.unique(x)
     unique_vals = unique_vals[unique_vals != 0]
     result = {}
@@ -53,6 +53,8 @@ def _combine_slices(slices):
 
 def _merge_bounding_boxes(x, ndim):
     "Merge the bounding boxes describing objects over multiple image chunks."
+    import pandas as pd
+
     x = x.dropna()
     data = {}
     # For each dimension in the array,
@@ -72,6 +74,9 @@ def _merge_bounding_boxes(x, ndim):
 
 def _find_objects(ndim, df1, df2):
     """Main utility function for find_objects."""
+    import pandas as pd
+    import dask.dataframe as dd
+
     meta = dd.utils.make_meta([(i, object) for i in range(ndim)])
     if isinstance(df1, Delayed):
         with dask_config.set({'dataframe.convert-string': False}):


=====================================
pyproject.toml
=====================================
@@ -24,15 +24,18 @@ classifiers = [
     "Programming Language :: Python :: 3.12",
 ]
 dependencies = [
-    "dask[array,dataframe] >=2024.4.1",
+    "dask[array] >=2024.4.1",
     "numpy >=1.18",
     "scipy >=1.7.0",
-    "pandas >=2.0.0",
     "pims >=0.4.1",
-    "tifffile >=2018.10.18",
+    "tifffile >=2020.10.1",
 ]
 
 [project.optional-dependencies]
+dataframe = [
+    "dask[dataframe] >=2024.4.1",
+    "pandas >=2.0.0",
+]
 test = [
     "build >=1.2.1",
     "coverage >=7.2.1",
@@ -65,10 +68,13 @@ license-files = [
 ]
 
 [tool.setuptools.packages.find]
-exclude = [
-    "tests*",
+include = [
+    "dask_image*",
 ]
 
 [tool.pytest.ini_options]
 addopts = "--flake8"
 markers = "cupy"
+
+[tool.flake8]
+exclude = ["dask_image/_version.py"]


=====================================
tests/test_dask_image/test_ndfilters/test__generic.py
=====================================
@@ -70,9 +70,9 @@ def test_generic_filter_shape_type(da_func):
 @pytest.mark.parametrize(
     "function, size, footprint",
     [
-        (lambda x: x, 1, None),
-        (lambda x: x, (1, 1), None),
-        (lambda x: x, None, np.ones((1, 1))),
+        (lambda x: x[0], 1, None),
+        (lambda x: x[0], (1, 1), None),
+        (lambda x: x[0], None, np.ones((1, 1))),
     ],
 )
 def test_generic_filter_identity(sp_func, da_func, function, size, footprint):
@@ -94,7 +94,7 @@ def test_generic_filter_identity(sp_func, da_func, function, size, footprint):
     ],
 )
 def test_generic_filter_comprehensions(da_func):
-    da_wfunc = lambda arr: da_func(arr, lambda x: x, 1)  # noqa: E731
+    da_wfunc = lambda arr: da_func(arr, lambda x: x[0], 1)  # noqa: E731
 
     np.random.seed(0)
 


=====================================
tests/test_dask_image/test_ndmeasure/test_core.py
=====================================
@@ -142,7 +142,7 @@ def test_measure_props(funcname, shape, chunks, has_lbls, ind):
     if (
         funcname == "median" and
         ind is not None and
-        not np.in1d(np.atleast_1d(ind), lbls).all()
+        not np.isin(np.atleast_1d(ind), lbls).all()
     ):
         pytest.skip("SciPy's `median` mishandles missing labels.")
 


=====================================
tests/test_dask_image/test_ndmeasure/test_find_objects.py
=====================================
@@ -1,10 +1,12 @@
-import dask.array as da
-import dask.dataframe as dd
-import numpy as np
-import pandas as pd
 import pytest
 
-import dask_image.ndmeasure
+pd = pytest.importorskip("pandas")
+dd = pytest.importorskip("dask.dataframe")
+
+import dask.array as da  # noqa: E402
+import numpy as np  # noqa: E402
+
+import dask_image.ndmeasure  # noqa: E402
 
 
 @pytest.fixture


=====================================
tests/test_dask_image/test_ndmeasure/test_find_objects_no_dataframe.py
=====================================
@@ -0,0 +1,37 @@
+"""
+Test that ``find_objects`` raises a helpful ``ImportError`` when the
+optional ``dask[dataframe]`` / ``pandas`` dependencies are not installed.
+
+This is skipped if both dependencies are installed.
+
+"""
+import dask.array as da
+import pytest
+
+import dask_image.ndmeasure
+
+
+try:
+    import pandas  # noqa: F401
+    import dask.dataframe  # noqa: F401
+    dataframe_available = True
+except ImportError:
+    dataframe_available = False
+
+
+ at pytest.mark.skipif(
+    dataframe_available,
+    reason="dataframe dependencies are installed; "
+           "ImportError path only triggers without them",
+)
+def test_find_objects_raises_import_error_without_pandas():
+    label_image = da.zeros((3, 3), dtype=int, chunks=(3, 3))
+    with pytest.raises(
+        ImportError,
+        match=(
+            r"dask_image\.ndmeasure\.find_objects requires the optional "
+            r"dependencies `dask\[dataframe\]` and `pandas`\. "
+            r"Install them with `pip install dask-image\[dataframe\]`\."
+        ),
+    ):
+        dask_image.ndmeasure.find_objects(label_image)



View it on GitLab: https://salsa.debian.org/debian-gis-team/dask-image/-/commit/a45998f688c86fa88c7b57934593b0690c3175ce

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/dask-image/-/commit/a45998f688c86fa88c7b57934593b0690c3175ce
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260527/5bbd089a/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list