Skip to content

Commit 37dace3

Browse files
authored
updates (#30)
1 parent 5e02feb commit 37dace3

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude: ^LICENSE
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.4.0
10+
rev: v4.5.0
1111
hooks:
1212
- id: check-docstring-first
1313
- id: end-of-file-fixer
@@ -16,13 +16,13 @@ repos:
1616
args: [--autofix]
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.0.292
19+
rev: v0.1.6
2020
hooks:
2121
- id: ruff
22-
args: [--fix]
22+
args: [--fix, --unsafe-fixes]
2323

2424
- repo: https://github.com/psf/black
25-
rev: 23.9.1
25+
rev: 23.11.0
2626
hooks:
2727
- id: black
2828

@@ -34,7 +34,7 @@ repos:
3434
# - id: validate-pyproject
3535

3636
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v1.5.1
37+
rev: v1.7.1
3838
hooks:
3939
- id: mypy
4040
files: "^src/"

docs/colormaps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ to the [`cmap.Colormap`][] constructor; `cmap` refers to these objects collectiv
1818
"`ColormapLike`". Briefly, valid arguments are of type:
1919

2020
- [⬇️ `str`](#str)
21-
- [⬇️ `Iterable[ColorLike | tuple[float, ColorLike]]`](#iterablecolorlike-tuple) *(see [`ColorLike`](../colors/#colorlike-objects))*
21+
- [⬇️ `Iterable[ColorLike | tuple[float, ColorLike]]`](#iterablecolorlike-tuple) *(see [`ColorLike`](colors.md#colorlike-objects))*
2222
- [⬇️ `numpy.ndarray`](#numpyndarray)
2323
- [⬇️ `dict`](#dict)
2424
- [⬇️ `Callable[[ArrayLike], ArrayLike]`](#callable)
@@ -42,7 +42,7 @@ to the [`cmap.Colormap`][] constructor; `cmap` refers to these objects collectiv
4242

4343
### `Iterable[ColorLike | tuple]`
4444

45-
- An [`Iterable`][typing.Iterable] of [`ColorLike`](./colors/#colorlike-objects) objects:
45+
- An [`Iterable`][typing.Iterable] of [`ColorLike`](colors.md#colorlike-objects) objects:
4646

4747
- `Colormap(['blue', 'yellow', 'red'])` {{ cmap_expr: ['blue', 'yellow', 'red'] }}
4848
- `Colormap([(0, 0, 1.), "#FF0", "rgb(255, 0, 0)"])` {{ cmap_expr: [(0, 0, 1.), "#FF0", "rgb(255, 0, 0)"] }}

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ markdown_extensions:
5252
- md_in_html
5353
- pymdownx.snippets
5454
- pymdownx.emoji:
55-
emoji_generator: !!python/name:materialx.emoji.to_svg
56-
emoji_index: !!python/name:materialx.emoji.twemoji
55+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
56+
emoji_index: !!python/name:material.extensions.emoji.twemoji
5757
- pymdownx.extra
5858
- pymdownx.highlight
5959
- pymdownx.tabbed:

pyproject.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,18 @@ select = [
105105
"ISC", # implicit-str-concat
106106
"TID", # tidy-imports
107107
"RUF", # ruff-specific rules
108+
"TCH", # flake8-type-checking
109+
"TID", # flake8-tidy-imports
108110
]
109-
ignore = [
111+
[tool.ruff.lint]
112+
pydocstyle = { convention = "numpy" }
113+
extend-select = [
114+
"D417", # Missing argument descriptions in Docstrings
115+
]
116+
extend-ignore = [
110117
"D100", # Missing docstring in public module
111-
"D104", # Missing docstring in public package
112-
"D107", # Missing docstring in __init__
113-
"D203", # 1 blank line required before class docstring
114-
"D212", # Multi-line docstring summary should start at the first line
115-
"D213", # Multi-line docstring summary should start at the second line
116-
"D413", # Missing blank line after last section
117-
"D416", # Section name should end with a colon
118+
"D104", # Missing docstring in public module
119+
"D401", # First line should be in imperative mood (remove to opt in)
118120
]
119121

120122
[tool.ruff.per-file-ignores]

src/cmap/_color.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import contextlib
55
import re
66
import sys
7-
from collections.abc import Iterator
87
from typing import (
98
TYPE_CHECKING,
109
Any,
@@ -22,6 +21,7 @@
2221
from . import _external
2322

2423
if TYPE_CHECKING:
24+
from collections.abc import Iterator
2525
from typing import Union
2626

2727
import numpy.typing as npt

src/cmap/_colormap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def _mpl_segmentdata_to_stops(
10931093
alpha = np.ones_like(all_positions)
10941094

10951095
rgba = np.stack([*rgb, alpha], axis=1)
1096-
return [(a, tuple(b)) for a, b in zip(all_positions, rgba.tolist())] # type: ignore
1096+
return [(a, tuple(b)) for a, b in zip(all_positions, rgba.tolist())]
10971097

10981098

10991099
def _make_identifier(name: str) -> str:

0 commit comments

Comments
 (0)