Declare scipy optional (#1067)

* Replace use of scipy.random with numpy.random

* Update README to reflect scipy being an optional depenency
This commit is contained in:
Ogi Moore 2019-11-12 09:02:08 -08:00 committed by GitHub
parent ec445e7601
commit 2203933393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -22,8 +22,9 @@ Requirements
* PyQt 4.8+, PySide, PyQt5, or PySide2
* python 2.7, or 3.x
* Required
* `numpy`, `scipy`
* `numpy`
* Optional
* `scipy` for image processing
* `pyopengl` for 3D graphics
* macOS with Python2 and Qt4 bindings (PyQt4 or PySide) do not work with 3D OpenGL graphics
* `pyqtgraph.opengl` will be depreciated in a future version and replaced with `VisPy`

View File

@ -3,8 +3,7 @@
## Add path to library (just for examples; you do not need this)
import initExample
from scipy import random
import numpy as np
from numpy import linspace
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
@ -22,7 +21,7 @@ pw = MultiPlotWidget()
mw.setCentralWidget(pw)
mw.show()
data = random.normal(size=(3, 1000)) * np.array([[0.1], [1e-5], [1]])
data = np.random.normal(size=(3, 1000)) * np.array([[0.1], [1e-5], [1]])
ma = MetaArray(data, info=[
{'name': 'Signal', 'cols': [
{'name': 'Col1', 'units': 'V'},