Skip to content

Commit bf51e2b

Browse files
authored
Merge branch 'main' into labeled_comprehension-channel-axis
2 parents 6c8a31b + bbfad41 commit bf51e2b

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
- name: Setup Conda Environment
2626
uses: conda-incubator/setup-miniconda@v3
2727
with:
28-
miniforge-variant: Mambaforge
29-
use-mamba: true
3028
python-version: ${{ matrix.python-version }}
3129
environment-file: continuous_integration/environment-${{ matrix.python-version }}.yml
3230
activate-environment: dask-image-testenv
@@ -44,7 +42,7 @@ jobs:
4442
run: pytest -v --cov=dask_image --cov-report lcov
4543

4644
- name: Coveralls Parallel
47-
uses: coverallsapp/github-action@v2.3.0
45+
uses: coverallsapp/github-action@v2.3.6
4846
with:
4947
github-token: ${{ secrets.github_token }}
5048
flag-name: run-${{ matrix.test_number }}
@@ -56,7 +54,7 @@ jobs:
5654
runs-on: ubuntu-latest
5755
steps:
5856
- name: Coveralls Finished
59-
uses: coverallsapp/github-action@v2.3.0
57+
uses: coverallsapp/github-action@v2.3.6
6058
with:
6159
github-token: ${{ secrets.github_token }}
6260
parallel-finished: true

dask_image/ndinterp/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,11 @@ def rotate(
367367
if reshape:
368368
# Compute transformed input bounds
369369
iy, ix = in_plane_shape
370-
out_bounds = rot_matrix @ [[0, 0, iy, iy],
371-
[0, ix, 0, ix]]
370+
in_bounds = np.array([[0, 0, iy, iy],
371+
[0, ix, 0, ix]])
372+
out_bounds = rot_matrix @ in_bounds
372373
# Compute the shape of the transformed input plane
373-
out_plane_shape = (out_bounds.ptp(axis=1) + 0.5).astype(int)
374+
out_plane_shape = (np.ptp(out_bounds, axis=1) + 0.5).astype(int)
374375
else:
375376
out_plane_shape = img_shape[axes]
376377

dask_image/ndmeasure/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import dask.dataframe as dd
1111
import numpy as np
1212
from dask import compute, delayed
13+
import dask.config as dask_config
1314

1415
from . import _utils
1516
from ._utils import _label
@@ -244,7 +245,9 @@ def find_objects(label_image):
244245
result = bag.fold(functools.partial(_find_objects, label_image.ndim), split_every=2).to_delayed()
245246
meta = dd.utils.make_meta([(i, object) for i in range(label_image.ndim)])
246247
result = delayed(compute)(result)[0] # avoid the user having to call compute twice on result
247-
result = dd.from_delayed(result, meta=meta, prefix="find-objects-", verify_meta=False)
248+
249+
with dask_config.set({'dataframe.convert-string': False}):
250+
result = dd.from_delayed(result, meta=meta, prefix="find-objects-", verify_meta=False)
248251

249252
return result
250253

dask_image/ndmeasure/_utils/_find_objects.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pandas as pd
33
from dask.delayed import Delayed
44
import dask.dataframe as dd
5+
import dask.config as dask_config
56

67

78
def _array_chunk_location(block_id, chunks):
@@ -67,9 +68,11 @@ def _find_objects(ndim, df1, df2):
6768
"""Main utility function for find_objects."""
6869
meta = dd.utils.make_meta([(i, object) for i in range(ndim)])
6970
if isinstance(df1, Delayed):
70-
df1 = dd.from_delayed(df1, meta=meta)
71+
with dask_config.set({'dataframe.convert-string': False}):
72+
df1 = dd.from_delayed(df1, meta=meta)
7173
if isinstance(df2, Delayed):
72-
df2 = dd.from_delayed(df2, meta=meta)
74+
with dask_config.set({'dataframe.convert-string': False}):
75+
df2 = dd.from_delayed(df2, meta=meta)
7376
ddf = dd.merge(df1, df2, how="outer", left_index=True, right_index=True)
7477
result = ddf.apply(_merge_bounding_boxes, ndim=ndim, axis=1, meta=meta)
7578
return result

docs/conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@
120120

121121
# -- Options for HTML output -------------------------------------------
122122

123+
# Set canonical URL from the Read the Docs Domain
124+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
125+
126+
# Tell Jinja2 templates the build is running on Read the Docs
127+
if os.environ.get("READTHEDOCS", "") == "True":
128+
if "html_context" not in globals():
129+
html_context = {}
130+
html_context["READTHEDOCS"] = True
131+
123132
# The theme to use for HTML and HTML Help pages. See the documentation for
124133
# a list of builtin themes.
125134
html_theme = 'dask_sphinx_theme'

tests/test_dask_image/test_imread/test_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def test_tiff_imread(tmpdir, seed, nframes, shape, dtype, is_pathlib_Path): # n
7676
fn = str(dirpth.join("test.tiff"))
7777
with tifffile.TiffWriter(fn) as fh:
7878
for i in range(len(a)):
79-
fh.save(a[i], contiguous=True)
79+
fh.write(a[i], contiguous=True)
80+
8081
if is_pathlib_Path:
8182
fn = pathlib.Path(fn)
8283
d = dask_image.imread.imread(fn, nframes=nframes)

0 commit comments

Comments
 (0)