Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TermSet Schema #1151

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@
itself is only one file. When a user loads custom configs, the config is appended/modified.
The modifications are not written to file, avoiding permanent modifications.
"""
# check for TermSet defined within schema
try:
spec = type_map.get_map(self).spec
check_spec = True
except ValueError:
# Class may not be mapped to a data type (test suite)
check_spec = False

if check_spec and 'termset' in spec:
termset_path = spec['termset']

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

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L124

Added line #L124 was not covered by tests

# Check for Loaded configuration
# Note: A loaded configuration should override TermSet defined in the schema
configurator = type_map.type_config

if len(configurator.path)>0:
Expand Down Expand Up @@ -162,9 +175,10 @@
return val

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

termset = TermSet(term_schema_path=termset_path)
val = TermSetWrapper(value=val, termset=termset)
return val

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