Skip to content

Commit 7362407

Browse files
authored
Merge pull request #603 from FAIRmat-NFDI/fix_list_enums
convert array enums to list before checking
2 parents 9fdbe94 + 25c000e commit 7362407

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pynxtools/nomad/parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ def _populate_data(
225225
attribute = attr_value
226226
# TODO: get unit from attribute <xxx>_units
227227
if isinstance(metainfo_def.type, MEnum):
228-
attribute = str(attr_value)
228+
if isinstance(attr_value, np.ndarray):
229+
attribute = str(attr_value.tolist())
230+
else:
231+
attribute = str(attr_value)
229232
elif not isinstance(attr_value, str):
230233
if isinstance(attr_value, np.ndarray):
231234
attr_list = attr_value.tolist()

0 commit comments

Comments
 (0)