Skip to content

Commit

Permalink
minor code and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Oct 17, 2023
1 parent 23692f9 commit 45b538c
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
pytest:
strategy:
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
os: [ubuntu-latest] # can't use macOS when using service containers or container jobs
runs-on: ${{ matrix.os }}
services:
Expand Down
2 changes: 1 addition & 1 deletion bbconf/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0a5"
__version__ = "0.4.0"
12 changes: 8 additions & 4 deletions bbconf/bbconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
CFG_QDRANT_HOST_KEY,
CFG_QDRANT_COLLECTION_NAME_KEY,
DEFAULT_HF_MODEL,
DEFAULT_VEC2VEC_MODEL,
)
from bbconf.exceptions import MissingConfigDataError, BedBaseConfError
from bbconf.helpers import raise_missing_key, get_bedbase_cfg
Expand Down Expand Up @@ -106,9 +107,10 @@ def __init__(self, config_path: str = None, database_only: bool = False):
f"{CFG_PATH_REGION2VEC_KEY} was not provided in config file!"
)
if not self.config[CFG_PATH_KEY].get(CFG_PATH_VEC2VEC_KEY):
_LOGGER.error(
f"{CFG_PATH_VEC2VEC_KEY} was not provided in config file!"
)
self.config[CFG_PATH_KEY][
CFG_PATH_VEC2VEC_KEY
] = DEFAULT_VEC2VEC_MODEL

except qdrant_client.http.exceptions.ResponseHandlingException as err:
_LOGGER.error(f"error in Connection to qdrant! skipping... Error: {err}")

Expand Down Expand Up @@ -156,7 +158,9 @@ def _read_config_file(self, config_path: str) -> yacman.YAMLConfigManager:

def search_bed_by_text(
self, query: str
) -> List[Dict[str, Union[int, float, Dict[str, str], List[float]]]]:
) -> Tuple[
Union[List[int], List[List[int]]], Union[List[float], List[List[float]]]
]:
"""
Search for bed files by text query in the qdrant database
Expand Down
1 change: 1 addition & 0 deletions bbconf/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@
}

DEFAULT_HF_MODEL = "sentence-transformers/all-MiniLM-L12-v2"
DEFAULT_VEC2VEC_MODEL = "databio/v2v-ChIP-atlas-hg38-ATAC"
4 changes: 3 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.3.0a1] - 2023-08-02
## [0.4.0] - 2023-10-17
### Change
- bbconf to use pipestat v0.4.1 and SQLModel
- Added qdrant search, and insert methods
- Fixed tests

## [0.3.0] - 2022-08-18
### Change
Expand Down
Empty file removed interactive_testing.py
Empty file.
6 changes: 3 additions & 3 deletions requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
logmuse
yacman>=0.9.1
#pipestat>=0.6.0a1
pipestat @ git+https://github.com/pepkit/pipestat@dev#egg=pipestat
pipestat>=0.6.0a2
#pipestat @ git+https://github.com/pepkit/pipestat@dev#egg=pipestat
sqlalchemy<2.0.0
qdrant_client
# geniml
# geniml
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
keywords="",
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
@pytest.fixture
def test_data_bed():
s = "test_string"
return {"bedfile_name": s, "bedfile": {"path": s, "title": s}, "regions_no": 1}
return {"name": s, "bedfile": {"path": s, "title": s}, "regions_no": 1}


@pytest.fixture
def test_data_bedset():
s = "test_string"
return {"bedset_name": s, "bedset_tar_archive_path": {"path": s, "title": s}}
return {"name": s, "bedset_tar_archive_path": {"path": s, "title": s}}


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bbconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

from bbconf import BedBaseConf, get_bedbase_cfg
from bbconf.exceptions import *
from sqlmodel import Session, SQLModel, create_engine
from sqlmodel import SQLModel, create_engine
from sqlmodel.main import default_registry


DB_URL = "postgresql+psycopg2://postgres:docker@127.0.0.1:5432/pep-db"
DB_URL = "postgresql+psycopg2://postgres:dockerpassword@127.0.0.1:5432/pipestat-test"


class ContextManagerDBTesting:
Expand Down

0 comments on commit 45b538c

Please sign in to comment.