Skip to content

Commit

Permalink
Address FutureWarning about implicit float to int conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ognyan Moore committed Feb 28, 2020
1 parent 7199a4f commit 6ed8a40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyqtgraph/graphicsItems/AxisItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def generateDrawSpecs(self, p):
p2[axis] += tickLength*tickDir
tickPen = self.pen()
color = tickPen.color()
color.setAlpha(lineAlpha)
color.setAlpha(int(lineAlpha))
tickPen.setColor(color)
tickSpecs.append((tickPen, Point(p1), Point(p2)))
profiler('compute ticks')
Expand Down Expand Up @@ -1078,7 +1078,7 @@ def drawPicture(self, p, axisSpec, tickSpecs, textSpecs):
p.setFont(self.tickFont)
p.setPen(self.textPen())
for rect, flags, text in textSpecs:
p.drawText(rect, flags, text)
p.drawText(rect, flags.__int__(), text)

profiler('draw text')

Expand Down
2 changes: 1 addition & 1 deletion pyqtgraph/graphicsItems/GradientEditorItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def getColor(self, x, toQColor=True):
s = s1 * (1.-f) + s2 * f
v = v1 * (1.-f) + v2 * f
c = QtGui.QColor()
c.setHsv(h,s,v)
c.setHsv(*map(int, [h,s,v]))
if toQColor:
return c
else:
Expand Down
2 changes: 1 addition & 1 deletion pyqtgraph/graphicsItems/GridItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def generatePicture(self):
continue

ppl = dim[ax] / nl[ax]
c = np.clip(5.*(ppl-3), 0., 50.)
c = np.clip(5 * (ppl-3), 0., 50.).astype(int)

linePen = self.opts['pen']
lineColor = self.opts['pen'].color()
Expand Down

0 comments on commit 6ed8a40

Please sign in to comment.