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 @@ -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'
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
- numpy>=2.2
2 changes: 2 additions & 0 deletions docs/_gen_cmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/cmap/_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/cmap/_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions src/cmap/data/tol/record.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down