Skip to content

Commit

Permalink
Minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Old-Shatterhand committed Apr 3, 2024
1 parent 15e8010 commit b3ac91e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/test_bqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from tests.utils import check_folder, run_sail


@pytest.mark.parametrize("root_dir", [Path("data") / "perf_7_3", Path("data") / "perf_70_30"])
@pytest.mark.parametrize("mode", [("R", "random"), ("I1e", "id_cold_single"), ("I2", "id_cold_double")])
def test_perf_bin_2(root_dir, mode):
# @pytest.mark.parametrize("root_dir", [Path("data") / "perf_7_3", Path("data") / "perf_70_30"])
# @pytest.mark.parametrize("mode", [("R", "random"), ("I1e", "id_cold_single"), ("I2", "id_cold_double")])
def test_perf_bin_2(root_dir=Path("data") / "perf_70_30", mode=("I2", "id_cold_double")):
base = root_dir / mode[1]

run_sail(
Expand All @@ -26,6 +26,6 @@ def test_perf_bin_2(root_dir, mode):
max_sec=500,
)

check_folder(base / mode[0], 0.25, None, None, "Molecule_lig_splits.tsv", "Protein_prot_splits.tsv")
check_folder(base / mode[0], 0.5 if mode[0] == "I2" else 0.05, None, None, "Molecule_lig_splits.tsv", "Protein_prot_splits.tsv")

shutil.rmtree(base / mode[0], ignore_errors=True)
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def check_folder(output_root, epsilon, e_weight, f_weight, e_filename, f_filenam
else:
trains, tests = splits[-1].count("train"), splits[-1].count("test")
train_frac, test_frac = trains / (trains + tests), tests / (trains + tests)
assert 0.7 * (1 - epsilon) <= train_frac <= 0.7 * (1 + epsilon)
assert 0.3 * (1 - epsilon) <= test_frac <= 0.3 * (1 + epsilon)
assert 0.7 * (1 - epsilon) <= train_frac
assert 0.3 * (1 - epsilon) <= test_frac
if n == "I":
break

Expand Down

0 comments on commit b3ac91e

Please sign in to comment.