Skip to content

Commit 479ed13

Browse files
committed
qwtToPolylineFiltered/tiny optimization: slicing arrays before transforming data
1 parent 2d80fda commit 479ed13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qwt/point_mapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ def qwtToPolylineFiltered(xMap, yMap, series, from_, to, round_,
8787
pointer.setsize(2*polyline.size()*tinfo(dtype).dtype.itemsize)
8888
memory = np.frombuffer(pointer, dtype)
8989
memory[:(to-from_)*2+1:2] =\
90-
round_(xMap.transform(series.xData()))[from_:to+1]
90+
round_(xMap.transform(series.xData()[from_:to+1]))
9191
memory[1:(to-from_)*2+2:2] =\
92-
round_(yMap.transform(series.yData()))[from_:to+1]
92+
round_(yMap.transform(series.yData()[from_:to+1]))
9393
return polyline
9494
# # Pure Python implementation (catastophic performance)
9595
# points = polyline.data()

0 commit comments

Comments
 (0)