From 26a3b7fe7caf6a746a6cc863d49d7877e6a3f66b Mon Sep 17 00:00:00 2001 From: Eugene Clark Date: Fri, 5 Jan 2024 14:03:47 -0500 Subject: [PATCH 1/4] Return digest from vrs_enref instead of recomputing --- src/anyvar/anyvar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anyvar/anyvar.py b/src/anyvar/anyvar.py index 347b465..3985c0b 100644 --- a/src/anyvar/anyvar.py +++ b/src/anyvar/anyvar.py @@ -83,10 +83,10 @@ def put_object(self, variation_object: VrsObject) -> Optional[str]: :return: Object digest if successful, None otherwise """ try: - v = vrs_enref(variation_object, self.object_store) + id, v = vrs_enref(variation_object, self.object_store, True) except ValueError: return None - return ga4gh_identify(v) + return id def get_object(self, object_id: str, deref: bool = False) -> Optional[VrsObject]: """Retrieve registered variation. From ff96f1bfd8c2f3606edc3a7f525324e5cc62c681 Mon Sep 17 00:00:00 2001 From: Eugene Clark Date: Fri, 5 Jan 2024 14:11:09 -0500 Subject: [PATCH 2/4] Removed unused import --- src/anyvar/anyvar.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/anyvar/anyvar.py b/src/anyvar/anyvar.py index 3985c0b..58f872b 100644 --- a/src/anyvar/anyvar.py +++ b/src/anyvar/anyvar.py @@ -9,7 +9,6 @@ from typing import Optional from urllib.parse import urlparse -from ga4gh.core import ga4gh_identify from ga4gh.vrs import vrs_deref, vrs_enref from anyvar.storage import DEFAULT_STORAGE_URI, _Storage From 5882f3128e190b8faab2f8efebc91f5f84033d0f Mon Sep 17 00:00:00 2001 From: Eugene Clark Date: Mon, 8 Jan 2024 14:55:15 -0500 Subject: [PATCH 3/4] Bump ga4gh.vrs dependency version to 2.0.0a2 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a1917eb..a632279 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ install_requires = fastapi >= 0.95.0 python-multipart uvicorn - ga4gh.vrs[extras] ~= 2.0.0a1 + ga4gh.vrs[extras] ~= 2.0.0a2 psycopg[binary] snowflake-connector-python ~= 3.4.1 From deac73b053faaa56a4006035786ee6f51549da63 Mon Sep 17 00:00:00 2001 From: Eugene Clark Date: Tue, 16 Jan 2024 10:36:28 -0500 Subject: [PATCH 4/4] Change unused var name to "_" Co-authored-by: Kori Kuzma --- src/anyvar/anyvar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anyvar/anyvar.py b/src/anyvar/anyvar.py index 58f872b..f7fbf02 100644 --- a/src/anyvar/anyvar.py +++ b/src/anyvar/anyvar.py @@ -82,7 +82,7 @@ def put_object(self, variation_object: VrsObject) -> Optional[str]: :return: Object digest if successful, None otherwise """ try: - id, v = vrs_enref(variation_object, self.object_store, True) + id, _ = vrs_enref(variation_object, self.object_store, True) except ValueError: return None return id