diff --git a/common/python/nomadcore/parser_backend.py b/common/python/nomadcore/parser_backend.py index a288197a7c795dab4c6fcaa5ac59a831a833af0a..9616be14727716918de8cd5f343b053bec1e02c1 100644 --- a/common/python/nomadcore/parser_backend.py +++ b/common/python/nomadcore/parser_backend.py @@ -8,7 +8,7 @@ from builtins import range from builtins import object import json import numpy as np -import sys +import sys, re def numpyDtypeForDtypeStr(dtypeStr): """returns the numpy dtype given the meta info dtype""" @@ -37,7 +37,7 @@ def valueForStrValue(strValue, dtypeStr): elif dtypeStr[0] == "i": return int(strValue) elif dtypeStr[0] == "b": - return (re.match("\s*(?:no?|\.?f(?:alse)?\.?|0)\s*$", strValue) is None) + return (re.match("\s*(?:[nN][oO]?|\.?[fF](?:[aA][lL][sS][eE])?\.?|0)\s*$", strValue) is None) elif dtypeStr[0] == "B": return strValue # assumed to be base64 encoded elif dtypeStr[0] == "C":