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.
This commit is contained in:
parent
ef2ffdd88c
commit
dac7eb5817
@ -178,7 +178,8 @@ def importAll(path, globals, locals, excludes=()):
|
|||||||
globals[k] = getattr(mod, k)
|
globals[k] = getattr(mod, k)
|
||||||
|
|
||||||
importAll('graphicsItems', globals(), locals())
|
importAll('graphicsItems', globals(), locals())
|
||||||
importAll('widgets', globals(), locals(), excludes=['MatplotlibWidget', 'RemoteGraphicsView'])
|
importAll('widgets', globals(), locals(),
|
||||||
|
excludes=['MatplotlibWidget', 'RawImageWidget', 'RemoteGraphicsView'])
|
||||||
|
|
||||||
from .imageview import *
|
from .imageview import *
|
||||||
from .WidgetGroup import *
|
from .WidgetGroup import *
|
||||||
|
@ -7,7 +7,6 @@ except:
|
|||||||
|
|
||||||
from scipy.fftpack import fft
|
from scipy.fftpack import fft
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy.stats
|
|
||||||
from .GraphicsObject import GraphicsObject
|
from .GraphicsObject import GraphicsObject
|
||||||
import pyqtgraph.functions as fn
|
import pyqtgraph.functions as fn
|
||||||
from pyqtgraph import debug
|
from pyqtgraph import debug
|
||||||
@ -126,7 +125,7 @@ class PlotCurveItem(GraphicsObject):
|
|||||||
else:
|
else:
|
||||||
mask = np.isfinite(d)
|
mask = np.isfinite(d)
|
||||||
d = d[mask]
|
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
|
## adjust for fill level
|
||||||
if ax == 1 and self.opts['fillLevel'] is not None:
|
if ax == 1 and self.opts['fillLevel'] is not None:
|
||||||
|
@ -4,7 +4,6 @@ import pyqtgraph.functions as fn
|
|||||||
from .GraphicsItem import GraphicsItem
|
from .GraphicsItem import GraphicsItem
|
||||||
from .GraphicsObject import GraphicsObject
|
from .GraphicsObject import GraphicsObject
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy.stats
|
|
||||||
import weakref
|
import weakref
|
||||||
import pyqtgraph.debug as debug
|
import pyqtgraph.debug as debug
|
||||||
from pyqtgraph.pgcollections import OrderedDict
|
from pyqtgraph.pgcollections import OrderedDict
|
||||||
@ -633,7 +632,7 @@ class ScatterPlotItem(GraphicsObject):
|
|||||||
else:
|
else:
|
||||||
mask = np.isfinite(d)
|
mask = np.isfinite(d)
|
||||||
d = d[mask]
|
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):
|
def pixelPadding(self):
|
||||||
return self._maxSpotPxWidth*0.7072
|
return self._maxSpotPxWidth*0.7072
|
||||||
|
Loading…
x
Reference in New Issue
Block a user