Skip to content

Commit

Permalink
Merge branch 'develop' into feat/DEVSU-2349-add-async-and-sync-upload…
Browse files Browse the repository at this point in the history
…-test
  • Loading branch information
elewis2 authored Jul 19, 2024
2 parents 7496216 + b9a1eb5 commit 36b8eda
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pori_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import graphkb, ipr
from . import graphkb, ipr # noqa: F401
12 changes: 4 additions & 8 deletions pori_python/graphkb/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,9 @@ def get_preferred_gene_name(
def get_cancer_predisposition_info(
conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE
) -> Tuple[List[str], Dict[str, str]]:
newval = get_gene_linked_cancer_predisposition_info(conn, source)
genes = newval[0]
allvardata = newval[1]
genes, allvardata = get_gene_linked_cancer_predisposition_info(conn, source)
variants = {key: allvardata[key][0] for key in allvardata.keys()}
return newval[0], variants
return genes, variants


def get_gene_linked_cancer_predisposition_info(
Expand Down Expand Up @@ -322,11 +320,9 @@ def get_gene_linked_cancer_predisposition_info(
def get_pharmacogenomic_info(
conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE
) -> Tuple[List[str], Dict[str, str]]:
newval = get_gene_linked_pharmacogenomic_info(conn, source)
genes = newval[0]
allvardata = newval[1]
genes, allvardata = get_gene_linked_pharmacogenomic_info(conn, source)
variants = {key: allvardata[key][0] for key in allvardata.keys()}
return newval[0], variants
return genes, variants


def get_gene_linked_pharmacogenomic_info(
Expand Down
2 changes: 1 addition & 1 deletion pori_python/graphkb/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry

import hashlib
import json
Expand All @@ -9,6 +8,7 @@
import time
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Union, cast
from urllib3.util.retry import Retry

from .constants import DEFAULT_LIMIT, DEFAULT_URL, TYPES_TO_NOTATION, AA_3to1_MAPPING
from .types import OntologyTerm, ParsedVariant, PositionalVariant, Record
Expand Down
13 changes: 8 additions & 5 deletions tests/test_graphkb/test_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
import pytest
from unittest.mock import Mock

from pori_python.graphkb import statement

from .test_match import ( # noqa - 'F401 imported but unused' is being fooled by pytest conventions
conn,
)
from pori_python.graphkb import GraphKBConnection, statement

EXCLUDE_INTEGRATION_TESTS = os.environ.get("EXCLUDE_INTEGRATION_TESTS") == "1"


@pytest.fixture(scope="module")
def conn() -> GraphKBConnection:
conn = GraphKBConnection()
conn.login(os.environ["GRAPHKB_USER"], os.environ["GRAPHKB_PASS"])
return conn


@pytest.fixture()
def graphkb_conn():
def make_rid_list(*values):
Expand Down

0 comments on commit 36b8eda

Please sign in to comment.