Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWE-agent[bot] PR to fix: Batched conditional generation #49

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions tests/models/test_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,21 @@ def test_chroma(chroma):
conditioners.SymmetryConditioner(G="C_3", num_chain_neighbors=1),
],
)
def test_sample(chroma, conditioner):
chroma.sample(steps=3, conditioner=conditioner, design_method=None)
@pytest.mark.parametrize(
"conditioner",
[
conditioners.Identity(),
conditioners.SymmetryConditioner(G="C_3", num_chain_neighbors=1),
],
)
@pytest.mark.parametrize("batch_size", [1, 2, 4])
def test_sample(chroma, conditioner, batch_size):
# Generate a batch of proteins with the specified batch size
proteins = [Protein.from_CIF(PROTEIN_SAMPLE) for _ in range(batch_size)]
# Stack proteins into a batch
protein_batch = Protein.stack(proteins)
# Sample with the specified conditioner and batch of proteins
chroma.sample(steps=3, conditioner=conditioner, protein_batch=protein_batch, design_method=None)


@pytest.mark.parametrize(
Expand Down