Repository navigation
Add a generic compute client driven by task discovery - #395
Open
amirabbas-jalali-bentley wants to merge 2 commits into
Open
amirabbas-jalali-bentley wants to merge 2 commits into
amirabbas-jalali-bentley wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The **parameters fallback bypasses required and unknown parameter validation, allowing invalid calls to reach job submission; schema-key validation and rejection tests are needed.
1 open issue
What changed in this PR
Adds a discovery-driven ComputeClient so callers can run catalogued compute tasks without a dedicated task client.
Changes:
- Adds dynamic task access, schema-shaped signatures, parameter forwarding, and preview opt-in.
- Adds cache-only discovery access and tests for execution, signatures, and cache behavior.
- Publishes API documentation and updates the kriging notebook’s filter example.
| File | Description |
|---|---|
packages/evo-compute/tests/test_engine.py |
Tests the generic compute client. |
packages/evo-compute/tests/test_discovery.py |
Tests cache-only reads, expiry, and copy isolation. |
packages/evo-compute/tests/data/discovery-tasks.json |
Extends schema fixtures for signature tests. |
packages/evo-compute/src/evo/compute/engine.py |
Implements discovery-driven task execution. |
packages/evo-compute/src/evo/compute/discovery.py |
Adds peek_tasks() for non-fetching cache access. |
packages/evo-compute/src/evo/compute/__init__.py |
Exports ComputeClient. |
packages/evo-compute/docs/examples/kriging_multiple.ipynb |
Updates filtering and removes an obsolete method call. |
mkdocs/site/packages/evo-compute/index.html |
Links navigation to the new client page. |
mkdocs/site/packages/evo-compute/DiscoveryClient.html |
Documents peek_tasks() and updates navigation. |
mkdocs/site/packages/evo-compute/ComputeClient.html |
Adds the rendered client reference. |
mkdocs/docs/packages/evo-compute/ComputeClient.md |
Adds the client documentation stub. |
mkdocs/api_clients.txt |
Registers the client for documentation generation. |
Review effort: Balanced
amirabbas-jalali-bentley
force-pushed
the
add-generic-compute-engine
branch
from
November 14, 2026 02:09
a9f8dfe to
d118353
Compare
This was referenced Nov 14, 2026
ComputeClient exposes every task in the discovery catalogue as client.<topic>.<task>.run(...), with arun() for names held as strings. A run reads the task's schema to build a keyword-only signature, submits only the parameters the caller passed, and waits for the results. Preview stays opt-in. DiscoveryClient gains peek_tasks(), so tab-completion and signature help can read the cached catalogue without making a request. Also fixes the filter example in the kriging_multiple notebook, which still used the removed RegionFilter.
amirabbas-jalali-bentley
force-pushed
the
add-generic-compute-engine
branch
from
November 18, 2026 16:44
78b1edc to
4faf95b
Compare
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
DiscoveryClient(#387) lists the tasks an organization can run, with the JSON Schema of each task's parameters. This addsComputeClient, which uses that catalogue to run any listed task without a hand-written client for it.Series overview & trying the full preview build
Today
evo-computeonly covers tasks that have a hand-written client, so every new task or parameter change requires dedicated SDK code. Building onDiscoveryClient(#387), this PR starts a 6-part series that brings a discovery-driven generic compute engine toevo-compute:ComputeClient(client.<topic>.<task>.run(...)andarun(...)) with lazy discovery, schema-shaped runtime signatures, and explicitpreviewopt-in.ParameterValidationError, required/nullability checks by default, opt-in JSON Schema Draft 2020-12 deep validation, and discriminated union diagnostics).TaskResult/ResultNodehydration (.load()and.to_dataframe()) on output..pyistub generator and bundled catalogue snapshot (engine.pyi+py.typed) for static autocomplete andmypy/pyrightchecking while keeping execution live.evo.compute.overrides, used by Kriging for cross-field checks, folded filter/diagnostic inputs, andKrigingResult) and schema-drivenadditionalPropertieshandling.TaskJobhandles (submit(...),asubmit(...),TaskJob.from_url(...)), context-shared discovery caching, and routingevo.compute.tasks.runthroughComputeClientso existing notebooks work unchanged on the engine.End outcome & test build: With the full stack in place, callers can run any catalogued compute task with typed SDK objects, static editor hints, hydrated results, and optional job handles, while existing
evo.compute.taskscode and example notebooks continue to work as drop-in calls. To try the complete end-state in an existingevo-sdkenvironment today, install the preview wheel from the 0.0.7a1 preview release:pip install https://github.com/aminabedi-bentley/evo-python-sdk/releases/download/evo-compute-preview-0.0.7a1/evo_compute-0.0.7a1-py3-none-any.whl # Switch back anytime with: pip install evo-compute==0.0.6The follow-up PRs (#407–#411) are open in draft so the full design is visible end to end. Please take a look at this first PR (#395) — once it lands, we will rebase and open the next PRs in sequence.
Changes
ComputeClient(context)(exported fromevo.compute) exposes the catalogue asclient.<topic>.<task>.run(...). Topic, task and parameter names are the platform's names with hyphens replaced by underscores, sonormal-scoreisclient.geostatistics.normal_score.arun(topic, task, parameters)does the same for names held as strings.runfetches the catalogue on first use, binds the arguments to a keyword-only signature built from the task's parameter schema, submits the job throughJobClientand returns its results as adict. Parameters are sent as given, in the form the schema declares. Only the parameters passed are sent, so the platform applies its own defaults, while an explicitNoneor0is still sent. A missing or unknown parameter raisesTypeErrorbefore anything is submitted.preview=Trueopts in to preview tasks. It is off by default, including for tasks behind a feature flag.runshows the schema-shaped signature and the task description, anddir()lists the cached topics and tasks for tab-completion. Attribute access alone never makes a request.runtakes**parameterswith the schema's names instead, while still checking required and unknown schema keys before submission.DiscoveryClient.peek_tasks()returns the cached catalogue without fetching it, or an empty list while the cache is unset or expired. The signature and tab-completion lookups use it. Like the other accessors, it returns copies.ComputeClientis added to the API client list. Its generated docs page is included, because the docs workflow only updates pages that already exist.kriging_multiple.ipynb. It imported the removedRegionFilter, passedtarget_region_filter, whichKrigingParametersdoesn't have, and calledto_dict(), which doesn't exist. It now usestarget_filter=Filter(where=FilterCondition(...)).No breaking changes. This adds a class and a method, and the existing task clients are unchanged.
Testing
ComputeClienttests run against a mocked discovery endpoint with job submission patched. They cover when discovery happens, name normalisation for topics, tasks and parameters, which parameters are sent, preview handling, errors, the**parametersfallback (including required and unknown parameter rejection), signatures and descriptions after caching, anddir(). Newpeek_taskstests cover the cache, its expiry and the returned copies.evo-computetests: 541 passed (24 new).ruff check,ruff format --checkand the pre-commit hooks pass.Checklist