Skip to content
Snippets Groups Projects
Commit bd5776cd authored by Pardini, Lorenzo (lopa)'s avatar Pardini, Lorenzo (lopa)
Browse files

fixing converions of booleans

parent 79ef1b1a
Branches
Tags
No related merge requests found
......@@ -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":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment