Commit dac7eb58 authored by Antony Lee's avatar Antony Lee
Browse files

Faster import of PyQtGraph.

* RawImageWidget (and thus OpenGL) isn't imported by default anymore.
* scipy.stats.scoreatpercentile is replaced by numpy.percentile.

This commit has not been tested as the example runner is currently
broken.
parent ef2ffdd8
......@@ -178,7 +178,8 @@ def importAll(path, globals, locals, excludes=()):
globals[k] = getattr(mod, k)
importAll('graphicsItems', globals(), locals())
importAll('widgets', globals(), locals(), excludes=['MatplotlibWidget', 'RemoteGraphicsView'])
importAll('widgets', globals(), locals(),
excludes=['MatplotlibWidget', 'RawImageWidget', 'RemoteGraphicsView'])
from .imageview import *
from .WidgetGroup import *
......
......@@ -7,7 +7,6 @@ except:
from scipy.fftpack import fft
import numpy as np
import scipy.stats
from .GraphicsObject import GraphicsObject
import pyqtgraph.functions as fn
from pyqtgraph import debug
......@@ -126,7 +125,7 @@ class PlotCurveItem(GraphicsObject):
else:
mask = np.isfinite(d)
d = d[mask]
b = (scipy.stats.scoreatpercentile(d, 50 - (frac * 50)), scipy.stats.scoreatpercentile(d, 50 + (frac * 50)))
b = np.percentile(d, [50 * (1 - frac), 50 * (1 + frac)])
## adjust for fill level
if ax == 1 and self.opts['fillLevel'] is not None:
......
......@@ -4,7 +4,6 @@ import pyqtgraph.functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import GraphicsObject
import numpy as np
import scipy.stats
import weakref
import pyqtgraph.debug as debug
from pyqtgraph.pgcollections import OrderedDict
......@@ -633,7 +632,7 @@ class ScatterPlotItem(GraphicsObject):
else:
mask = np.isfinite(d)
d = d[mask]
return (scipy.stats.scoreatpercentile(d, 50 - (frac * 50)), scipy.stats.scoreatpercentile(d, 50 + (frac * 50)))
return np.percentile(d, [50 * (1 - frac), 50 * (1 + frac)])
def pixelPadding(self):
return self._maxSpotPxWidth*0.7072
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment