diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69aadedf1..ed268cba5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: args: [--autofix] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.2 + rev: v0.8.6 hooks: - id: ruff args: [--fix, --unsafe-fixes] @@ -30,7 +30,7 @@ repos: # - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy files: "^src/" diff --git a/src/cmap/__init__.py b/src/cmap/__init__.py index 5a159026b..bfe972519 100644 --- a/src/cmap/__init__.py +++ b/src/cmap/__init__.py @@ -62,13 +62,13 @@ def resolve(self, name: str) -> str: from ._catalog import Catalog, CatalogItem __all__ = [ - "Catalog", - "CatalogItem", - "Color", - "Colormap", - "ColorStops", "HSLA", "HSVA", "RGBA", "RGBA8", + "Catalog", + "CatalogItem", + "Color", + "ColorStops", + "Colormap", ] diff --git a/src/cmap/_color.py b/src/cmap/_color.py index 7ab614279..a9abb56f7 100644 --- a/src/cmap/_color.py +++ b/src/cmap/_color.py @@ -466,7 +466,7 @@ class Color: The color to represent. Can be any "ColorLike". """ - __slots__ = ("_rgba", "_name", "__weakref__") + __slots__ = ("__weakref__", "_name", "_rgba") _rgba: RGBA _name: str | None diff --git a/src/cmap/_colormap.py b/src/cmap/_colormap.py index 00efa2b24..62e288453 100644 --- a/src/cmap/_colormap.py +++ b/src/cmap/_colormap.py @@ -121,6 +121,9 @@ class Colormap: """ __slots__ = ( + "__weakref__", + "_initialized", + "_lut_cache", "bad_color", "category", "color_stops", @@ -130,9 +133,6 @@ class Colormap: "name", "over_color", "under_color", - "_initialized", - "_lut_cache", - "__weakref__", ) color_stops: ColorStops