Skip to content

Add strict typed Python surface and speed up bindings - #165

Merged
dnncha merged 2 commits into
mainfrom
codex/dotmatch-pro-boundary
Oct 27, 2026
Merged

dnncha merged 2 commits into
mainfrom
codex/dotmatch-pro-boundary

Conversation

@dnncha

@dnncha dnncha commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a typed Python surface: py.typed, MatchStatus IntEnum, Literal policies, TypedDict summaries, TargetRow, strict mypy + pyright gates, and 3.9-safe public type shapes.
  • Add a static/example test flow: assert_type API contracts, doctests, expect-style snapshots, typed quickstart, and make quality.
  • Speed up the Python binding path with NamedTuple results, a status lookup, str/bytes marshalling fast path, and 256-read stream batches.

Verification

  • make typecheck (mypy strict + pyright): clean
  • make lint: clean
  • pytest python/tests: 532 passed
  • make examples-test: 16 passed
  • python scripts/check_python_wheel.py: wheel and sdist include py.typed
  • Local median-of-31 benchmark (Apple M5, 40k reads / 4,096 targets): Hamming +59.5%, Levenshtein +17.1%, exact +64.2%, stream +71.9%. Raw data in benchmarks/raw/python_api_binding_20261027.json.

Note: result records are now NamedTuples (field access and keyword construction unchanged; tuple-compatible equality).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T19:59:29.856335Z a537166 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a53716648b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/page.tsx Outdated
{
title: "Published release",
body:
"DotMatch v0.2.2 is available from PyPI and Bioconda. The package pages list the current release and installation files."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report the actual 0.1.9 release on the homepage

The homepage tells users that v0.2.2 is available from PyPI and Bioconda, and repeats that version in the release trust fact, but this commit declares and documents 0.1.9 in pyproject.toml, package.json, and docs/distribution-release.json. Anyone following the package links will find a different release than advertised, so these claims should use the recorded 0.1.9 version.

Useful? React with 👍 / 👎.

"",
f"DotMatch {PYTHON_PACKAGE_VERSION} was used for deterministic known-target short-DNA assignment.",
f"The assay mode was `{plan.spec.mode}` and the assay type was `{plan.spec.assay_type}`.",
"Reads were assigned only when exactly one known target was compatible under the configured policy; ambiguous reads were not silently counted.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe best-policy assignments accurately

For an AssaySpec using ambiguity_policy = "best", the generated methods.md still says that reads were assigned only when exactly one target was compatible. Under the best policy, a read can be assigned uniquely when several targets lie within k as long as only one has the best distance, so this statement makes the generated methods and handoff artifacts misdescribe the actual selection rule. Generate policy-specific wording instead.

Useful? React with 👍 / 👎.

@dnncha
dnncha force-pushed the codex/dotmatch-pro-boundary branch from a537166 to fa41d0b Compare October 27, 2026 20:03
@dnncha
dnncha merged commit dbe9c6f into main Oct 27, 2026
15 of 22 checks passed
@dnncha
dnncha deleted the codex/dotmatch-pro-boundary branch October 27, 2026 20:04
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.

1 participant