diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 866a822..e3aa284 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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 diff --git a/pori_python/graphkb/util.py b/pori_python/graphkb/util.py index bbc6776..85bfa51 100644 --- a/pori_python/graphkb/util.py +++ b/pori_python/graphkb/util.py @@ -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: @@ -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 diff --git a/pori_python/ipr/main.py b/pori_python/ipr/main.py index 3194779..3a44a6d 100644 --- a/pori_python/ipr/main.py +++ b/pori_python/ipr/main.py @@ -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 @@ -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, diff --git a/pori_python/ipr/summary.py b/pori_python/ipr/summary.py index c6d63b2..558dea1 100644 --- a/pori_python/ipr/summary.py +++ b/pori_python/ipr/summary.py @@ -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"""
{description}.
{variants_text}
-""" - ) +""") sentences_used: Set[str] = set()