remote legacy work-around for old numpy errors (#1046)
* remote legacy work-around for old numpy errors * forgot to remove the numpy_fix import * require numyp >= 1.8.0
This commit is contained in:
parent
3ae58a065e
commit
aa3a5d3995
@ -29,9 +29,6 @@ if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1]
|
||||
## helpers for 2/3 compatibility
|
||||
from . import python2_3
|
||||
|
||||
## install workarounds for numpy bugs
|
||||
from . import numpy_fix
|
||||
|
||||
## in general openGL is poorly supported with Qt+GraphicsView.
|
||||
## we only enable it where the performance benefit is critical.
|
||||
## Note this only applies to 2D graphics; 3D graphics always use OpenGL.
|
||||
|
@ -1,22 +0,0 @@
|
||||
try:
|
||||
import numpy as np
|
||||
|
||||
## Wrap np.concatenate to catch and avoid a segmentation fault bug
|
||||
## (numpy trac issue #2084)
|
||||
if not hasattr(np, 'concatenate_orig'):
|
||||
np.concatenate_orig = np.concatenate
|
||||
def concatenate(vals, *args, **kwds):
|
||||
"""Wrapper around numpy.concatenate (see pyqtgraph/numpy_fix.py)"""
|
||||
dtypes = [getattr(v, 'dtype', None) for v in vals]
|
||||
names = [getattr(dt, 'names', None) for dt in dtypes]
|
||||
if len(dtypes) < 2 or all([n is None for n in names]):
|
||||
return np.concatenate_orig(vals, *args, **kwds)
|
||||
if any([dt != dtypes[0] for dt in dtypes[1:]]):
|
||||
raise TypeError("Cannot concatenate structured arrays of different dtype.")
|
||||
return np.concatenate_orig(vals, *args, **kwds)
|
||||
|
||||
np.concatenate = concatenate
|
||||
|
||||
except ImportError:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user