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

add torch dependency, fix 3dzd embedding test #16

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions training/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
pandas
pillow
keras
torch
scikit-learn
matplotlib
numpy
pandas
pyyaml
kaleido
faiss-cpu
Expand Down
10 changes: 3 additions & 7 deletions training/tests/test_create_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
import re
import tempfile
from pathlib import Path

import pandas as pd
import pytest
from alphafind_training.create_embedding import create_embedding


@pytest.fixture(scope="function")
def output_file():
# Setup: Define the output file path
Expand All @@ -32,17 +30,15 @@ def test_create_embedding():
with tempfile.TemporaryDirectory() as tmpdir:
cif_path = "./data/cifs"
output_path = f"{tmpdir}/embedding.pkl"
granularity = 10

# 45 features for each protein - (10x10 - 10) / 2
expected_dimensionality = 45
expected_dimensionality = 121

create_embedding(Path(cif_path), Path(output_path), granularity)
create_embedding(Path(cif_path), Path(output_path))

assert os.path.exists(output_path)
assert os.path.getsize(output_path) > 0
# load embedding.pkl and check if it has the correct shape
df = pd.read_pickle(output_path)
df = pd.read_parquet(output_path)
assert df.shape[0] == len(os.listdir(cif_path))
assert df.shape[1] == expected_dimensionality

Expand Down
3 changes: 1 addition & 2 deletions training/tests/test_create_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
def _setup(tempdir: str):
create_embedding(
input_path=Path("./data/cifs"),
output_path=Path(f"{tempdir}/embedding.pkl"),
granularity=10
output_path=Path(f"{tempdir}/embedding.pkl")
)


Expand Down
3 changes: 1 addition & 2 deletions training/tests/test_model_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
def _setup(tempdir: str):
create_embedding(
input_path=Path("./data/cifs"),
output_path=Path(f"{tempdir}/embedding.pkl"),
granularity=10
output_path=Path(f"{tempdir}/embedding.pkl")
)

create_kmeans(
Expand Down