Skip to content

Commit ff20fba

Browse files
authored
Fix workflow tests that are failing (#410)
This PR updates the tests so that all the examples run and if an example fails then the test results in a failure as well. Changes include: - Reformatting design_macrocyclic_binder.sh and design_macrocyclic_monomer.sh to be submitted correctly by test_diffusion.py - Reducing the total length in design_tetrahedral_oligos.sh to reduce run time of this test - Changes to test_diffusion.py and main.yml to be able to run the examples in different chunks so examples can run in parallel and to make sure that if an example errors out, that the tests does not pass. Currently design_ppi_scaffolded, design_timbarrel, and design_ppi_flexible_peptide_with_secondarystructure_specification are failing which should be addressed in other, future PRs.
2 parents e220924 + dd7643d commit ff20fba

File tree

5 files changed

+278
-105
lines changed

5 files changed

+278
-105
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ jobs:
6969
uv pip install --no-cache-dir -e . --no-deps
7070
rm -rf ~/.cache # /app/RFdiffusion/tests
7171
72+
- name: Preseed DGL backend
73+
shell: bash
74+
run: |
75+
mkdir -p "$HOME/.dgl"
76+
printf '{"backend": "pytorch"}' > "$HOME/.dgl/config.conf"
77+
echo "DGLBACKEND=pytorch" >> "$GITHUB_ENV"
78+
7279
- name: Download weights
7380
run: |
7481
mkdir models
@@ -87,8 +94,29 @@ jobs:
8794
- name: Setup and Run ppi_scaffolds tests
8895
run: |
8996
tar -xvf examples/ppi_scaffolds_subset.tar.gz -C examples
90-
cd tests && uv run python test_diffusion.py
97+
total_chunks=$(nproc)
98+
cd tests
99+
100+
#launch all chunks in background and record PIDs + labels
101+
pids=""
102+
for chunk_index in $(seq 1 $total_chunks); do
103+
echo "Running chunk $chunk_index of $total_chunks"
104+
uv run python test_diffusion.py --total_chunks $total_chunks --chunk_index $chunk_index &
105+
pids="$pids $!"
106+
done
107+
108+
# wait for each and track failures
109+
fail=0
110+
for pid in $pids; do
111+
if ! wait "$pid"; then
112+
echo "A chunk (PID $pid) failed"
113+
fail=1
114+
else
115+
echo "A chunk (PID $pid) passed"
116+
fi
117+
done
91118
119+
exit "$fail"
92120
93121
# - name: Test with pytest
94122
# run: |

examples/design_macrocyclic_binder.sh

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
#!/bin/bash
22

3-
prefix=./outputs/diffused_binder_cyclic2
3+
# Note that in the example below the indices in the
4+
# input_pdbs/7zkr_GABARAP.pdb file have been shifted
5+
# by +2 in chain A relative to pdbID 7zkr.
46

5-
# Note that the indices in this pdb file have been
6-
# shifted by +2 in chain A relative to pdbID 7zkr.
7-
pdb='./input_pdbs/7zkr_GABARAP.pdb'
8-
9-
num_designs=10
10-
script="../scripts/run_inference.py"
11-
$script --config-name base \
12-
inference.output_prefix=$prefix \
13-
inference.num_designs=$num_designs \
7+
../scripts/run_inference.py \
8+
--config-name base \
9+
inference.output_prefix=example_outputs/diffused_binder_cyclic2 \
10+
inference.num_designs=10 \
1411
'contigmap.contigs=[12-18 A3-117/0]' \
15-
inference.input_pdb=$pdb \
12+
inference.input_pdb=./input_pdbs/7zkr_GABARAP.pdb \
1613
inference.cyclic=True \
1714
diffuser.T=50 \
1815
inference.cyc_chains='a' \
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
#!/bin/bash
22

3-
prefix=./outputs/uncond_cycpep
4-
# Note that the indices in this pdb file have been
5-
# shifted by +2 in chain A relative to pdbID 7zkr.
6-
pdb='./input_pdbs/7zkr_GABARAP.pdb'
3+
# Note that in the example below the indices in the
4+
# input_pdbs/7zkr_GABARAP.pdb file have been shifted
5+
# by +2 in chain A relative to pdbID 7zkr.
76

8-
num_designs=10
9-
script="../scripts/run_inference.py"
10-
$script --config-name base \
11-
inference.output_prefix=$prefix \
12-
inference.num_designs=$num_designs \
7+
../scripts/run_inference.py \
8+
--config-name base \
9+
inference.output_prefix=example_outputs/uncond_cycpep \
10+
inference.num_designs=10 \
1311
'contigmap.contigs=[12-18]' \
14-
inference.input_pdb=$pdb \
12+
inference.input_pdb=input_pdbs/7zkr_GABARAP.pdb \
1513
inference.cyclic=True \
1614
diffuser.T=50 \
1715
inference.cyc_chains='a'

examples/design_tetrahedral_oligos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# This external potential promotes contacts both within (with a relative weight of 1) and between chains (relative weight 0.1)
66
# We specify that we want to apply these potentials to all chains, with a guide scale of 2.0 (a sensible starting point)
77
# We decay this potential with quadratic form, so that it is applied more strongly initially
8-
# We specify a total length of 1200aa, so each chain is 100 residues long
8+
# We specify a total length of 1200aa, so each chain is 100 residues long - length updated to 600aa, so each chain is 50 residues long for testing to run faster
99

10-
python ../scripts/run_inference.py --config-name=symmetry inference.symmetry="tetrahedral" inference.num_designs=10 inference.output_prefix="example_outputs/tetrahedral_oligo" 'potentials.guiding_potentials=["type:olig_contacts,weight_intra:1,weight_inter:0.1"]' potentials.olig_intra_all=True potentials.olig_inter_all=True potentials.guide_scale=2.0 potentials.guide_decay="quadratic" 'contigmap.contigs=[1200-1200]'
10+
python ../scripts/run_inference.py --config-name=symmetry inference.symmetry="tetrahedral" inference.num_designs=10 inference.output_prefix="example_outputs/tetrahedral_oligo" 'potentials.guiding_potentials=["type:olig_contacts,weight_intra:1,weight_inter:0.1"]' potentials.olig_intra_all=True potentials.olig_inter_all=True potentials.guide_scale=2.0 potentials.guide_decay="quadratic" 'contigmap.contigs=[600-600]'

0 commit comments

Comments
 (0)