From 0b12e6eee0f94a593e77926abae4bcee60ad67fc Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 7 Mar 2023 16:26:58 -0500 Subject: [PATCH] Speed up validating validating annotations with user fields. --- CHANGELOG.md | 2 ++ .../girder_large_image_annotation/models/annotation.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e374b26ca..94f0524bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Allow ICC correction to specify intent ([#1066](../../pull/1066)) - Make tile sources pickleable ([#1071](../../pull/1071)) - Extract scale information from more bioformats files ([#1074](../../pull/1074)) +- Speed up validating validating annotations with user fields ([#1078](../../pull/1078)) + ### Bug Fixes - The cache could reuse a class inappropriately ([#1070](../../pull/1070)) diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index 7b0439e4b..b3e286a3e 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -1009,6 +1009,8 @@ def _similarElementStructure(self, a, b, parentKey=None): # noqa if k == 'id': if not isinstance(b[k], str) or not self.idRegex.match(b[k]): return False + elif parentKey == 'user': + continue elif parentKey != 'label' or k != 'value': if not self._similarElementStructure(a[k], b[k], k): return False