Skip to content

Commit 11b53dd

Browse files
committed
Merge branch 'main' into cli
2 parents c86402e + 52fcfc6 commit 11b53dd

50 files changed

Lines changed: 2656 additions & 2744 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ jobs:
1515
check-manifest:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
- run: pipx run check-manifest
2020

21+
pyright:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: astral-sh/setup-uv@v6
26+
with:
27+
enable-cache: true
28+
- run: uv run pyright
29+
2130
test:
2231
name: ${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.gui }} ${{ matrix.canvas }}
2332
runs-on: ${{ matrix.os }}
@@ -85,7 +94,7 @@ jobs:
8594
canvas: pygfx
8695

8796
steps:
88-
- uses: actions/checkout@v4
97+
- uses: actions/checkout@v5
8998
- name: Set up uv
9099
uses: astral-sh/setup-uv@v6
91100
with:
@@ -154,7 +163,7 @@ jobs:
154163
python-version: ["3.10", "3.12"]
155164

156165
steps:
157-
- uses: actions/checkout@v4
166+
- uses: actions/checkout@v5
158167
- name: Set up uv
159168
uses: astral-sh/setup-uv@v6
160169
with:
@@ -193,7 +202,7 @@ jobs:
193202
test-docs:
194203
runs-on: macos-latest # nicer screenshots
195204
steps:
196-
- uses: actions/checkout@v4
205+
- uses: actions/checkout@v5
197206
- uses: astral-sh/setup-uv@v6
198207
- name: 📚 Build docs
199208
run: uv run --group docs mkdocs build --strict
@@ -213,7 +222,7 @@ jobs:
213222
contents: write
214223

215224
steps:
216-
- uses: actions/checkout@v4
225+
- uses: actions/checkout@v5
217226
with:
218227
fetch-depth: 0
219228

.github/workflows/deploy_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: macos-latest # nicer screenshots
1515
if: github.repository == 'pyapp-kit/ndv'
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
with:
1919
fetch-depth: 0
2020
- uses: astral-sh/setup-uv@v6

.github_changelog_generator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ project=ndv
33
issues=false
44
exclude-labels=duplicate,question,invalid,wontfix,hide
55
add-sections={"tests":{"prefix":"**Tests & CI:**","labels":["tests"]}, "documentation":{"prefix":"**Documentation:**", "labels":["documentation"]}}
6-
exclude-tags-regex=.*rc
6+
exclude-tags-regex=.*rc

.pre-commit-config.yaml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,36 @@ ci:
44
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
55

66
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: trailing-whitespace
11+
exclude: ".*\\.md"
12+
- id: end-of-file-fixer
13+
- id: check-yaml
14+
args: ["--unsafe"]
15+
- id: check-added-large-files
16+
717
- repo: https://github.com/abravalheri/validate-pyproject
818
rev: v0.24.1
919
hooks:
1020
- id: validate-pyproject
1121

12-
- repo: https://github.com/crate-ci/typos
13-
rev: v1.32.0
22+
- repo: https://github.com/adhtruong/mirrors-typos
23+
rev: v1.35.5
1424
hooks:
1525
- id: typos
1626
args: [--force-exclude] # omitting --write-changes
1727

1828
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.11.8
29+
rev: v0.12.10
2030
hooks:
21-
- id: ruff
31+
- id: ruff-check
2232
args: [--fix, --unsafe-fixes]
2333
- id: ruff-format
2434

2535
- repo: https://github.com/pre-commit/mirrors-mypy
26-
rev: v1.15.0
36+
rev: v1.17.1
2737
hooks:
2838
- id: mypy
2939
files: "^src/"
@@ -32,3 +42,17 @@ repos:
3242
- pydantic
3343
- psygnal
3444
- IPython
45+
- types-wxpython
46+
- qtpy
47+
- git+https://github.com/tlambert03/PyQt6-stubs.git@v6.7.3
48+
49+
- repo: local
50+
hooks:
51+
- id: pyright
52+
stages: [manual]
53+
exclude: "^docs/"
54+
name: pyright
55+
language: system
56+
types_or: [python, pyi]
57+
require_serial: true
58+
entry: uv run pyright

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ docs:
4040
docs-serve:
4141
uv run --group docs mkdocs serve --no-strict
4242

