Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit a882721

Browse files
author
ariddell
committed
Handle unsigned integers in data
_split_data now handles unsigned integers (e.g., numpy.uint8) by converting them into integers. Thanks to @tyarkoni for the report and @ahartikainen for the suggested fix. Closes #303
1 parent b003fe4 commit a882721

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pystan/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def _split_data(data):
359359
# map<string, pair<vector<int>, vector<size_t>>> so prepare
360360
# them accordingly.
361361
for k, v in data.items():
362-
if np.issubdtype(np.asarray(v).dtype, int):
362+
if np.issubdtype(np.asarray(v).dtype, np.integer):
363363
data_i.update({k.encode('utf-8'): np.asarray(v, dtype=int)})
364364
elif np.issubdtype(np.asarray(v).dtype, float):
365365
data_r.update({k.encode('utf-8'): np.asarray(v, dtype=float)})

0 commit comments

Comments
 (0)