Merge pull request #10 from chatcannon/fix-numpy-1.12

Fix numpy 1.12 TypeError
This commit is contained in:
Chris Kerr
2017-04-22 13:18:09 +02:00
committed by GitHub
2 changed files with 2 additions and 0 deletions

1
.gitignore vendored
View File

@@ -18,6 +18,7 @@ develop-eggs
lib lib
lib64 lib64
__pycache__ __pycache__
.cache
# Installer logs # Installer logs
pip-log.txt pip-log.txt

View File

@@ -287,6 +287,7 @@ class MPRfile:
n_data_points = np.fromstring(data_module['data'][:4], dtype='<u4') n_data_points = np.fromstring(data_module['data'][:4], dtype='<u4')
n_columns = np.fromstring(data_module['data'][4:5], dtype='u1') n_columns = np.fromstring(data_module['data'][4:5], dtype='u1')
n_columns = np.asscalar(n_columns) # Compatibility with recent numpy
if data_module['version'] == 0: if data_module['version'] == 0:
column_types = np.fromstring(data_module['data'][5:], dtype='u1', column_types = np.fromstring(data_module['data'][5:], dtype='u1',