- Check for existence of astype.

This commit is contained in:
Wim Pomp
2024-02-26 18:47:57 +01:00
parent 0e5202bf19
commit 5c6bdb264d
3 changed files with 3 additions and 3 deletions

View File

@@ -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:

View File

@@ -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 <w.pomp@nki.nl>"]
license = "GPL-3.0-or-later"

View File

@@ -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)