Skip to content

Commit

Permalink
Update src/hdmf/container.py
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Ly <[email protected]>
  • Loading branch information
mavaylon1 and rly authored Mar 19, 2024
1 parent 4f617cb commit 08766d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ def _field_config(self, arg_name, val):
warn(msg)
return val
else:
# From the spec, get the corresponding constructor name
constr_name = obj_mapper.get_const_arg(spec)
termset_path = os.path.join(CUR_DIR, config_namespace['data_types'][object_name][constr_name])
termset = TermSet(term_schema_path=termset_path)
# If the val has been manually wrapped then skip checking the config for the attr
if type(val) == TermSetWrapper:
msg = "Field value already wrapped with TermSetWrapper."
warn(msg)
return val
else:
# From the spec, get the corresponding constructor name
constr_name = obj_mapper.get_const_arg(spec)
termset_path = os.path.join(CUR_DIR, config_namespace['data_types'][object_name][constr_name])
termset = TermSet(term_schema_path=termset_path)
val = TermSetWrapper(value=val, termset=termset)
return val

Expand Down

0 comments on commit 08766d3

Please sign in to comment.