From 5c6bdb264d01cacc3cc2ece3a235e0190cc7b6dc Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Mon, 26 Feb 2024 18:47:57 +0100 Subject: [PATCH] - Check for existence of astype. --- .github/workflows/pytest.yml | 2 +- pyproject.toml | 2 +- tiffwrite/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1311849..52c5485 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -11,7 +11,7 @@ jobs: os: [ubuntu-20.04, windows-2019, macOS-11] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/pyproject.toml b/pyproject.toml index d595b60..69effbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tiffwrite" -version = "2024.2.1" +version = "2024.2.2" description = "Parallel tiff writer compatible with ImageJ." authors = ["Wim Pomp, Lenstra lab NKI "] license = "GPL-3.0-or-later" diff --git a/tiffwrite/__init__.py b/tiffwrite/__init__.py index 600e6fe..a2df2cb 100755 --- a/tiffwrite/__init__.py +++ b/tiffwrite/__init__.py @@ -406,7 +406,7 @@ class IJTiffFile: assert (c, z, t) not in self.pool.tasks, f'frame {c} {z} {t} is added already' assert all([0 <= i < s for i, s in zip((c, z, t), self.shape)]), \ 'frame {} {} {} is outside shape {} {} {}'.format(c, z, t, *self.shape) - self.pool(frame.astype(self.dtype) if isinstance(frame, np.ndarray) else frame, handle=(c, z, t)) + self.pool(frame.astype(self.dtype) if hasattr(frame, 'astype') else frame, handle=(c, z, t)) if extratags: self.frame_extra_tags[(c, z, t)] = Tag.to_tags(extratags)