Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions pori_python/graphkb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def __init__(
if username and password:
self.login(username=username, password=password)

# URL check
if not self.url:
raise ValueError("URL to a GraphKB API instance is required")

@property
def load(self) -> Optional[float]:
if self.first_request and self.last_request:
Expand Down Expand Up @@ -252,6 +256,7 @@ def login(self, username: str, password: str, pori_demo: bool = False) -> None:

# KBDEV-1328. Alt. GraphKB login for GSC's PORI online demo
if pori_demo or "pori-demo" in self.url:
logger.warning("login demo")
self.login_demo()

# use requests package directly to avoid recursion loop on login failure
Expand Down
17 changes: 7 additions & 10 deletions pori_python/ipr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,13 @@ def ipr_report(
)

# GKB CONNECTION
if graphkb_url:
logger.info(f"connecting to graphkb: {graphkb_url}")
graphkb_conn = GraphKBConnection(graphkb_url)
else:
graphkb_conn = GraphKBConnection()

gkb_user = graphkb_username if graphkb_username else username
gkb_pass = graphkb_password if graphkb_password else password
graphkb_conn = GraphKBConnection(graphkb_url) if graphkb_url else GraphKBConnection()
logger.info(f"connecting to graphkb: {graphkb_conn.url}")

graphkb_conn.login(gkb_user, gkb_pass)
graphkb_conn.login(
graphkb_username if graphkb_username else username,
graphkb_password if graphkb_password else password,
)

# DISEASE
# Disease term from bioapps; expected OncoTree term
Expand Down Expand Up @@ -502,7 +499,7 @@ def ipr_report(

if include_ipr_variant_text:
if not ipr_conn:
raise ValueError("ipr_url required to to include ipr variant text")
raise ValueError("ipr_url required to include ipr variant text")
ipr_comments = get_ipr_analyst_comments(
ipr_conn,
gkb_matches,
Expand Down
6 changes: 2 additions & 4 deletions pori_python/ipr/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,14 @@ def create_section_html(
description = ". ".join(genes[0]["description"].split(". ")[:2]) # type: ignore
sourceId = genes[0].get("sourceId", "")

output.append(
f"""
output.append(f"""
<blockquote class="entrez_description" cite="{ENTREZ_GENE_URL}/{sourceId}">
{description}.
</blockquote>
<p>
{variants_text}
</p>
"""
)
""")

sentences_used: Set[str] = set()

Expand Down
Loading