Skip to content

Commit

Permalink
Suppress a warning about nd2 files that we can't do anything about
Browse files Browse the repository at this point in the history
Specifically, the dask module probably duplicates the ND2File object and
the deletes the object without explicitly closing it.
  • Loading branch information
manthey committed Dec 31, 2024
1 parent 64afb30 commit 6a18f32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- Add more color palettes ([#1746](../../pull/1746))
- Improve the list of extensions the bioformats source reports ([#1748](../../pull/1748))

### Changes

- Suppress a warning about nd2 files that we can't do anything about ([#1749](../../pull/1749))

## 1.30.5

### Improvements
Expand Down
4 changes: 4 additions & 0 deletions sources/nd2/large_image_source_nd2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import math
import os
import threading
import warnings
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as _importlib_version

Expand Down Expand Up @@ -49,6 +50,9 @@ def _lazyImport():
except ImportError:
msg = 'nd2 module not found.'
raise TileSourceError(msg)
# the dask module emits a warning about an open handle even those we
# close file handles properly. Suppress them
warnings.filterwarnings('ignore', category=UserWarning, module='.*dask.*')


def namedtupleToDict(obj):
Expand Down

0 comments on commit 6a18f32

Please sign in to comment.