Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated use of TiffWriter.save in tests #397

Closed
jakirkham opened this issue Apr 7, 2025 · 2 comments · Fixed by #398
Closed

Deprecated use of TiffWriter.save in tests #397

jakirkham opened this issue Apr 7, 2025 · 2 comments · Fixed by #398

Comments

@jakirkham
Copy link
Member

Describe the issue:

The TiffWriter.save method has been removed in tifffile version 2025.2.18 and newer

https://github.com/cgohlke/tifffile/blob/78b57cf84bd92528ba8877ea4972769bb4d43600/tifffile/tifffile.py#L132

Minimal Complete Verifiable Example:

However we are still using it in the following test

@pytest.mark.cupy
def test_cupy_imread(tmp_path):
a = np.random.uniform(low=0.0, high=1.0, size=(1, 4, 3)).astype(np.float32)
fn = str(tmp_path/"test.tiff")
with tifffile.TiffWriter(fn) as fh:
for i in range(len(a)):
fh.save(a[i])

@jakirkham
Copy link
Member Author

Think this can be resolved by pulling over @m-albert 's changes from PR: #393

Namely replacing save with write

      with tifffile.TiffWriter(fn) as fh:
          for i in range(len(a)):
-             fh.save(a[i])
+             fh.write(a[i])

@jakirkham
Copy link
Member Author

Submitted a fix in PR: #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant