Merge pull request #356 from QuLogic/np-warnings
Fix some NumPy warnings
This commit is contained in:
commit
fc9768be3c
@ -103,6 +103,7 @@ def mkData():
|
|||||||
dt = np.float
|
dt = np.float
|
||||||
loc = 1.0
|
loc = 1.0
|
||||||
scale = 0.1
|
scale = 0.1
|
||||||
|
mx = 1.0
|
||||||
|
|
||||||
if ui.rgbCheck.isChecked():
|
if ui.rgbCheck.isChecked():
|
||||||
data = np.random.normal(size=(frames,width,height,3), loc=loc, scale=scale)
|
data = np.random.normal(size=(frames,width,height,3), loc=loc, scale=scale)
|
||||||
|
@ -59,16 +59,16 @@ class ImageExporter(Exporter):
|
|||||||
self.fileSaveDialog(filter=filter)
|
self.fileSaveDialog(filter=filter)
|
||||||
return
|
return
|
||||||
|
|
||||||
targetRect = QtCore.QRect(0, 0, self.params['width'], self.params['height'])
|
w = int(self.params['width'])
|
||||||
|
h = int(self.params['height'])
|
||||||
|
if w == 0 or h == 0:
|
||||||
|
raise Exception("Cannot export image with size=0 (requested "
|
||||||
|
"export size is %dx%d)" % (w, h))
|
||||||
|
|
||||||
|
targetRect = QtCore.QRect(0, 0, w, h)
|
||||||
sourceRect = self.getSourceRect()
|
sourceRect = self.getSourceRect()
|
||||||
|
|
||||||
|
bg = np.empty((h, w, 4), dtype=np.ubyte)
|
||||||
#self.png = QtGui.QImage(targetRect.size(), QtGui.QImage.Format_ARGB32)
|
|
||||||
#self.png.fill(pyqtgraph.mkColor(self.params['background']))
|
|
||||||
w, h = self.params['width'], self.params['height']
|
|
||||||
if w == 0 or h == 0:
|
|
||||||
raise Exception("Cannot export image with size=0 (requested export size is %dx%d)" % (w,h))
|
|
||||||
bg = np.empty((self.params['height'], self.params['width'], 4), dtype=np.ubyte)
|
|
||||||
color = self.params['background']
|
color = self.params['background']
|
||||||
bg[:,:,0] = color.blue()
|
bg[:,:,0] = color.blue()
|
||||||
bg[:,:,1] = color.green()
|
bg[:,:,1] = color.green()
|
||||||
|
@ -8,7 +8,7 @@ class GLBarGraphItem(GLMeshItem):
|
|||||||
pos is (...,3) array of the bar positions (the corner of each bar)
|
pos is (...,3) array of the bar positions (the corner of each bar)
|
||||||
size is (...,3) array of the sizes of each bar
|
size is (...,3) array of the sizes of each bar
|
||||||
"""
|
"""
|
||||||
nCubes = reduce(lambda a,b: a*b, pos.shape[:-1])
|
nCubes = np.prod(pos.shape[:-1])
|
||||||
cubeVerts = np.mgrid[0:2,0:2,0:2].reshape(3,8).transpose().reshape(1,8,3)
|
cubeVerts = np.mgrid[0:2,0:2,0:2].reshape(3,8).transpose().reshape(1,8,3)
|
||||||
cubeFaces = np.array([
|
cubeFaces = np.array([
|
||||||
[0,1,2], [3,2,1],
|
[0,1,2], [3,2,1],
|
||||||
@ -24,6 +24,3 @@ class GLBarGraphItem(GLMeshItem):
|
|||||||
md = MeshData(verts.reshape(nCubes*8,3), faces.reshape(nCubes*12,3))
|
md = MeshData(verts.reshape(nCubes*8,3), faces.reshape(nCubes*12,3))
|
||||||
|
|
||||||
GLMeshItem.__init__(self, meshdata=md, shader='shaded', smooth=False)
|
GLMeshItem.__init__(self, meshdata=md, shader='shaded', smooth=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user