From b32aeb1c29fd89b56d363b0e2b69a0970124d9fb Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sat, 2 Mar 2024 21:21:29 -0800 Subject: [PATCH] doc --- docs/gallery/plot_term_set.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/gallery/plot_term_set.py b/docs/gallery/plot_term_set.py index c1f7c7257..2ff3db784 100644 --- a/docs/gallery/plot_term_set.py +++ b/docs/gallery/plot_term_set.py @@ -129,6 +129,20 @@ data=TermSetWrapper(value=['Homo sapiens'], termset=terms) ) +###################################################### +# Validate Compound Data with TermSetWrapper +# ---------------------------------------------------- +# :py:class:`~hdmf.term_set.TermSetWrapper` can be wrapped around compound data. +# The user will set the field within the compound data type that is to be validated +# with the termset. +c_data = np.array([('Homo sapiens', 24)], dtype=[('species', 'U50'), ('age', 'i4')]) +data = VectorData( + name='species', + description='...', + data=TermSetWrapper(value=c_data, termset=terms, field='species') + ) + + ###################################################### # Validate Attributes with TermSetWrapper # ----------------------------------------------------