Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Apr 8, 2024
1 parent ab948e4 commit 6eadab2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ def data_type(self):
"""
Return the spec data type associated with this container.
"""
_type = getattr(self, self._data_type_attr)
return _type
return getattr(self, self._data_type_attr)

def _field_config(self, arg_name, val, type_map):
"""
Expand Down Expand Up @@ -155,14 +154,15 @@ def _field_config(self, arg_name, val, type_map):
mapped_attr_name = obj_mapper.get_attribute(spec)

try:
termset_path = os.path.join(CUR_DIR,
config_namespace['data_types'][data_type][mapped_attr_name]['termset'])
termset = TermSet(term_schema_path=termset_path)
val = TermSetWrapper(value=val, termset=termset)
return val
config_termset_path = config_namespace['data_types'][data_type][mapped_attr_name]['termset']
except KeyError:
return val

Check warning on line 159 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L158-L159

Added lines #L158 - L159 were not covered by tests

termset_path = os.path.join(CUR_DIR, config_termset_path)
termset = TermSet(term_schema_path=termset_path)
val = TermSetWrapper(value=val, termset=termset)
return val

@classmethod
def _getter(cls, field):
"""
Expand Down

0 comments on commit 6eadab2

Please sign in to comment.