diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6463b7ab..d32f01e33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: if: runner.os != 'Windows' run: | python -m pip install -e .[test_thirdparty] ${{ github.event_name == 'schedule' && '--pre' || '' }} - python -m pip install PyQt6==6.5.3 + python -m pip install PyQt6==6.8.1 - name: Run test if: runner.os != 'Windows' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95d2bf2ac..4cda46bf1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,4 +34,4 @@ repos: - id: mypy files: "^src/" additional_dependencies: - - numpy>=2 + - numpy>=2.2 diff --git a/docs/_gen_cmaps.py b/docs/_gen_cmaps.py index 449aca912..bcac41356 100644 --- a/docs/_gen_cmaps.py +++ b/docs/_gen_cmaps.py @@ -96,6 +96,8 @@ def build_catalog(catalog: "_catalog.Catalog") -> None: except KeyError as e: raise KeyError(f"Missing info for {name}: {e}") from e + # FIXME: not a great way to determine aliases... + # prone to false positives if normalization is not perfect/consistent if info.qualified_name.lower() != name.lower(): # skip aliases continue diff --git a/src/cmap/_catalog.py b/src/cmap/_catalog.py index c8768d1dd..7c67857c9 100644 --- a/src/cmap/_catalog.py +++ b/src/cmap/_catalog.py @@ -10,6 +10,7 @@ import json import logging +import warnings from collections.abc import Container, Iterable, Iterator, Mapping from dataclasses import dataclass, field from pathlib import Path @@ -197,6 +198,17 @@ def _build_catalog(records: Iterable[FileDescriptorOrPath]) -> CatalogDict: ) ctlg[f"{namespace}{NAMESPACE_DELIMITER}{alias}"] = {"alias": namespaced} + if dashed_names := { + k for k in ctlg if "-" in k and "alias" not in ctlg[k] + }: # pragma: no cover + warnings.warn( + f"The following colormap names contain dashes in the record.json: " + f"{dashed_names}.\n\n" + "This is unsupported and will cause issues for docs. " + "Please use underscores instead.", + stacklevel=2, + ) + return ctlg diff --git a/src/cmap/_colormap.py b/src/cmap/_colormap.py index 7c30a1dc1..3ea9ce382 100644 --- a/src/cmap/_colormap.py +++ b/src/cmap/_colormap.py @@ -1399,7 +1399,7 @@ def _mpl_segmentdata_to_stops( alpha = np.ones_like(all_positions) rgba = np.stack([*rgb, alpha], axis=1) - return [(a, tuple(b)) for a, b in zip(all_positions, rgba.tolist())] + return [(a, tuple(b)) for a, b in zip(all_positions, rgba.tolist())] # type: ignore def _make_identifier(name: str) -> str: diff --git a/src/cmap/data/tol/record.json b/src/cmap/data/tol/record.json index d0de016c2..bd664747d 100644 --- a/src/cmap/data/tol/record.json +++ b/src/cmap/data/tol/record.json @@ -39,7 +39,7 @@ "data": "cmap.data.tol:bright", "interpolation": false }, - "bright-alt": { + "bright_alt": { "category": "qualitative", "data": "cmap.data.tol:bright_alt", "interpolation": false @@ -49,12 +49,12 @@ "data": "cmap.data.tol:dark", "interpolation": false }, - "high-contrast": { + "high_contrast": { "category": "qualitative", "data": "cmap.data.tol:high_contrast", "interpolation": false }, - "high-contrast-alt": { + "high_contrast_alt": { "category": "qualitative", "data": "cmap.data.tol:high_contrast_alt", "interpolation": false @@ -72,17 +72,17 @@ "data": "cmap.data.tol:light", "interpolation": false }, - "light-alt": { + "light_alt": { "category": "qualitative", "data": "cmap.data.tol:light_alt", "interpolation": false }, - "medium-contrast": { + "medium_contrast": { "category": "qualitative", "data": "cmap.data.tol:medium_contrast", "interpolation": false }, - "medium-contrast-alt": { + "medium_contrast_alt": { "category": "qualitative", "data": "cmap.data.tol:medium_contrast_alt", "interpolation": false @@ -92,7 +92,7 @@ "data": "cmap.data.tol:muted", "interpolation": false }, - "muted-alt": { + "muted_alt": { "category": "qualitative", "data": "cmap.data.tol:muted_alt", "interpolation": false @@ -256,7 +256,7 @@ "data": "cmap.data.tol:vibrant", "interpolation": false }, - "vibrant-alt": { + "vibrant_alt": { "category": "qualitative", "data": "cmap.data.tol:vibrant_alt", "interpolation": false