Repository: pyqtgraph/pyqtgraph

Issue:
SciPy in requirements in README but not in install_requires
Hey!
I'm wondering why SciPy is listed as a requirement in README but not in setup.py install_require argument.

Cheers,
Mike


Discussion:
Hi Mike,

Thanks for opening the issue.  The scipy requirement is not a hard requirement, it's only used by some portions of the library, specifically image related component.  I agree we can be more explicit about that in `README.md`, but I'm not of the mindset of changing `setup.py` to reflect this, as there are other dependencies of pyqtgraph that are not covered in `setup.py` (specifically the Qt bindings of your choice).

If you would like to submit a pull request modifying `README.md` to reflect where `scipy` is used, we would be thankful!

Thanks!
`setup.py` includes the ability to have optional dependencies (most often used for dev dependencies, but perhaps we wish to add a way of specifying what scipy enables within pyqtgraph)
We could certainly include `extras_require` field; suppose `pyopengl` would go there as well.

We would need to come up w/ names for these extras that make sense.
Thanks for explanation!
Now I'm not sure if the pull request is still actual as I don't know what is the conclusion.
@MikeFalowski My apologies, I should have been clearer.

I'm good with adding `scipy` to `setup.py` but it should be added to [`extras_require` parameter ](https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies).  In addition, we should add a second key to the `extras_require` dictionary; openGL `{'opengl': ["pyopengl"]}`, as that is also an extra dependency that isn't required for the bulk of the library.

What I don't know is what a good keyword should be for the `extras_require` dictionary containing `scipy`. `image-processing` seems a little lengthy, I'm open to suggestions.  

If you do make this change, I will ask you also make a change this line:

https://github.com/pyqtgraph/pyqtgraph/blob/fd11e1352d9e0b15d67520354bbbf40c615bf996/examples/MultiPlotWidget.py#L7

to `from numpy import random` (which should still work).

Thanks for creating this issue.
My $0.02: I don't really see that much value in adding an entry in `extras_require` for a single package with a somewhat nebulous purpose. That is, `pip install scipy` is an obvious thing to do if you see the error "you need scipy to use ____ function" whereas `pip install pyqtgraph[whatever-name]` is less common and probably less discoverable. I suppose you could argue that it's more correct to list it as some sort of dependency in `setup.py`, but it's in the documentation (should be clarified as optional) and it's already been pointed out that we don't even explicitly depend on Qt bindings. On the other hand, I guess it can't hurt.

Resolving patch:
diff --git a/examples/MultiPlotWidget.py b/examples/MultiPlotWidget.py
--- a/examples/MultiPlotWidget.py
+++ b/examples/MultiPlotWidget.py
@@ -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 @@
 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'}, 


Test patch: