Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ repos:
- id: mypy
files: "^src/"
additional_dependencies:
- numpy>=2.2
- numpy>=2.4.0
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = ["version"]
dependencies = ["numpy"]
Expand All @@ -34,7 +35,7 @@ test_thirdparty = [
"colorspacious",
"colour",
"matplotlib",
"napari>=0.5.0",
"napari>=0.5.0; python_version<'3.14'",
"PyQt6==6.8.1",
"numba",
"numba<0.61; python_version<'3.12'",
Expand Down Expand Up @@ -150,10 +151,9 @@ filterwarnings = [
"ignore::DeprecationWarning:Pyinstaller",
"ignore::DeprecationWarning:pkg_resources",
"ignore::DeprecationWarning:altgraph",
"ignore:'oneOf' deprecated:DeprecationWarning:matplotlib",
"ignore:'parseString' deprecated:DeprecationWarning:matplotlib",
"ignore:'resetCache' deprecated:DeprecationWarning:matplotlib",
"ignore:'enablePackrat' deprecated:DeprecationWarning:matplotlib",
"ignore::DeprecationWarning:pyparsing",
"ignore::DeprecationWarning:matplotlib._mathtext",
"ignore::DeprecationWarning:matplotlib._fontconfig_pattern",
]

# https://mypy.readthedocs.io/en/stable/config_file.html
Expand Down
2 changes: 1 addition & 1 deletion src/cmap/_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def __getitem__(self, key: int) -> float:
def __iter__(self) -> Iterator[float]:
return iter(self._rgba)

def __array__(self, dtype: npt.DTypeLike = None) -> np.ndarray:
def __array__(self, dtype: npt.DTypeLike | None = None) -> np.ndarray:
return np.asarray(self._rgba, dtype=dtype)

@property
Expand Down
5 changes: 2 additions & 3 deletions src/cmap/_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ def __reversed__(self) -> Iterator[ColorStop]:
# reverse the colors, but not the positions
yield ColorStop(1 - pos, Color(rgba))

def __array__(self, dtype: npt.DTypeLike = None) -> np.ndarray:
def __array__(self, dtype: npt.DTypeLike | None = None) -> np.ndarray:
"""Return (N, 5) array, N rows of (position, r, g, b, a)."""
return self._stops if dtype is None else self._stops.astype(dtype)

Expand Down Expand Up @@ -1522,5 +1522,4 @@ def _wrap_shift_color_stops(data: np.ndarray, shift_amount: float) -> np.ndarray
out[:, 0] += shift_amount
out[:, 0] %= 1
# sort the array by the first column
out = out[out[:, 0].argsort()]
return out # type: ignore[no-any-return]
return out[out[:, 0].argsort()]
5 changes: 3 additions & 2 deletions src/cmap/data/glasbey/_glasbey.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# see __init__ and LICENSE_GLASBEY
from __future__ import annotations

from typing import Literal
from typing import Literal, cast

import numpy as np

Expand Down Expand Up @@ -185,4 +185,5 @@ def create_palette(

def _get_rgb_palette(cam02ucs_palette: np.ndarray) -> np.ndarray:
raw_rgb_palette = _cspace_convert(cam02ucs_palette, "CAM02-UCS", "sRGB1")
return np.clip(raw_rgb_palette, 0.0, 1.0)
out = np.clip(raw_rgb_palette, 0.0, 1.0)
return cast("np.ndarray", out)