Skip to content

Commit

Permalink
Bump Mypy and some type fixes. (napari#6332)
Browse files Browse the repository at this point in the history
Mypy 1.6 is fairly recent, let's see if it finds more stuff.
  • Loading branch information
Carreau authored Oct 13, 2023
1 parent 2f6c707 commit 72538e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions napari/utils/_dask_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ def resize_dask_cache(
from psutil import virtual_memory

if nbytes is None and mem_fraction is not None:
nbytes = virtual_memory().total * mem_fraction
nbytes = int(virtual_memory().total * mem_fraction)

avail = _DASK_CACHE.cache.available_bytes
# if we don't have a cache already, create one.
if avail == 1:
# If neither nbytes nor mem_fraction was provided, use default
if nbytes is None:
nbytes = virtual_memory().total * _DEFAULT_MEM_FRACTION
nbytes = int(virtual_memory().total * _DEFAULT_MEM_FRACTION)
_DASK_CACHE.cache.resize(nbytes)
elif nbytes is not None and nbytes != _DASK_CACHE.cache.available_bytes:
# if the cache has already been registered, then calling
Expand Down
2 changes: 1 addition & 1 deletion resources/requirements_mypy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.5.0
mypy==1.6.0
# via -r resources/requirements_mypy.in
mypy-extensions==1.0.0
# via
Expand Down

0 comments on commit 72538e5

Please sign in to comment.