Repository navigation
Generate static type stubs for the generic compute engine - #409
Draft
amirabbas-jalali-bentley wants to merge 2 commits into
Conversation
Add offline stub generator (evo.compute._stubgen), py.typed marker, captured task catalogue snapshot, and generated engine.pyi so static type checkers and editors get autocomplete and parameter/result checking for ComputeClient while keeping runtime execution discovery-driven. Also adds Makefile targets and a CI check verifying stub freshness and running mypy and pyright against positive and negative typing examples.
This was referenced Nov 14, 2026
amirabbas-jalali-bentley
changed the base branch from
main
to
resolve-compute-references-and-outputs
November 16, 2026 20:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ComputeClientresolves topics, tasks, parameters, and hydrated results dynamically from the live discovery catalogue at runtime. This PR adds an offline.pyistub generator (evo.compute._stubgen), a sanitised point-in-time snapshot of the task catalogue, and a generatedengine.pyi+py.typedmarker so editors and static type checkers (mypyandpyright) get full autocomplete and static parameter/result checking without changing runtime behavior.Changes
evo.compute._stubgen:python -m evo.compute._stubgen generate(and--checkfor CI) renderssrc/evo/compute/engine.pyioffline frompackages/evo-compute/stubs/snapshot/and formats it reproducibly withruff.python -m evo.compute._stubgen capturecaptures a sanitised task snapshot from a live discovery endpoint, stripping deployment-specific URLs and keys and skipping scratchtest*topics.TypedDictparameter definitions (withObjectInput/AttributeInput/FileInputshorthands matchingReferenceResolverandSearchNeighborhoodstructural recognition),TaskResult/ResultNodesubclasses for hydrated outputs, and__getattr__fallbacks so tasks added after the snapshot remain callable without false static errors.py.typed:src/evo/compute/py.typedandsrc/evo/compute/engine.pyi(98 tasks across 10 topics), whichgriffealso merges into the MkDocsComputeClientreference page.SearchNeighborhoodwire round-trip: accepts wire-shapedellipsoid_rangesdictionaries when validatingSearchNeighborhood.make stubs-compute,make check-stubs-compute,make check-types-compute, and acheck-stubsjob in.github/workflows/on-pull-request.yamlenforcing stub freshness and runningmypyandpyrightagainst positive/negative typing fixtures (stubs/checks/usage_ok.pyandusage_bad.py).No breaking changes; runtime execution remains live and discovery-driven.
Testing
test_stubgen.py(54 tests) covers determinism, stub freshness againstComputeClientsignatures, reference shorthands, topic/name collisions, deep-validation agreement across the snapshot, and realmypy+pyrightruns onusage_ok.py/usage_bad.py.evo-computetests: 776 passed, 2 skipped (54 new, 620 subtests).ruff check,ruff format --check,uv lock --check, and pre-commit hooks pass.Checklist