Skip to content
Snippets Groups Projects
Commit cb3a79c4 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

struct: fix dict conversion of numeric scalars

convert more types to float for easier serialization
parent 67bb7339
No related branches found
No related tags found
No related merge requests found
Pipeline #128917 passed
......@@ -188,7 +188,9 @@ class Struct(object):
except AttributeError:
if array:
v = np.array(v)
elif isinstance(v, int):
# FIXME: there must be a better way to just match all
# numeric scalar types
elif isinstance(v, (int, float, np.int, np.float)):
v = float(v)
d[k] = v
return d
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment