Skip to content

chore: 🔧 type-check tests and bump ty monthly - #55

Merged
Panadestein merged 3 commits into
mainfrom
chore/28-ty-follow-up
Oct 6, 2026
Merged

Panadestein merged 3 commits into
mainfrom
chore/28-ty-follow-up

Conversation

@Panadestein

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Closes #28.

Scope after #37

#37 already did most of #28:

  • ty is in the dev group and configured in pyproject.toml.
  • It runs as a prek hook, so lint.yml gates PRs on it.
  • src/ is clean.

Two items were left, and this PR adds them:

  1. Type-check tests/. [tool.ty.src] include now covers tests/. That turned up one real finding: chi_out was annotated int, but NumPy integers are accepted on purpose (see test_numpy_integer_chi_out_accepted).
    • apply, compress and src now take chi_out: int | np.integer.
    • validate_chi_out returns a plain int, so sweep and the exact fallback still get an int.
    • numpy is imported only under TYPE_CHECKING, so the backend-agnostic rule holds.
  2. Scheduled bump. The new update-ty.yml has the same shape as update-ruff.yml. It bumps the ty pin in pyproject.toml and the ty-pre-commit rev in prek.toml together, and regenerates uv.lock. ty is pre-1.0, so if ty check fails on the new version the PR opens as a draft.

CONTRIBUTING.md and AGENTS.md now say uv run ty check, without the src/ argument, because the include list decides what gets checked.

Checks

  • uv run prek run --all-files is clean, ty included.
  • uv run pytest -m "not slow": 123 passed, 1 skipped (no CuPy).
  • I haven't run update-ty.yml yet; after merge it can be triggered with workflow_dispatch.

Finishes #28 on top of #37: ty now checks tests/ as well as src/, and a
scheduled update-ty.yml bumps the ty pin in pyproject.toml and prek.toml
together, opening the PR as a draft when the new version reports diagnostics.

The one finding in tests/ was real: chi_out was annotated as int although
NumPy integers are accepted on purpose. The public signatures now take
int | np.integer, and validate_chi_out returns a plain int.

Closes #28

Assisted-by: pi:claude-opus-5.5
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  4 files  ±0    4 suites  ±0   2m 16s ⏱️ +13s
135 tests ±0  134 ✅ ±0  1 💤 ±0  0 ❌ ±0 
516 runs  ±0  514 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 7c93455. ± Comparison against base commit 7894573.

♻️ This comment has been updated with latest results.

@Panadestein
Panadestein merged commit ee40429 into main Oct 6, 2026
14 checks passed
@Panadestein
Panadestein deleted the chore/28-ty-follow-up branch October 6, 2026 15:36
Panadestein added a commit that referenced this pull request Oct 7, 2026
Resolve the conflicts with stdlib logging (#52), input-precision
sketches (#36), validation (#38), ty enforcement (#37, #55) and the
Fumadocs site (#56):

- the sweep draws its sketches with gaussian_sketch and logs its plan,
  pass times and stalls at DEBUG with %-style arguments;
- the working dtype is promoted over every site, not just the first;
- docs/large-problems.md moves to features/large-problems.mdx and the
  out-of-core testing notes to contributing/testing.mdx;
- bench_large.py logs through the stdlib and gains --debug.

Type lazily read sites: the entry points accept any array-like with
shape, dtype, ndim and np.asarray support but were typed
Sequence[NDArray]. Add the SiteLike protocol and the Site alias, use
them from src/apply/compress down to the site source, and export
SiteLike. Also fix the other ty findings: the Tier list in the planner,
known_kind() for validated trains, padded_shape without a type: ignore,
cupyx as an allowed unresolved import, and typed fakes in the tests.

Assisted-by: pi:claude-opus-5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt ty as type checker

1 participant