From 21dc6bf569cead0a45eafe26e03ebfe0b758d9f0 Mon Sep 17 00:00:00 2001 From: deeenes Date: Thu, 24 Oct 2024 13:54:13 +0200 Subject: [PATCH 1/6] `inputs.ramp`: import `Any` from `typing` --- pypath/inputs/ramp/_sqlite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pypath/inputs/ramp/_sqlite.py b/pypath/inputs/ramp/_sqlite.py index ee0ae40af..360241315 100644 --- a/pypath/inputs/ramp/_sqlite.py +++ b/pypath/inputs/ramp/_sqlite.py @@ -19,7 +19,8 @@ from __future__ import annotations -from collections.abc import Generator, Any +from collections.abc import Generator +from typing import Any import os import sqlite3 From 4e2e40283f3e38cb3074f881e4c8e86b30fbe589 Mon Sep 17 00:00:00 2001 From: deeenes Date: Fri, 25 Oct 2024 11:50:50 +0200 Subject: [PATCH 2/6] `inputs.uniprot.UniprotQuery`: use `extended_timeout`; addresses #290 --- pypath/inputs/uniprot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pypath/inputs/uniprot.py b/pypath/inputs/uniprot.py index e9e27b8f8..07eebb0f9 100644 --- a/pypath/inputs/uniprot.py +++ b/pypath/inputs/uniprot.py @@ -651,6 +651,7 @@ def __iter__(self): silent = False, large = True, compr = 'gz', + slow = True, ) result = c.result if c.result or self.fail_on_empty else [0].__iter__() _ = next(result) From 0b48ad53b3ca538055176582042565bf3bd3024f Mon Sep 17 00:00:00 2001 From: deeenes Date: Fri, 25 Oct 2024 12:06:12 +0200 Subject: [PATCH 3/6] `utils.mapping`: use sqlite based `ramp_id_types` --- pypath/utils/mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypath/utils/mapping.py b/pypath/utils/mapping.py index be24b1eba..6c5562cfd 100644 --- a/pypath/utils/mapping.py +++ b/pypath/utils/mapping.py @@ -126,7 +126,7 @@ dict( **{ it: it - for it in ramp_input.ramp_id_types_2('compound') + for it in ramp_input.ramp_id_types('compound') }, **input_formats.RAMP_MAPPING, ), From ecc2b6ba8adbd3fd1ed7eea34c4c59216e2aacca Mon Sep 17 00:00:00 2001 From: deeenes Date: Fri, 25 Oct 2024 12:12:05 +0200 Subject: [PATCH 4/6] fixed ramp imports for mapping after reorganization of ramp module --- pypath/inputs/ramp/__init__.py | 2 ++ pypath/inputs/ramp/_mapping.py | 4 ++++ pypath/inputs/ramp/_rest.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pypath/inputs/ramp/__init__.py b/pypath/inputs/ramp/__init__.py index 711969b28..fc383bc57 100644 --- a/pypath/inputs/ramp/__init__.py +++ b/pypath/inputs/ramp/__init__.py @@ -24,3 +24,5 @@ """ from ._sqlite import * +from ._rest import * +from ._mapping import * diff --git a/pypath/inputs/ramp/_mapping.py b/pypath/inputs/ramp/_mapping.py index f57326718..043fc196a 100644 --- a/pypath/inputs/ramp/_mapping.py +++ b/pypath/inputs/ramp/_mapping.py @@ -19,6 +19,10 @@ from __future__ import annotations +from ._sqlite import ramp_raw + +__all__ = ['ramp_mapping'] + def ramp_mapping( id_type_a: str, diff --git a/pypath/inputs/ramp/_rest.py b/pypath/inputs/ramp/_rest.py index da0764bbc..ddaaf2de7 100644 --- a/pypath/inputs/ramp/_rest.py +++ b/pypath/inputs/ramp/_rest.py @@ -24,6 +24,9 @@ import pypath.resources.urls as urls import pypath.share.curl as curl +__all__ = ['ramp_id_types'] + + def ramp_id_types( entity_type: Literal['gene', 'compound'] | None = None, ) -> set[str]: From d4a03fcf5258cbfb9f3e1050bec13ddd2d97a815 Mon Sep 17 00:00:00 2001 From: Macabe Daley <37773554+maca8e@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:14:12 +0100 Subject: [PATCH 5/6] corrected index_info msg call to fix single quote confusion --- pypath/formats/sdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypath/formats/sdf.py b/pypath/formats/sdf.py index 40fd19b15..67125d703 100644 --- a/pypath/formats/sdf.py +++ b/pypath/formats/sdf.py @@ -660,7 +660,7 @@ def index_info(self): Prints number of records indexed and name of the source file. """ - msg = f'Indexed {len(self.names['id'])} records from `{self.fname}`.' + msg = f"Indexed {len(self.names['id'])} records from `{self.fname}`." if not self.silent: From 812046b1c4eca0da918cd26270fda86988e4926f Mon Sep 17 00:00:00 2001 From: deeenes Date: Tue, 12 Nov 2024 14:45:13 +0100 Subject: [PATCH 6/6] `inputs.ramp`: missing import of `pandas` --- pypath/inputs/ramp/_mapping.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pypath/inputs/ramp/_mapping.py b/pypath/inputs/ramp/_mapping.py index 043fc196a..58ee9910f 100644 --- a/pypath/inputs/ramp/_mapping.py +++ b/pypath/inputs/ramp/_mapping.py @@ -19,6 +19,8 @@ from __future__ import annotations +import pandas as pd + from ._sqlite import ramp_raw __all__ = ['ramp_mapping']