43-
lint:
44-
uv run pre-commit run --all-files
43+
lint:
44+
uv run pre-commit run --all-files

docs/css/material.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
.md-main__inner {
33
margin-bottom: 1.5rem;
44
}
5-
5+
66
/* Custom admonition: preview */
77
:root {
88
--md-admonition-icon--preview: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 12a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"/><path d="M12 3.5c3.432 0 6.124 1.534 8.054 3.241 1.926 1.703 3.132 3.61 3.616 4.46a1.6 1.6 0 0 1 0 1.598c-.484.85-1.69 2.757-3.616 4.461-1.929 1.706-4.622 3.24-8.054 3.24-3.432 0-6.124-1.534-8.054-3.24C2.02 15.558.814 13.65.33 12.8a1.6 1.6 0 0 1 0-1.598c.484-.85 1.69-2.757 3.616-4.462C5.875 5.034 8.568 3.5 12 3.5ZM1.633 11.945a.115.115 0 0 0-.017.055c.001.02.006.039.017.056.441.774 1.551 2.527 3.307 4.08C6.691 17.685 9.045 19 12 19c2.955 0 5.31-1.315 7.06-2.864 1.756-1.553 2.866-3.306 3.307-4.08a.111.111 0 0 0 .017-.056.111.111 0 0 0-.017-.056c-.441-.773-1.551-2.527-3.307-4.08C17.309 6.315 14.955 5 12 5 9.045 5 6.69 6.314 4.94 7.865c-1.756 1.552-2.866 3.306-3.307 4.08Z"/></svg>');
99
}
10-
10+
1111
.md-typeset .admonition.preview,
1212
.md-typeset details.preview {
1313
border-color: rgb(220, 139, 240);
1414
}
15-
15+
1616
.md-typeset .preview>.admonition-title,
1717
.md-typeset .preview>summary {
1818
background-color: rgba(142, 43, 155, 0.1);
1919
}
20-
20+
2121
.md-typeset .preview>.admonition-title::before,
2222
.md-typeset .preview>summary::before {
2323
background-color: rgb(220, 139, 240);
2424
-webkit-mask-image: var(--md-admonition-icon--preview);
2525
mask-image: var(--md-admonition-icon--preview);
26-
}
26+
}

docs/hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def generate_screenshots(script: Path) -> Iterable[tuple[bytes, Mode]]:
146146

147147
def _start_app(*_: Any) -> QCoreApplication:
148148
if (app := QApplication.instance()) is None:
149-
QApplication._APP = app = original_new(*_) # type: ignore
150-
QApplication.__init__(app, []) # type: ignore
149+
QApplication._APP = app = original_new(*_) # type: ignore[attr-defined]
150+
QApplication.__init__(app, []) # type: ignore[arg-type]
151151
return app
152152

153153
patch_app = patch.object(QApplication, "__new__", _start_app)

examples/cookbook/microscope_dashboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
- move the stage in the x and y directions.
1515
"""
1616

17+
from __future__ import annotations
18+
1719
from typing import Any, cast
1820

1921
import astropy.units as u

examples/numpy_arr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
print(e)
1515
img = ndv.data.nd_sine_wave((10, 3, 8, 512, 512))
1616

17-
viewer = ndv.imshow(img)
17+
viewer = ndv.imshow(img, current_index={0: 30}, channel_mode="composite")

examples/xarray_arr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
import ndv
1616

1717
da = xr.tutorial.open_dataset("air_temperature").air
18-
ndv.imshow(da, default_lut={"cmap": "thermal"}, visible_axes=("lat", "lon"))
18+
ndv.imshow(
19+
da.astype("float32"), default_lut={"cmap": "thermal"}, visible_axes=("lat", "lon")
20+
)

0 commit comments

Comments
 (0)