From eb41dda30d8b8a6c1101f5f8cc5431b9f1dca5e4 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Sat, 8 Feb 2025 00:03:50 -0800 Subject: [PATCH] Fix --- src/hdmf/common/resources.py | 5 +++-- src/hdmf/spec/spec.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hdmf/common/resources.py b/src/hdmf/common/resources.py index 8ada6cf78..e93ccc135 100644 --- a/src/hdmf/common/resources.py +++ b/src/hdmf/common/resources.py @@ -544,7 +544,7 @@ def add_ref_termset(self, **kwargs): if len(missing_terms)>0: return {"missing_terms": missing_terms} - def _validate_object(self, container, attribute, field): + def _validate_object(self, container, attribute, field, file): if attribute is None: # Trivial Case relative_path = '' object_field = self._check_object_field(file=file, @@ -588,6 +588,7 @@ def _validate_object(self, container, attribute, field): container=parent, relative_path=relative_path, field=field) + return object_field @docval({'name': 'container', 'type': (str, AbstractContainer), 'default': None, @@ -676,7 +677,7 @@ def add_ref(self, **kwargs): msg = 'This entity already exists. Ignoring new entity uri' warn(msg, stacklevel=3) - object_field = self._validate_object(container, attribute, field) + object_field = self._validate_object(container, attribute, field, file) ####################################### # Validate Parameters and Populate HERD diff --git a/src/hdmf/spec/spec.py b/src/hdmf/spec/spec.py index 67969181b..cf29c8b0e 100644 --- a/src/hdmf/spec/spec.py +++ b/src/hdmf/spec/spec.py @@ -1056,7 +1056,7 @@ def is_inherited_spec(self, **kwargs): self.__datasets[parent_name].get_attribute(spec_name) is not None): return True else: - if (parent_name in self.__groups and self.is_inherited_group(parent_name) and : + if (parent_name in self.__groups and self.is_inherited_group(parent_name) and self.__groups[parent_name].get_attribute(spec_name) is not None): return True return False