From 4aa02d0c927afe4414c6dce874c0439a359d0400 Mon Sep 17 00:00:00 2001 From: David Michaels Date: Thu, 7 Mar 2024 13:09:33 -0500 Subject: [PATCH] update dcicutils --- dcicutils/structured_data.py | 10 ++++++++++ pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dcicutils/structured_data.py b/dcicutils/structured_data.py index 82baf7b55..c6a3787fe 100644 --- a/dcicutils/structured_data.py +++ b/dcicutils/structured_data.py @@ -303,6 +303,10 @@ def ref_lookup_notfound_count(self) -> int: def ref_lookup_error_count(self) -> int: return self.portal.ref_lookup_error_count if self.portal else -1 + @property + def ref_exists_internal_count(self) -> int: + return self.portal.ref_exists_internal_count if self.portal else -1 + @property def ref_exists_cache_hit_count(self) -> int: return self.portal.ref_exists_cache_hit_count if self.portal else -1 @@ -716,6 +720,7 @@ def __init__(self, self._ref_lookup_found_count = 0 self._ref_lookup_notfound_count = 0 self._ref_lookup_error_count = 0 + self._ref_exists_internal_count = 0 self._ref_exists_cache_hit_count = 0 self._ref_exists_cache_miss_count = 0 @@ -829,6 +834,7 @@ def _ref_exists_single(self, type_name: str, value: str, root: bool = False) -> for item in items: if (ivalue := next((item[iproperty] for iproperty in iproperties if iproperty in item), None)): if isinstance(ivalue, list) and value in ivalue or ivalue == value: + self._ref_exists_internal_count += 1 return True, (ivalue if isinstance(ivalue, str) and is_uuid(ivalue) else None) if (value := self.get_metadata(f"/{type_name}/{value}" if not root else f"/{value}")) is None: return False, None @@ -860,6 +866,10 @@ def ref_lookup_notfound_count(self) -> int: def ref_lookup_error_count(self) -> int: return self._ref_lookup_error_count + @property + def ref_exists_internal_count(self) -> int: + return self._ref_exists_internal_count + @property def ref_exists_cache_hit_count(self) -> int: return self._ref_exists_cache_hit_count diff --git a/pyproject.toml b/pyproject.toml index 885df0453..f5b38a21b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dcicutils" -version = "8.8.0.1b3" # TODO: To become 8.8.1 +version = "8.8.0.1b4" # TODO: To become 8.8.1 description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources" authors = ["4DN-DCIC Team "] license = "MIT"