Skip to content

Commit

Permalink
restructured code
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Sep 13, 2024
1 parent 4a99d82 commit 7f484a6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
8 changes: 5 additions & 3 deletions bedms/attr_standardizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import torch.nn.functional as torch_functional

from .const import (
AVAILABLE_SCHEMAS,
CONFIDENCE_THRESHOLD,
DROPOUT_PROB,
EMBEDDING_SIZE,
Expand All @@ -17,8 +18,8 @@
OUTPUT_SIZE_BEDBASE,
OUTPUT_SIZE_ENCODE,
OUTPUT_SIZE_FAIRTRACKS,
SENTENCE_TRANSFORMER_MODEL,
PROJECT_NAME,
SENTENCE_TRANSFORMER_MODEL,
)
from .model import BoWSTModel
from .utils import (
Expand Down Expand Up @@ -200,7 +201,8 @@ def standardize(
def get_available_schemas() -> list[str]:
"""
Stores a list of available schemas.
:return list: List of available schemas.
"""
schemas = ["ENCODE", "FAIRTRACKS", "BEDBASE"]
return schemas

return AVAILABLE_SCHEMAS
2 changes: 2 additions & 0 deletions bedms/const.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
PROJECT_NAME = "bedmess"

AVAILABLE_SCHEMAS = ["ENCODE", "FAIRTRACKS", "BEDBASE"]

REPO_ID = "databio/attribute-standardizer-model6"
MODEL_ENCODE = "model_encode.pth"
MODEL_FAIRTRACKS = "model_fairtracks.pth"
Expand Down
2 changes: 1 addition & 1 deletion bedms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import peppy
import torch
from huggingface_hub import hf_hub_download
from pephubclient import PEPHubClient

from sentence_transformers import SentenceTransformer
from sklearn.cluster import KMeans
from sklearn.feature_extraction.text import CountVectorizer
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ numpy
torch
sentence-transformers
pephubclient>=0.4.2
peppy>=0.40.5
peppy>=0.40.6
7 changes: 0 additions & 7 deletions tests/test_bedms.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import pytest
from bedms import AttrStandardizer


class TestBEDMES:
def test_bedmes(self):

model = AttrStandardizer("ENCODE")

schemas = model.get_available_schemas()

assert schemas
# results = model.standardize(pep="geo/gse178283:default")
results = model.standardize(pep="geo/gse228634:default")

assert results
12 changes: 0 additions & 12 deletions trial.py

This file was deleted.

0 comments on commit 7f484a6

Please sign in to comment.