Skip to content

Commit

Permalink
Merge pull request #1523 from girder/fix-type-check
Browse files Browse the repository at this point in the history
Fix an issue with type checking
  • Loading branch information
manthey authored May 16, 2024
2 parents a81fa94 + 0689417 commit 7f38fe2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion large_image/tilesource/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ def getPaletteColors(value: Union[str, List[Union[str, float, Tuple[float, ...]]
palette = ['#0000', mpl.colors.to_hex(str(value))]
else:
cmap = mpl.colormaps.get_cmap(str(value)) if hasattr(getattr(
mpl, 'colormaps', None), 'get_cmap') else mpl.cm.get_cmap(str(value))
mpl, 'colormaps', None), 'get_cmap') else mpl.cm.get_cmap( # type: ignore
str(value))
palette = [mpl.colors.to_hex(cmap(i)) for i in range(cmap.N)]
except (ImportError, ValueError, AttributeError):
pass
Expand Down

0 comments on commit 7f38fe2

Please sign in to comment.