diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 71e95ba..978d571 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.20.0" + ".": "0.20.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 06fd357..2fc2e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.20.1 (2026-12-01) + + +### Features + +* **models:** sample structure ensembles with bioemu2 + ## 0.20.0 (2026-12-01) diff --git a/openprotein/models/__init__.py b/openprotein/models/__init__.py index 873b98a..5451bde 100644 --- a/openprotein/models/__init__.py +++ b/openprotein/models/__init__.py @@ -10,6 +10,8 @@ AlphaFlow, AlphaFlowInput, BioEmu, + BioEmu2, + BioEmu2Input, BioEmuInput, ESMFlow, ESMFlowInput, @@ -87,6 +89,8 @@ "AlphaFlowInput", "AlphaFold2", "BioEmu", + "BioEmu2", + "BioEmu2Input", "BioEmuInput", "Boltz1", "Boltz1x", diff --git a/openprotein/models/ensemble/__init__.py b/openprotein/models/ensemble/__init__.py index 90a5ee9..5137749 100644 --- a/openprotein/models/ensemble/__init__.py +++ b/openprotein/models/ensemble/__init__.py @@ -3,6 +3,7 @@ from .alphaflow import AlphaFlow, AlphaFlowInput from .base import StructureEnsemblePredictionModel from .bioemu import BioEmu, BioEmuInput +from .bioemu2 import BioEmu2, BioEmu2Input from .esmflow import ESMFlow, ESMFlowInput from .gibbs import Gibbs, GibbsInput @@ -10,6 +11,8 @@ "AlphaFlow", "AlphaFlowInput", "BioEmu", + "BioEmu2", + "BioEmu2Input", "BioEmuInput", "ESMFlow", "ESMFlowInput", diff --git a/openprotein/models/ensemble/bioemu2.py b/openprotein/models/ensemble/bioemu2.py new file mode 100644 index 0000000..dd98d93 --- /dev/null +++ b/openprotein/models/ensemble/bioemu2.py @@ -0,0 +1,125 @@ +"""BioEmu2.""" + +from collections.abc import Sequence +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any, Literal + +from openprotein.jobs import futures + +from . import _inputs +from .base import StructureEnsemblePredictionModel + +if TYPE_CHECKING: + from openprotein.align import MSAFuture + from openprotein.data.msa import MSA + from openprotein.molecules import Protein + +__all__ = ["BioEmu2", "BioEmu2Input"] + + +@dataclass(frozen=True) +class BioEmu2Input: + """One BioEmu2 ensemble: a protein chain and, optionally, its MSA. + + Attributes + ---------- + sequence : Protein, str or bytes + The protein chain to sample. + msa : str, MSAFuture, MSA or None + An MSA whose query is ``sequence``. ``None`` or + ``Protein.single_sequence_mode`` samples from the sequence alone. + """ + + sequence: "Protein | str | bytes" + msa: "str | MSAFuture | MSA | type[Protein.NullMSA] | None" + + +class BioEmu2(StructureEnsemblePredictionModel): + """BioEmu2 samples protein ensembles from a sequence and, optionally, its MSA. + + Its checkpoint is ``bioemu2``. + """ + + Input = BioEmu2Input + _default_id = "bioemu2" + + def sample( + self, + inputs: Sequence[BioEmu2Input], + n_samples: int = 1, + mode: Literal["structure", "equilibrium"] = "equilibrium", + num_steps: int = 200, + step_scale: float | None = None, + constraints: list[dict[str, Any]] | None = None, + allow_msa_seed_mismatch: bool = False, + random_seed: int | None = None, + ) -> futures.StructurePredictionFuture: + """Sample one ensemble per input. + + Parameters + ---------- + inputs : sequence of BioEmu2Input + One entry per ensemble. + n_samples : int + Conformations to sample per input. + mode : {"equilibrium", "structure"} + ``equilibrium`` samples the approximate equilibrium ensemble; + ``structure`` predicts a single folded structure. + num_steps : int + Denoising steps per sample, at least 2. + step_scale : float or None + Diffusion step scale. ``None`` uses the mode's default, 1.0 for + ``equilibrium`` and 1.5 for ``structure``. + constraints : list of dict or None + Contacts and bonds in Boltz's shapes, such as + ``{"contact": {"token1": ["A", 10], "token2": ["A", 42]}}``. Each + applies to every input, so every input's chain ``A`` must have the + residues and atoms it names. + allow_msa_seed_mismatch : bool + Sample a sequence against an MSA whose query has the same length + but differs, such as a point mutant against its wild-type MSA. + random_seed : int or None + Random seed. ``None`` lets the model pick its own, so every call + is a fresh sample. + + Returns + ------- + StructurePredictionFuture + One ensemble per input, in input order. + + Examples + -------- + One protein with its MSA: + + >>> bioemu2 = session.models.bioemu2 + >>> future = bioemu2.sample( + ... [bioemu2.Input(sequence=sequence, msa=msa)], + ... n_samples=10, + ... ) + >>> ensembles = future.get() + + Several proteins without an MSA: + + >>> future = bioemu2.sample( + ... [bioemu2.Input(sequence=s, msa=None) for s in sequences], + ... n_samples=10, + ... ) + """ + complexes = [ + _inputs.protein_complex( + _inputs.sequence_text(entry.sequence, f"inputs[{i}].sequence"), + _inputs.msa_id(entry.msa, f"inputs[{i}].msa", required=False), + takes_msa=True, + ) + for i, entry in enumerate(_inputs.input_list(inputs, BioEmu2Input)) + ] + return self._sample( + complexes=complexes, + n_samples=n_samples, + mode=mode, + num_steps=num_steps, + step_scale=step_scale, + constraints=constraints, + allow_msa_seed_mismatch=allow_msa_seed_mismatch, + random_seed=random_seed, + ) diff --git a/openprotein/models/models.py b/openprotein/models/models.py index 17576e7..fc26cff 100644 --- a/openprotein/models/models.py +++ b/openprotein/models/models.py @@ -8,7 +8,7 @@ from openprotein.errors import HTTPError from . import _api, estimators, gp, svd, umap -from .ensemble import AlphaFlow, BioEmu, ESMFlow, Gibbs +from .ensemble import AlphaFlow, BioEmu, BioEmu2, ESMFlow, Gibbs from .fold import ( AlphaFold2, Boltz1, @@ -365,6 +365,11 @@ def bioemu(self) -> BioEmu: """``bioemu-v1-1``.""" return self.bioemu_v1_1 + @property + def bioemu2(self) -> BioEmu2: + """``bioemu2``.""" + return self._handle("bioemu2", BioEmu2) + @property def alphaflow_md_base_v1(self) -> AlphaFlow: """``alphaflow-md-base-v1``.""" diff --git a/tests/data/ensemble_cards.json b/tests/data/ensemble_cards.json index 3258184..f66ba4d 100644 --- a/tests/data/ensemble_cards.json +++ b/tests/data/ensemble_cards.json @@ -77,5 +77,21 @@ "variant": null, "base": true, "max_sequence_length": 1500 + }, + "bioemu2": { + "input_types": [ + "protein", + "dna", + "rna", + "ligand" + ], + "multichain": true, + "tags": [ + "structure", + "fold" + ], + "variant": null, + "base": true, + "max_sequence_length": 1024 } } diff --git a/tests/data/models_params.json b/tests/data/models_params.json index 395a0cd..e1ab7c4 100644 --- a/tests/data/models_params.json +++ b/tests/data/models_params.json @@ -10160,6 +10160,493 @@ ], "type": "object" } + }, + "bioemu2/batch/structures": { + "outputs": [ + "structures", + "physicality" + ], + "params": { + "$defs": { + "Bond": { + "additionalProperties": false, + "properties": { + "atom1": { + "description": "[chain_id, residue_index, atom_name]; ligands use residue 1.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "maxItems": 3, + "minItems": 3, + "type": "array" + }, + "atom2": { + "description": "[chain_id, residue_index, atom_name]; ligands use residue 1.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "maxItems": 3, + "minItems": 3, + "type": "array" + } + }, + "required": [ + "atom1", + "atom2" + ], + "type": "object" + }, + "BondConstraint": { + "additionalProperties": false, + "description": "A covalent bond between two atoms, beyond the standard polymer links.", + "properties": { + "bond": { + "$ref": "#/$defs/Bond" + } + }, + "required": [ + "bond" + ], + "type": "object" + }, + "Chain": { + "additionalProperties": false, + "description": "One entity of a complex, a protein, DNA, RNA or ligand.", + "properties": { + "protein": { + "anyOf": [ + { + "$ref": "#/$defs/Protein" + }, + { + "type": "null" + } + ], + "default": null + }, + "ligand": { + "anyOf": [ + { + "$ref": "#/$defs/Ligand" + }, + { + "type": "null" + } + ], + "default": null + }, + "dna": { + "anyOf": [ + { + "$ref": "#/$defs/DNA" + }, + { + "type": "null" + } + ], + "default": null + }, + "rna": { + "anyOf": [ + { + "$ref": "#/$defs/RNA" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "Contact": { + "additionalProperties": false, + "properties": { + "token1": { + "description": "[chain_id, residue_index] for a residue, [chain_id, atom_name] for a ligand atom, or [chain_id, residue_index, atom_name] for an atom of a modified residue or a standard residue's CA or C1'. Residue indices are 1-based.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "maxItems": 3, + "minItems": 2, + "type": "array" + }, + "token2": { + "description": "[chain_id, residue_index] for a residue, [chain_id, atom_name] for a ligand atom, or [chain_id, residue_index, atom_name] for an atom of a modified residue or a standard residue's CA or C1'. Residue indices are 1-based.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "maxItems": 3, + "minItems": 2, + "type": "array" + }, + "max_distance": { + "default": 6.0, + "description": "The largest distance between the two tokens, in angstroms.", + "maximum": 20.0, + "minimum": 4.0, + "type": "number" + } + }, + "required": [ + "token1", + "token2" + ], + "type": "object" + }, + "ContactConstraint": { + "additionalProperties": false, + "description": "Two tokens held within ``max_distance`` of each other.", + "properties": { + "contact": { + "$ref": "#/$defs/Contact" + } + }, + "required": [ + "contact" + ], + "type": "object" + }, + "DNA": { + "additionalProperties": false, + "description": "DNA chain, with optional residue modifications.", + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "Unique chain identifier(s); a list for identical chains." + }, + "sequence": { + "type": "string" + }, + "modifications": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Modification" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "sequence" + ], + "type": "object" + }, + "Ligand": { + "additionalProperties": false, + "description": "Small-molecule ligand, given as exactly one of SMILES or CCD code.", + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "Unique chain identifier(s); a list for identical chains." + }, + "smiles": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "ccd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "Modification": { + "additionalProperties": false, + "description": "A polymer residue replaced by a CCD component.", + "properties": { + "position": { + "description": "1-based residue position.", + "minimum": 1, + "type": "integer" + }, + "ccd": { + "description": "CCD code of the modified residue, such as TPO.", + "type": "string" + } + }, + "required": [ + "position", + "ccd" + ], + "type": "object" + }, + "Protein": { + "additionalProperties": false, + "description": "Protein chain, with an optional MSA and residue modifications.", + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "Unique chain identifier(s); a list for identical chains." + }, + "sequence": { + "type": "string" + }, + "msa_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "modifications": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Modification" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "sequence" + ], + "type": "object" + }, + "RNA": { + "additionalProperties": false, + "description": "RNA chain, with optional residue modifications. BioEmu2 aligns proteins\nonly, so ``msa_id`` is refused.", + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "Unique chain identifier(s); a list for identical chains." + }, + "sequence": { + "type": "string" + }, + "msa_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "modifications": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Modification" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "sequence" + ], + "type": "object" + } + }, + "additionalProperties": false, + "description": "Complexes to sample and the sampling knobs.", + "properties": { + "complexes": { + "description": "Complexes to sample. Each complex is a list of protein, DNA, RNA and ligand chains. Give every protein in a complex the MSA searched for it, or none for single-sequence mode.", + "items": { + "items": { + "$ref": "#/$defs/Chain" + }, + "type": "array" + }, + "type": "array" + }, + "mode": { + "default": "equilibrium", + "description": "structure predicts a single folded structure; equilibrium samples the approximate equilibrium ensemble.", + "enum": [ + "structure", + "equilibrium" + ], + "type": "string" + }, + "n_samples": { + "default": 1, + "description": "Samples per complex.", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "num_steps": { + "default": 200, + "description": "Denoising steps per sample, at least 2.", + "maximum": 1000, + "minimum": 2, + "type": "integer" + }, + "step_scale": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Diffusion step scale; null for the mode's default, 1.5 in structure mode and 1.0 in equilibrium mode." + }, + "constraints": { + "description": "Contacts and bonds, in boltz's shapes. Each applies to every complex, so every complex must have the chains, residues and atoms it names.", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/ContactConstraint" + }, + { + "$ref": "#/$defs/BondConstraint" + } + ] + }, + "type": "array" + }, + "sampler": { + "const": "edm", + "default": "edm", + "description": "edm: unsteered EDM sampling.", + "type": "string" + }, + "random_seed": { + "anyOf": [ + { + "maximum": 2147483647, + "minimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Random seed; null for a random seed." + }, + "allow_msa_seed_mismatch": { + "default": false, + "description": "Sample a protein against an MSA query of the same length that it does not match, such as a point mutant against its wild-type MSA.", + "type": "boolean" + } + }, + "required": [ + "complexes" + ], + "type": "object" + } } } } diff --git a/tests/models/test_ensemble_examples.py b/tests/models/test_ensemble_examples.py index 1a8318e..a787ec2 100644 --- a/tests/models/test_ensemble_examples.py +++ b/tests/models/test_ensemble_examples.py @@ -6,7 +6,7 @@ from openprotein.align import MSAFuture from openprotein.jobs.futures import StructurePredictionFuture -from openprotein.models import AlphaFlow, BioEmu, ESMFlow, Gibbs, ModelsAPI +from openprotein.models import AlphaFlow, BioEmu, BioEmu2, ESMFlow, Gibbs, ModelsAPI from openprotein.prompt import Prompt MSA_ID = "3f1c2a7e-9b4d-4e2a-8c1f-0d5e6a7b8c9d" @@ -27,6 +27,7 @@ def _example(method) -> str: ("handle", "paths"), [ (BioEmu, ["bioemu-v1-1"] * 2), + (BioEmu2, ["bioemu2"] * 2), (AlphaFlow, ["alphaflow-md-base-v1", "alphaflow-md-distilled-v1"]), (ESMFlow, ["esmflow-md-base-v1", "esmflow-md-distilled-v1"]), (Gibbs, ["esmfold", "gibbs", "gibbs"]), diff --git a/tests/models/test_ensemble_models.py b/tests/models/test_ensemble_models.py index d8292c2..ab6b5d3 100644 --- a/tests/models/test_ensemble_models.py +++ b/tests/models/test_ensemble_models.py @@ -11,6 +11,8 @@ AlphaFlow, AlphaFlowInput, BioEmu, + BioEmu2, + BioEmu2Input, BioEmuInput, ESMFlow, ESMFlowInput, @@ -30,6 +32,7 @@ "esmflow-md-base-v1": ESMFlow, "esmflow-md-distilled-v1": ESMFlow, "gibbs": Gibbs, + "bioemu2": BioEmu2, } IDS = tuple(HANDLES) FLOW_IDS = IDS[1:5] @@ -61,6 +64,15 @@ "random_seed": None, }, Gibbs: {"num_samples": 1, "temperature": 300, "random_seed": None}, + BioEmu2: { + "n_samples": 1, + "mode": "equilibrium", + "num_steps": 200, + "step_scale": None, + "constraints": None, + "allow_msa_seed_mismatch": False, + "random_seed": None, + }, } @@ -75,6 +87,8 @@ def _input(model_id: str, sequence: str = "MKT", reference: Any = None) -> Any: return AlphaFlowInput(sequence, msa=MSA_ID, reference_structure=reference) if model_id.startswith("esmflow-"): return ESMFlowInput(sequence, reference_structure=reference) + if model_id == "bioemu2": + return BioEmu2Input(sequence, msa=MSA_ID) return GibbsInput(JOB_ID, prompt=PROMPT_ID) @@ -99,6 +113,7 @@ def test_ensemble_handles_are_not_structure_prediction_handles(handle): (AlphaFlow, AlphaFlowInput), (ESMFlow, ESMFlowInput), (Gibbs, GibbsInput), + (BioEmu2, BioEmu2Input), ], ) def test_each_handle_names_its_input_type(handle, input_type): @@ -271,6 +286,38 @@ def test_gibbs_requires_a_prompt(models_session): models_session.session.post.assert_not_called() +def test_bioemu2_sends_one_protein_per_input_and_its_controls(models_session): + ModelsAPI(models_session.session).bioemu2.sample( + [ + BioEmu2Input("MKT", msa=MSA_ID), + BioEmu2Input(b"ACDE", msa=Protein.single_sequence_mode), + BioEmu2Input(Protein(sequence="GG"), msa=None), + ], + n_samples=5, + mode="structure", + num_steps=50, + step_scale=1.2, + constraints=[{"contact": {"token1": ["A", 1], "token2": ["A", 2]}}], + allow_msa_seed_mismatch=True, + random_seed=3, + ) + path, body = models_session.submitted + assert path == "v1/models/bioemu2/batch/structures" + assert body == { + "complexes": [ + [{"protein": {"id": "A", "sequence": sequence, "msa_id": msa}}] + for sequence, msa in (("MKT", MSA_ID), ("ACDE", None), ("GG", None)) + ], + "n_samples": 5, + "mode": "structure", + "num_steps": 50, + "step_scale": 1.2, + "constraints": [{"contact": {"token1": ["A", 1], "token2": ["A", 2]}}], + "allow_msa_seed_mismatch": True, + "random_seed": 3, + } + + @pytest.mark.parametrize("seed", [0, 7]) def test_explicit_seed_value_is_sent(models_session, seed): ModelsAPI(models_session.session).bioemu_v1_1.sample( @@ -294,6 +341,7 @@ def test_a_none_seed_is_not_sent(models_session): ("esmflow-md-base-v1", "tmax", 0), ("esmflow-md-distilled-v1", "num_samples", 251), ("gibbs", "temperature", 0), + ("bioemu2", "mode", "unsteered"), ], ) def test_out_of_range_controls_fail_the_card_schema( diff --git a/tests/models/test_ensemble_results.py b/tests/models/test_ensemble_results.py index 2984fa1..2cd4c8d 100644 --- a/tests/models/test_ensemble_results.py +++ b/tests/models/test_ensemble_results.py @@ -10,6 +10,7 @@ from openprotein.jobs.schemas import JobType from openprotein.models import ( AlphaFlowInput, + BioEmu2Input, BioEmuInput, ESMFlowInput, GibbsInput, @@ -25,6 +26,7 @@ "esmflow-md-base-v1", "esmflow-md-distilled-v1", "gibbs", + "bioemu2", ) MSA_ID = "3f1c2a7e-9b4d-4e2a-8c1f-0d5e6a7b8c9d" PROMPT_ID = "5b2d8e4a-1c7f-4a3e-9d6b-2e8f0a1c3b5d" @@ -65,6 +67,9 @@ def _submit(models, model_id, reference): sequence = reference.sequence if model_id == "bioemu-v1-1": entry = BioEmuInput(sequence, msa=MSA_ID) + elif model_id == "bioemu2": + entry = BioEmu2Input(sequence, msa=MSA_ID) + return handle.sample([entry, entry], n_samples=2, random_seed=7) elif model_id.startswith("alphaflow-"): entry = AlphaFlowInput(sequence, msa=MSA_ID) else: diff --git a/tests/models/test_param_signatures.py b/tests/models/test_param_signatures.py index d9134d9..9c0a591 100644 --- a/tests/models/test_param_signatures.py +++ b/tests/models/test_param_signatures.py @@ -32,6 +32,7 @@ ("PoET2", "single-site/scores", "decoder_type"), ("PoET2", "indel/scores", "decoder_type"), ("ProteinMPNN", "generate/sequences", "probabilities_output_mode"), + ("BioEmu2", "batch/structures", "sampler"), } #: verb arguments that are SDK inputs rather than wire params SDK_ARGS = { diff --git a/tests/models/test_static_accessors.py b/tests/models/test_static_accessors.py index 13d4e62..6adf4d0 100644 --- a/tests/models/test_static_accessors.py +++ b/tests/models/test_static_accessors.py @@ -14,6 +14,7 @@ AlphaFlow, AlphaFold2, BioEmu, + BioEmu2, Boltz1, Boltz1x, Boltz2, @@ -78,6 +79,7 @@ "protenix-v2": ProtenixV2, "rosettafold-3": RosettaFold3, "bioemu-v1-1": BioEmu, + "bioemu2": BioEmu2, "alphaflow-md-base-v1": AlphaFlow, "alphaflow-md-distilled-v1": AlphaFlow, "esmflow-md-base-v1": ESMFlow, @@ -126,6 +128,7 @@ ("protenix_v2", "protenix-v2"), ("rosettafold_3", "rosettafold-3"), ("bioemu_v1_1", "bioemu-v1-1"), + ("bioemu2", "bioemu2"), ("alphaflow_md_base_v1", "alphaflow-md-base-v1"), ("alphaflow_md_distilled_v1", "alphaflow-md-distilled-v1"), ("esmflow_md_base_v1", "esmflow-md-base-v1"), diff --git a/tests/models/test_typecheck_coverage.py b/tests/models/test_typecheck_coverage.py index 75e6275..0dec29e 100644 --- a/tests/models/test_typecheck_coverage.py +++ b/tests/models/test_typecheck_coverage.py @@ -34,6 +34,7 @@ ("RosettaFold3", "fold"): "StructurePredictionFuture", ("AlphaFlow", "sample"): "StructurePredictionFuture", ("BioEmu", "sample"): "StructurePredictionFuture", + ("BioEmu2", "sample"): "StructurePredictionFuture", ("ESMFlow", "sample"): "StructurePredictionFuture", ("Gibbs", "sample"): "StructurePredictionFuture", ("_ChainedLanguageModel", "embed"): "EmbeddingFuture", diff --git a/tests/models/typecheck_ensemble_models.py b/tests/models/typecheck_ensemble_models.py index d2de6a5..3739261 100644 --- a/tests/models/typecheck_ensemble_models.py +++ b/tests/models/typecheck_ensemble_models.py @@ -9,6 +9,8 @@ AlphaFlow, AlphaFlowInput, BioEmu, + BioEmu2, + BioEmu2Input, BioEmuInput, ESMFlow, ESMFlowInput, @@ -26,6 +28,7 @@ def accessor_types(models: ModelsAPI) -> None: assert_type(models.esmfold, ESMFold) assert_type(models.bioemu_v1_1, BioEmu) assert_type(models.bioemu, BioEmu) + assert_type(models.bioemu2, BioEmu2) assert_type(models.alphaflow, AlphaFlow) assert_type(models.esmflow, ESMFlow) assert_type(models.alphaflow_md_base_v1, AlphaFlow) @@ -36,9 +39,14 @@ def accessor_types(models: ModelsAPI) -> None: def input_types( - bioemu: BioEmu, alphaflow: AlphaFlow, esmflow: ESMFlow, gibbs: Gibbs + bioemu: BioEmu, + bioemu2: BioEmu2, + alphaflow: AlphaFlow, + esmflow: ESMFlow, + gibbs: Gibbs, ) -> None: assert_type(bioemu.Input, type[BioEmuInput]) + assert_type(bioemu2.Input, type[BioEmu2Input]) assert_type(alphaflow.Input, type[AlphaFlowInput]) assert_type(esmflow.Input, type[ESMFlowInput]) assert_type(gibbs.Input, type[GibbsInput]) diff --git a/tests/models/typecheck_task_futures.py b/tests/models/typecheck_task_futures.py index 50ec356..93d3a08 100644 --- a/tests/models/typecheck_task_futures.py +++ b/tests/models/typecheck_task_futures.py @@ -34,6 +34,7 @@ AlphaFlow, AlphaFold2, BioEmu, + BioEmu2, Boltz1, Boltz1x, Boltz2, @@ -221,6 +222,7 @@ def inverse_folding_types(inverse: ESMIF1, proteinmpnn: ProteinMPNN) -> None: def structure_model_types( bioemu: BioEmu, + bioemu2: BioEmu2, alphaflow: AlphaFlow, esmflow: ESMFlow, gibbs: Gibbs, @@ -229,6 +231,9 @@ def structure_model_types( assert_type( bioemu.sample([bioemu.Input("MKT", msa=None)]), StructurePredictionFuture ) + assert_type( + bioemu2.sample([bioemu2.Input("MKT", msa=None)]), StructurePredictionFuture + ) assert_type( alphaflow.sample([alphaflow.Input("MKT", msa="msa-id")]), StructurePredictionFuture,