tamarind-cli 0.5.0__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/PKG-INFO +6 -1
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/README.md +5 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/pyproject.toml +1 -1
- tamarind_cli-0.5.2/src/tamarind/catalog.py +160 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/jobs.py +27 -2
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/jobs.py +76 -4
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/resources.py +20 -6
- tamarind_cli-0.5.2/tests/test_catalog_examples.py +110 -0
- tamarind_cli-0.5.2/tests/test_org_job_lookup.py +252 -0
- tamarind_cli-0.5.0/src/tamarind/catalog.py +0 -70
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/.github/workflows/ci.yml +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/.github/workflows/publish.yml +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/.gitignore +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/LICENSE +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/docs/architecture.md +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/docs/custom-tools.md +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/install.sh +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/openapi-python-client.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/pipelines-openapi-python-client.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/pipelines-v1.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/pipelines-v1.lock.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/public-v1.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/openapi/public-v1.lock.json +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/scripts/check_custom_tools_provenance.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/scripts/sync_custom_tools_contract.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/scripts/sync_pipelines_contract.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/attribution.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/auth.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/catalog.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/custom_tools.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/files.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/guidance.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/inputs.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/main.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/cli/output.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/config.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_contract.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/build_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/cancel_custom_tool_build.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool_upload.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/delete_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/get_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_build_logs.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_versions.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tools.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/publish_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/update_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/client.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/errors.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_error.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_event.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_log_page.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_result.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_result_action.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_gputype.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_memory.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_version_request.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_gputype.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_memory.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_gputype.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_memory.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_page.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_status.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_problem.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_problem_errors_type_0_item.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_gpu_type_type_0.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_memory_type_0.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_upload_session.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_upload_session_uploadheaders.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version_page.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version_status.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/types.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/client.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/packaging.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/resources.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/transport.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/validation.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/errors.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/http.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/get_run.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/list_node_run_molecules.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/client.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/errors.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/__init__.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/node_run_status.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_page.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_scores.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_problem.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_problem_errors_type_0_item.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_run.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_run_inputs.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/run_status.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/source.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/types.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/resources.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/pipelines/transport.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/py.typed +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/rest.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/src/tamarind/uploads.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_agent_contract.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_attribution.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_batch_prevalidate.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_bugbash.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_cli_commands.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_config.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_custom_tools_cli.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_custom_tools_generation.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_custom_tools_packaging.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_custom_tools_sdk.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_errors.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_file_filters.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_inputs.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_jobs.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_output.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_pep561.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_pipelines_sdk.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_rest.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/tests/test_sdk_resources.py +0 -0
- {tamarind_cli-0.5.0 → tamarind_cli-0.5.2}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: tamarind-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent.
|
|
5
5
|
Project-URL: Homepage, https://tamarind.bio
|
|
6
6
|
Project-URL: Documentation, https://app.tamarind.bio/api-docs
|
|
@@ -95,6 +95,11 @@ tamarind submit boltz --input job.yaml --name my-run \
|
|
|
95
95
|
tamarind jobs
|
|
96
96
|
tamarind status my-run
|
|
97
97
|
tamarind results my-run --download ./out
|
|
98
|
+
|
|
99
|
+
# A job run by another member of your organization
|
|
100
|
+
tamarind jobs --organization
|
|
101
|
+
tamarind status their-run --organization # or --email teammate@example.com
|
|
102
|
+
tamarind results their-run --organization --download ./out
|
|
98
103
|
```
|
|
99
104
|
|
|
100
105
|
Set individual fields inline instead of a file:
|
|
@@ -69,6 +69,11 @@ tamarind submit boltz --input job.yaml --name my-run \
|
|
|
69
69
|
tamarind jobs
|
|
70
70
|
tamarind status my-run
|
|
71
71
|
tamarind results my-run --download ./out
|
|
72
|
+
|
|
73
|
+
# A job run by another member of your organization
|
|
74
|
+
tamarind jobs --organization
|
|
75
|
+
tamarind status their-run --organization # or --email teammate@example.com
|
|
76
|
+
tamarind results their-run --organization --download ./out
|
|
72
77
|
```
|
|
73
78
|
|
|
74
79
|
Set individual fields inline instead of a file:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tamarind-cli"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.2"
|
|
4
4
|
description = "Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""Discovery / catalog client.
|
|
2
|
+
|
|
3
|
+
The tool catalog and per-tool schemas are gated by per-org visibility logic
|
|
4
|
+
that runs server-side, so the CLI consumes them over HTTP from the catalog
|
|
5
|
+
service (the ``/catalog/*`` routes) rather than reading the database directly.
|
|
6
|
+
|
|
7
|
+
These routes return exactly the JSON the MCP's discovery tools return
|
|
8
|
+
(``getAvailableTools``, ``listModalities``, ``listTags``, ``getJobSchema``),
|
|
9
|
+
because both are served by the same shared implementation. So whatever a tool
|
|
10
|
+
looks like in the MCP, it looks identical here.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from .http import HTTPClient
|
|
18
|
+
|
|
19
|
+
CATALOG_PREFIX = "catalog"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def list_tools(
|
|
23
|
+
client: HTTPClient,
|
|
24
|
+
*,
|
|
25
|
+
modality: str | None = None,
|
|
26
|
+
function: str | None = None,
|
|
27
|
+
search: str | None = None,
|
|
28
|
+
custom: bool | None = None,
|
|
29
|
+
) -> dict:
|
|
30
|
+
"""GET /catalog/tools — the filtered tool catalog (mirrors getAvailableTools)."""
|
|
31
|
+
params = {
|
|
32
|
+
"modality": modality,
|
|
33
|
+
"function": function,
|
|
34
|
+
"search": search,
|
|
35
|
+
"custom": "true" if custom else None,
|
|
36
|
+
}
|
|
37
|
+
return client.get_json(f"{CATALOG_PREFIX}/tools", params=params)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def list_modalities(client: HTTPClient) -> dict:
|
|
41
|
+
"""GET /catalog/modalities — molecule types you can filter by."""
|
|
42
|
+
return client.get_json(f"{CATALOG_PREFIX}/modalities")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def list_functions(client: HTTPClient) -> dict:
|
|
46
|
+
"""GET /catalog/functions — functions (tags) you can filter by."""
|
|
47
|
+
return client.get_json(f"{CATALOG_PREFIX}/functions")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def get_schema(client: HTTPClient, job_type: str) -> dict:
|
|
51
|
+
"""GET /catalog/tools/{jobType}/schema — full parameter schema + example job."""
|
|
52
|
+
return client.get_json(f"{CATALOG_PREFIX}/tools/{job_type}/schema")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# -- helpers for rendering / example extraction ---------------------------
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _conditional_true(conditionals: list[dict], values: dict[str, Any]) -> bool:
|
|
59
|
+
"""Is a parameter's conditional gate satisfied by ``values``?
|
|
60
|
+
|
|
61
|
+
A direct port of `conditionalTrue` in the website's src/shared_utils.js, which is what
|
|
62
|
+
/submit-job enforces (via `inactiveSpecifiedFieldError`). The list is AND-ed, and a
|
|
63
|
+
controller missing from ``values`` fails the gate — same as there. Kept in step with
|
|
64
|
+
that function: a checkType it grows and we don't just means we prune nothing extra,
|
|
65
|
+
which is the safe direction (the server still rejects it) but is worth syncing.
|
|
66
|
+
"""
|
|
67
|
+
for cond in conditionals:
|
|
68
|
+
other = cond.get("otherSettingName")
|
|
69
|
+
if other not in values:
|
|
70
|
+
return False
|
|
71
|
+
actual, expected = values[other], cond.get("otherSettingValue")
|
|
72
|
+
check = cond.get("checkType")
|
|
73
|
+
if check == "equals":
|
|
74
|
+
if actual != expected:
|
|
75
|
+
return False
|
|
76
|
+
elif check == "not-equals":
|
|
77
|
+
if actual == expected:
|
|
78
|
+
return False
|
|
79
|
+
elif check == "includes":
|
|
80
|
+
# An array `otherSettingValue` means "scalar is one of [...]"; otherwise the
|
|
81
|
+
# controller is a multiselect that must contain the value.
|
|
82
|
+
if isinstance(expected, list):
|
|
83
|
+
if actual not in expected:
|
|
84
|
+
return False
|
|
85
|
+
elif isinstance(actual, list) and expected not in actual:
|
|
86
|
+
return False
|
|
87
|
+
elif check == "greaterThan":
|
|
88
|
+
if not _as_float(actual) > _as_float(expected):
|
|
89
|
+
return False
|
|
90
|
+
elif check == "lessThan":
|
|
91
|
+
if not _as_float(actual) < _as_float(expected):
|
|
92
|
+
return False
|
|
93
|
+
elif check == "exists":
|
|
94
|
+
if not actual and actual != 0:
|
|
95
|
+
return False
|
|
96
|
+
elif check == "notEmpty":
|
|
97
|
+
if isinstance(actual, (list, str)):
|
|
98
|
+
if len(actual) == 0:
|
|
99
|
+
return False
|
|
100
|
+
else:
|
|
101
|
+
return False
|
|
102
|
+
# An unrecognized checkType is skipped, as the JS `default:` branch does.
|
|
103
|
+
return True
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _as_float(value: Any) -> float:
|
|
107
|
+
"""JS `parseFloat` semantics: unparseable compares false, never raises."""
|
|
108
|
+
try:
|
|
109
|
+
return float(value)
|
|
110
|
+
except (TypeError, ValueError):
|
|
111
|
+
return float("nan")
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def example_settings(schema: dict[str, Any]) -> dict[str, Any]:
|
|
115
|
+
"""Pull a *submittable* ``settings`` dict out of a schema's exampleJob, if present.
|
|
116
|
+
|
|
117
|
+
The catalog builds `exampleJob.settings` by collecting every parameter's `example`,
|
|
118
|
+
including ones gated behind a `conditionals` controller it does not also set. Submitting
|
|
119
|
+
that verbatim is rejected — boltz's example carries `ligands`, `dna` and `rna` without
|
|
120
|
+
`addLigands`/`addDNA`/`addRNA`, and /submit-job answers `boltz field "ligands" can only
|
|
121
|
+
be set when addLigands equals true`. So drop the fields whose gate is not satisfied,
|
|
122
|
+
leaving an example that actually submits.
|
|
123
|
+
|
|
124
|
+
Gates are evaluated against the example merged over the schema's defaults, because the
|
|
125
|
+
server validates post-autofill settings: a field gated on `useMSA: true` is legitimately
|
|
126
|
+
active when `useMSA` defaults to true and nobody overrode it. Pruning repeats to a fixed
|
|
127
|
+
point, since a dropped field can itself be another field's controller (boltz
|
|
128
|
+
`version` -> `predictAffinity` -> `binderChain`).
|
|
129
|
+
"""
|
|
130
|
+
example = schema.get("exampleJob") or {}
|
|
131
|
+
settings = dict(example.get("settings") or {})
|
|
132
|
+
if not settings:
|
|
133
|
+
return settings
|
|
134
|
+
|
|
135
|
+
params = [p for p in schema.get("parameters", []) if p.get("name")]
|
|
136
|
+
gated = {p["name"]: p["conditionals"] for p in params if p.get("conditionals")}
|
|
137
|
+
if not gated:
|
|
138
|
+
return settings
|
|
139
|
+
defaults = {p["name"]: p["default"] for p in params if "default" in p}
|
|
140
|
+
|
|
141
|
+
while True:
|
|
142
|
+
values = {**defaults, **settings}
|
|
143
|
+
dropped = [
|
|
144
|
+
name
|
|
145
|
+
for name in settings
|
|
146
|
+
if name in gated and not _conditional_true(gated[name], values)
|
|
147
|
+
]
|
|
148
|
+
if not dropped:
|
|
149
|
+
return settings
|
|
150
|
+
for name in dropped:
|
|
151
|
+
del settings[name]
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def required_param_names(schema: dict[str, Any]) -> list[str]:
|
|
155
|
+
"""Names of parameters marked required (top-level; ignores task-gated ones)."""
|
|
156
|
+
out = []
|
|
157
|
+
for p in schema.get("parameters", []):
|
|
158
|
+
if p.get("required") and p.get("name"):
|
|
159
|
+
out.append(p["name"])
|
|
160
|
+
return out
|
|
@@ -20,6 +20,12 @@ from .. import output
|
|
|
20
20
|
from ..guidance import rewrite_validation_guidance
|
|
21
21
|
from ..inputs import effective_job_name, effective_job_type, resolve_job_input
|
|
22
22
|
|
|
23
|
+
_ORG_LOOKUP_HELP = (
|
|
24
|
+
"Find the job across your org's members (a name several members share, "
|
|
25
|
+
"and batch subjobs, need --email)."
|
|
26
|
+
)
|
|
27
|
+
_EMAIL_LOOKUP_HELP = "The job belongs to this org member."
|
|
28
|
+
|
|
23
29
|
|
|
24
30
|
def _gen_name(tool: str) -> str:
|
|
25
31
|
return f"{tool}-{uuid.uuid4().hex[:8]}"
|
|
@@ -677,11 +683,15 @@ def register(app: typer.Typer) -> None:
|
|
|
677
683
|
def status(
|
|
678
684
|
ctx: typer.Context,
|
|
679
685
|
job_name: str = typer.Argument(..., help="Job name."),
|
|
686
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
687
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
680
688
|
) -> None:
|
|
681
689
|
"""Show one job's current status and metadata."""
|
|
682
690
|
state = ctx.obj
|
|
683
691
|
with state.rest_client() as client:
|
|
684
|
-
job = jobs_helpers.fetch_job(
|
|
692
|
+
job = jobs_helpers.fetch_job(
|
|
693
|
+
client, job_name, organization=organization, job_email=email
|
|
694
|
+
)
|
|
685
695
|
output.emit(
|
|
686
696
|
_sanitize_job_output(job),
|
|
687
697
|
state.output,
|
|
@@ -694,6 +704,8 @@ def register(app: typer.Typer) -> None:
|
|
|
694
704
|
job_name: str = typer.Argument(..., help="Job name."),
|
|
695
705
|
poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls."),
|
|
696
706
|
timeout: Optional[float] = typer.Option(None, "--timeout", help="Give up after N seconds."),
|
|
707
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
708
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
697
709
|
) -> None:
|
|
698
710
|
"""Block until a job reaches a terminal state."""
|
|
699
711
|
state = ctx.obj
|
|
@@ -704,6 +716,8 @@ def register(app: typer.Typer) -> None:
|
|
|
704
716
|
poll_interval=poll_interval,
|
|
705
717
|
timeout=timeout,
|
|
706
718
|
on_poll=lambda j: output.info(f" status: {jobs_helpers.job_status(j)}", state.output),
|
|
719
|
+
organization=organization,
|
|
720
|
+
job_email=email,
|
|
707
721
|
)
|
|
708
722
|
output.emit(
|
|
709
723
|
_sanitize_job_output(final),
|
|
@@ -728,6 +742,8 @@ def register(app: typer.Typer) -> None:
|
|
|
728
742
|
wait: bool = typer.Option(False, "--wait", help="Wait for the job to finish first."),
|
|
729
743
|
poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls when --wait."),
|
|
730
744
|
timeout: Optional[float] = typer.Option(None, "--timeout", help="With --wait, give up after N seconds."),
|
|
745
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
746
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
731
747
|
) -> None:
|
|
732
748
|
"""Download results, or explicitly request a credential-bearing URL."""
|
|
733
749
|
state = ctx.obj
|
|
@@ -750,6 +766,8 @@ def register(app: typer.Typer) -> None:
|
|
|
750
766
|
on_poll=lambda j: output.info(
|
|
751
767
|
f" status: {jobs_helpers.job_status(j)}", state.output
|
|
752
768
|
),
|
|
769
|
+
organization=organization,
|
|
770
|
+
job_email=email,
|
|
753
771
|
)
|
|
754
772
|
if _failed_terminal(final):
|
|
755
773
|
result = {
|
|
@@ -762,9 +780,16 @@ def register(app: typer.Typer) -> None:
|
|
|
762
780
|
human=f"{job_name}: {jobs_helpers.job_status(final)}",
|
|
763
781
|
)
|
|
764
782
|
raise typer.Exit(ExitCode.JOB_FAILED)
|
|
783
|
+
owner = jobs_helpers.resolve_owner(
|
|
784
|
+
client, job_name, organization=organization, job_email=email, job=final
|
|
785
|
+
)
|
|
765
786
|
url = _result_url(
|
|
766
787
|
rest.get_result(
|
|
767
|
-
client,
|
|
788
|
+
client,
|
|
789
|
+
job_name=job_name,
|
|
790
|
+
job_email=owner,
|
|
791
|
+
file_name=file,
|
|
792
|
+
pdbs_only=pdbs_only or None,
|
|
768
793
|
)
|
|
769
794
|
)
|
|
770
795
|
result = {"jobName": job_name}
|
|
@@ -73,16 +73,77 @@ def is_success(status: str | None) -> bool:
|
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
def fetch_job(
|
|
76
|
-
client: HTTPClient,
|
|
76
|
+
client: HTTPClient,
|
|
77
|
+
name: str,
|
|
78
|
+
*,
|
|
79
|
+
organization: bool = False,
|
|
80
|
+
job_email: str | None = None,
|
|
81
|
+
timeout: float | None = None,
|
|
77
82
|
) -> dict[str, Any]:
|
|
78
|
-
"""Fetch a single job by name. Raises NotFoundError if it doesn't exist.
|
|
79
|
-
|
|
83
|
+
"""Fetch a single job by name. Raises NotFoundError if it doesn't exist.
|
|
84
|
+
|
|
85
|
+
``organization`` searches every org member visible to the caller and refuses a name that
|
|
86
|
+
several members share; ``job_email`` reads one named member's job.
|
|
87
|
+
"""
|
|
88
|
+
if job_email is not None and not job_email.strip():
|
|
89
|
+
raise ValidationError("Job owner email may not be blank.")
|
|
90
|
+
try:
|
|
91
|
+
resp = rest.get_jobs(
|
|
92
|
+
client, job_name=name, organization=organization, job_email=job_email, timeout=timeout
|
|
93
|
+
)
|
|
94
|
+
except NotFoundError as exc:
|
|
95
|
+
if organization and job_email is None:
|
|
96
|
+
# The org-wide name search skips batch subjobs and pipeline steps.
|
|
97
|
+
exc.message = f"{exc.message} Batch subjobs and pipeline steps need the owner's email."
|
|
98
|
+
raise
|
|
99
|
+
if organization and job_email is None:
|
|
100
|
+
owners = _matching_owners(resp, name)
|
|
101
|
+
if len(owners) > 1:
|
|
102
|
+
# A usage problem, not a transport one: typed so `wait` never reports it as a timeout.
|
|
103
|
+
raise ValidationError(
|
|
104
|
+
f"Job '{name}' matches jobs from {len(owners)} org members "
|
|
105
|
+
f"({', '.join(owners)}); pass the owner's email."
|
|
106
|
+
)
|
|
80
107
|
job = _extract_single(resp, name)
|
|
81
108
|
if job is None:
|
|
82
109
|
raise NotFoundError(f"Job '{name}' not found")
|
|
83
110
|
return job
|
|
84
111
|
|
|
85
112
|
|
|
113
|
+
def _matching_owners(resp: Any, name: str) -> list[str]:
|
|
114
|
+
if not isinstance(resp, dict):
|
|
115
|
+
return []
|
|
116
|
+
rows = resp.get("jobs") if "jobs" in resp else [
|
|
117
|
+
v for k, v in resp.items() if k.isdigit() and isinstance(v, dict)
|
|
118
|
+
]
|
|
119
|
+
return sorted({
|
|
120
|
+
str(r["User"]) for r in rows or [] if job_name(r) == name and r.get("User")
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def resolve_owner(
|
|
125
|
+
client: HTTPClient,
|
|
126
|
+
name: str,
|
|
127
|
+
*,
|
|
128
|
+
organization: bool = False,
|
|
129
|
+
job_email: str | None = None,
|
|
130
|
+
job: dict[str, Any] | None = None,
|
|
131
|
+
) -> str | None:
|
|
132
|
+
"""The stored owner email of another member's job, or None for the caller's own job.
|
|
133
|
+
|
|
134
|
+
Read from the job row because ``/result`` matches the owner exactly and has no
|
|
135
|
+
org-wide mode.
|
|
136
|
+
"""
|
|
137
|
+
if not organization and job_email is None:
|
|
138
|
+
return None
|
|
139
|
+
if job is None:
|
|
140
|
+
job = fetch_job(client, name, organization=organization, job_email=job_email)
|
|
141
|
+
owner = job.get("User") or job_email
|
|
142
|
+
if not owner:
|
|
143
|
+
raise TamarindError(f"Could not resolve the owner of job '{name}'.")
|
|
144
|
+
return str(owner)
|
|
145
|
+
|
|
146
|
+
|
|
86
147
|
def _extract_single(resp: Any, name: str) -> dict[str, Any] | None:
|
|
87
148
|
if not isinstance(resp, dict):
|
|
88
149
|
return None
|
|
@@ -129,6 +190,8 @@ def wait_for_job(
|
|
|
129
190
|
poll_interval: float = 10.0,
|
|
130
191
|
timeout: float | None = None,
|
|
131
192
|
on_poll: Callable[[dict[str, Any]], None] | None = None,
|
|
193
|
+
organization: bool = False,
|
|
194
|
+
job_email: str | None = None,
|
|
132
195
|
) -> dict[str, Any]:
|
|
133
196
|
"""Block until ``name`` reaches a terminal status (or ``timeout`` elapses).
|
|
134
197
|
|
|
@@ -147,7 +210,13 @@ def wait_for_job(
|
|
|
147
210
|
f"Job '{name}'{status_text} after {timeout:.0f}s"
|
|
148
211
|
)
|
|
149
212
|
try:
|
|
150
|
-
job = fetch_job(
|
|
213
|
+
job = fetch_job(
|
|
214
|
+
client,
|
|
215
|
+
name,
|
|
216
|
+
organization=organization,
|
|
217
|
+
job_email=job_email,
|
|
218
|
+
timeout=remaining,
|
|
219
|
+
)
|
|
151
220
|
except TamarindError as exc:
|
|
152
221
|
# Only a generic transport timeout is eligible for deadline
|
|
153
222
|
# translation. Preserve typed API failures (auth, budget, rate
|
|
@@ -162,6 +231,9 @@ def wait_for_job(
|
|
|
162
231
|
f"Job '{name}' did not return status before the {timeout:.0f}s deadline"
|
|
163
232
|
) from exc
|
|
164
233
|
raise
|
|
234
|
+
if organization and job_email is None and job.get("User"):
|
|
235
|
+
# Pin the first match so a same-named job submitted mid-wait can't take over.
|
|
236
|
+
job_email, organization = str(job["User"]), False
|
|
165
237
|
if on_poll is not None:
|
|
166
238
|
on_poll(job)
|
|
167
239
|
last_status = job_status(job)
|
|
@@ -13,7 +13,7 @@ from typing import Any, Callable
|
|
|
13
13
|
|
|
14
14
|
from . import catalog, rest, uploads
|
|
15
15
|
from .http import HTTPClient
|
|
16
|
-
from .jobs import fetch_job, wait_for_job
|
|
16
|
+
from .jobs import fetch_job, resolve_owner, wait_for_job
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class Jobs:
|
|
@@ -50,22 +50,36 @@ class Jobs:
|
|
|
50
50
|
"""List jobs (GET /jobs). Accepts the same filters as :func:`tamarind.rest.get_jobs`."""
|
|
51
51
|
return rest.get_jobs(self._http, **kwargs)
|
|
52
52
|
|
|
53
|
-
def status(
|
|
53
|
+
def status(
|
|
54
|
+
self, name: str, *, organization: bool = False, job_email: str | None = None,
|
|
55
|
+
timeout: float | None = None,
|
|
56
|
+
) -> dict[str, Any]:
|
|
54
57
|
"""Fetch one job by name (raises NotFoundError if absent)."""
|
|
55
|
-
return fetch_job(
|
|
58
|
+
return fetch_job(
|
|
59
|
+
self._http, name, organization=organization, job_email=job_email, timeout=timeout
|
|
60
|
+
)
|
|
56
61
|
|
|
57
62
|
def wait(
|
|
58
63
|
self, name: str, *, poll_interval: float = 10.0, timeout: float | None = None,
|
|
59
64
|
on_poll: Callable[[dict[str, Any]], None] | None = None,
|
|
65
|
+
organization: bool = False, job_email: str | None = None,
|
|
60
66
|
) -> dict[str, Any]:
|
|
61
67
|
"""Block until ``name`` reaches a terminal status; returns the final job."""
|
|
62
|
-
return wait_for_job(
|
|
68
|
+
return wait_for_job(
|
|
69
|
+
self._http, name, poll_interval=poll_interval, timeout=timeout, on_poll=on_poll,
|
|
70
|
+
organization=organization, job_email=job_email,
|
|
71
|
+
)
|
|
63
72
|
|
|
64
73
|
def results(
|
|
65
74
|
self, name: str, *, job_email: str | None = None, file_name: str | None = None,
|
|
66
|
-
pdbs_only: bool | None = None,
|
|
75
|
+
pdbs_only: bool | None = None, organization: bool = False,
|
|
67
76
|
) -> Any:
|
|
68
|
-
"""Get a presigned result URL (POST /result).
|
|
77
|
+
"""Get a presigned result URL (POST /result).
|
|
78
|
+
|
|
79
|
+
``organization`` finds the owner across your org's members first.
|
|
80
|
+
"""
|
|
81
|
+
if organization and job_email is None:
|
|
82
|
+
job_email = resolve_owner(self._http, name, organization=True)
|
|
69
83
|
return rest.get_result(
|
|
70
84
|
self._http, job_name=name, job_email=job_email, file_name=file_name, pdbs_only=pdbs_only,
|
|
71
85
|
)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""`example_settings` must return an example the API will actually accept.
|
|
2
|
+
|
|
3
|
+
The catalog builds `exampleJob.settings` from every parameter's `example`, including ones
|
|
4
|
+
gated behind a `conditionals` controller it does not also set — so the raw blob is rejected
|
|
5
|
+
by /submit-job. These cover the pruning that makes it submittable, against the real boltz
|
|
6
|
+
shape that first surfaced it (the /api-docs/sdk quickstart submitted this verbatim and 400'd
|
|
7
|
+
with `boltz field "ligands" can only be set when addLigands equals true`).
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from tamarind import catalog
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _schema(parameters, settings):
|
|
14
|
+
return {"parameters": parameters, "exampleJob": {"settings": settings}}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_drops_field_whose_controller_is_absent():
|
|
18
|
+
schema = _schema(
|
|
19
|
+
[
|
|
20
|
+
{"name": "sequence"},
|
|
21
|
+
{"name": "addLigands", "default": False},
|
|
22
|
+
{
|
|
23
|
+
"name": "ligands",
|
|
24
|
+
"conditionals": [
|
|
25
|
+
{"checkType": "equals", "otherSettingName": "addLigands", "otherSettingValue": True}
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
{"sequence": "MKT", "ligands": ["SAH"]},
|
|
30
|
+
)
|
|
31
|
+
assert catalog.example_settings(schema) == {"sequence": "MKT"}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_keeps_field_whose_gate_a_default_satisfies():
|
|
35
|
+
# useMSA defaults to true, so msaDatabase is legitimately active even though the
|
|
36
|
+
# example never mentions useMSA. The server validates post-autofill settings too.
|
|
37
|
+
schema = _schema(
|
|
38
|
+
[
|
|
39
|
+
{"name": "useMSA", "default": True},
|
|
40
|
+
{
|
|
41
|
+
"name": "msaDatabase",
|
|
42
|
+
"conditionals": [
|
|
43
|
+
{"checkType": "equals", "otherSettingName": "useMSA", "otherSettingValue": True}
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
{"msaDatabase": "uniref"},
|
|
48
|
+
)
|
|
49
|
+
assert catalog.example_settings(schema) == {"msaDatabase": "uniref"}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_prunes_transitively_to_a_fixed_point():
|
|
53
|
+
# boltz's real chain: version -> predictAffinity -> binderChain. Dropping predictAffinity
|
|
54
|
+
# must also drop binderChain, which a single pass would leave behind.
|
|
55
|
+
schema = _schema(
|
|
56
|
+
[
|
|
57
|
+
{"name": "version", "default": "2.1.0"},
|
|
58
|
+
{
|
|
59
|
+
"name": "predictAffinity",
|
|
60
|
+
"conditionals": [
|
|
61
|
+
{"checkType": "equals", "otherSettingName": "version", "otherSettingValue": "2.2.1"}
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "binderChain",
|
|
66
|
+
"conditionals": [
|
|
67
|
+
{"checkType": "equals", "otherSettingName": "predictAffinity", "otherSettingValue": True}
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
{"predictAffinity": True, "binderChain": "C"},
|
|
72
|
+
)
|
|
73
|
+
assert catalog.example_settings(schema) == {}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def test_supports_the_other_check_types_the_catalog_uses():
|
|
77
|
+
# not-equals and notEmpty both appear in live schemas (proteinmpnn/rfdiffusion
|
|
78
|
+
# verifyTopK, boltzgen scaffoldSubType).
|
|
79
|
+
schema = _schema(
|
|
80
|
+
[
|
|
81
|
+
{"name": "verify", "default": ""},
|
|
82
|
+
{
|
|
83
|
+
"name": "verifyTopK",
|
|
84
|
+
"conditionals": [
|
|
85
|
+
{"checkType": "notEmpty", "otherSettingName": "verify"},
|
|
86
|
+
{"checkType": "not-equals", "otherSettingName": "verify", "otherSettingValue": "none"},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
{"verifyTopK": 5},
|
|
91
|
+
)
|
|
92
|
+
assert catalog.example_settings(schema) == {}
|
|
93
|
+
|
|
94
|
+
schema["exampleJob"]["settings"] = {"verify": "alphafold", "verifyTopK": 5}
|
|
95
|
+
assert catalog.example_settings(schema) == {"verify": "alphafold", "verifyTopK": 5}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def test_unknown_check_type_is_not_a_reason_to_prune():
|
|
99
|
+
# Matches the JS `default:` branch: an unrecognized checkType is skipped, so we keep the
|
|
100
|
+
# field and let the server decide rather than silently dropping a valid one.
|
|
101
|
+
schema = _schema(
|
|
102
|
+
[{"name": "x", "conditionals": [{"checkType": "someNewThing", "otherSettingName": "y"}]}, {"name": "y"}],
|
|
103
|
+
{"x": 1, "y": 2},
|
|
104
|
+
)
|
|
105
|
+
assert catalog.example_settings(schema) == {"x": 1, "y": 2}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_ungated_and_empty_examples_pass_through():
|
|
109
|
+
assert catalog.example_settings({"parameters": [{"name": "a"}], "exampleJob": {"settings": {"a": 1}}}) == {"a": 1}
|
|
110
|
+
assert catalog.example_settings({}) == {}
|