Skip to content

Commit 2445c89

Browse files
authored
Python 3.9 compatibility (#266)
1 parent 0e7d9a4 commit 2445c89

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

alphafold3_pytorch/data/weighted_pdb_sampler.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@ def get_chain_count(molecule_type: CLUSTERING_RESIDUE_MOLECULE_TYPE) -> Tuple[in
2525
2626
Example:
2727
n_prot, n_nuc, n_ligand = get_chain_count("protein")
28-
"""
29-
match molecule_type:
30-
case "protein":
31-
return 1, 0, 0
32-
case "rna":
33-
return 0, 1, 0
34-
case "dna":
35-
return 0, 1, 0
36-
case "ligand":
37-
return 0, 0, 1
38-
case "peptide":
39-
return 1, 0, 0
40-
case _:
41-
raise ValueError(f"Unknown molecule type: {molecule_type}")
28+
"""
29+
if molecule_type == "protein":
30+
return 1, 0, 0
31+
if molecule_type == "rna":
32+
return 0, 1, 0
33+
if molecule_type == "dna":
34+
return 0, 1, 0
35+
if molecule_type == "ligand":
36+
return 0, 0, 1
37+
if molecule_type == "peptide":
38+
return 1, 0, 0
39+
40+
raise ValueError(f"Unknown molecule type: {molecule_type}")
4241

4342

4443
def calculate_weight(

0 commit comments

Comments
 (0)