diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 889595ed71..c4deea0d97 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -60,10 +60,10 @@ This version drops the support of Python 2.7 and Python <= 3.4. * Limit `silxGlobalThreadPool` function to use 4 threads maximum (PR #3072) * `silx.gui.utils.glutils`: Added `isOpenGLAvailable` to check the availability of OpenGL (PR #2878) - * `silx.gui.widgets: + * `silx.gui.widgets`: * Added `ElidedLabel` widget (PR #3110, #3111) - * Fixed `LegendIconWidget (PR #3112) + * Fixed `LegendIconWidget` (PR #3112) * `silx.io`: @@ -85,7 +85,7 @@ This version drops the support of Python 2.7 and Python <= 3.4. * Build, documentation and tests: - * Dropped Python2 support (PR #3119) and removed Python 2 tests and packaging (PR #2838, #2917) + * Dropped Python2 support (PR #3119, #3140) and removed Python 2 tests and packaging (PR #2838, #2917) * Added debian 11/Ubuntu 20.04 packaging (PR #2875) * Improved test environment (PR #2870, #2949, #2995, #3009, #3061, #3086, #3087, #3122), documentation (PR #2872, #2894, #2937, #2987, #3042, #3053, #3068, #3091, #3103, #3115) and sample code (PR #2978, #3130, #3138) * Fixed Windows "fat binary" build (PR #2971) diff --git a/doc/source/install.rst b/doc/source/install.rst index 8e5220bce2..8ed5136fd2 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -10,11 +10,11 @@ This table summarizes the support matrix of silx: +------------+--------------+---------------------+ | System | Python vers. | Qt and its bindings | +------------+--------------+---------------------+ -| `Windows`_ | 3.5, 3.6-3.7 | PyQt5.6+, PySide2 | +| `Windows`_ | 3.5-3.8 | PyQt5.6+, PySide2 | +------------+--------------+---------------------+ -| `MacOS`_ | 2.7, 3.5-3.7 | PyQt5.6+, PySide2 | +| `MacOS`_ | 3.5-3.8 | PyQt5.6+, PySide2 | +------------+--------------+---------------------+ -| `Linux`_ | 2.7, 3.4-3.7 | PyQt5.3+, PySide2 | +| `Linux`_ | 3.5-3.8 | PyQt5.3+, PySide2 | +------------+--------------+---------------------+ For the description of *silx* dependencies, see the Dependencies_ section. @@ -211,8 +211,8 @@ prompt. MacOS ----- -While Apple ships Python 2.7 by default on their operating systems, we recommend -using Python 3.5 or newer to ease the installation of the Qt library. +Apple ships Python 2.7 by default on their operating systems. +You must install Python 3.5 or newer to install silx. Then, install *silx* with ``pip``, see `Installing with pip`_:: diff --git a/doc/source/modules/gui/plot/getting_started.rst b/doc/source/modules/gui/plot/getting_started.rst index 899d26295d..c105395993 100644 --- a/doc/source/modules/gui/plot/getting_started.rst +++ b/doc/source/modules/gui/plot/getting_started.rst @@ -20,7 +20,7 @@ For a complete description of the API, see :mod:`silx.gui.plot`. Use :mod:`silx.gui.plot` from (I)Python console ----------------------------------------------- -We recommend to use (I)Python 3.x and PyQt5. +We recommend to use (I)Python >=3.5 and PyQt5. From a Python or IPython interpreter, the simplest way is to import the :mod:`silx.sx` module: @@ -48,10 +48,6 @@ the way silx loads Qt and the way IPython is doing it through the ``--gui`` opti `%pylab `_ magics. In this case, IPython magics that initialize Qt might not work after importing modules from silx.gui. -When using Python2.7 and PyQt4, there is another incompatibility to deal with as -silx requires PyQt4 API version 2 (See note below for explanation). -In this case, start IPython with the ``QT_API`` environment variable set to ``pyqt``. - On Linux and MacOS X, run from the command line:: QT_API=pyqt ipython @@ -61,16 +57,6 @@ On Windows, run from the command line:: set QT_API=pyqt&&ipython -.. note:: PyQt4 used from Python 2.x provides 2 incompatible versions of QString and QVariant: - - - version 1, the legacy version which is also the default, and - - version 2, a more pythonic one, which is the only one supported by *silx*. - - All other configurations (i.e., PyQt4 on Python 3.x, PySide2, PyQt5, IPython QtConsole widget) uses version 2. - - For more information, see `IPython, PyQt and PySide `_. - - Plot functions ++++++++++++++ diff --git a/doc/source/modules/gui/plot/tools/index.rst b/doc/source/modules/gui/plot/tools/index.rst index 18c496e37c..c75aea5d94 100644 --- a/doc/source/modules/gui/plot/tools/index.rst +++ b/doc/source/modules/gui/plot/tools/index.rst @@ -104,13 +104,6 @@ Other tools API .. autoclass:: RegionOfInterestTableWidget :members: -:mod:`~silx.gui.plot.tools.profile`: Profile Tools --------------------------------------------------- - -.. automodule:: silx.gui.plot.tools.profile - -.. currentmodule:: silx.gui.plot.tools.profile - :mod:`ColorBar`: ColorBar Widget ================================ diff --git a/doc/source/virtualenv.rst b/doc/source/virtualenv.rst index 3d866172b4..ccdd9b6598 100644 --- a/doc/source/virtualenv.rst +++ b/doc/source/virtualenv.rst @@ -12,30 +12,12 @@ Prerequisites This guide assumes that your system meets the following requirements: - - a version of python compatible with *silx* is installed (python 2.7 or python >= 3.5) + - a version of python compatible with *silx* is installed (Python >= 3.5) - the *pip* installer for python packages is installed - - the Qt and PyQt libraries are installed (optional, required for using ``silx.gui``) Installation procedure ---------------------- - -Install vitrualenv -****************** - -.. code-block:: bash - - pip install virtualenv --user - -.. note:: - - This step is not required for recent version of Python 3. - Virtual environments are created using a builtin standard library, - ``venv``. - On Debian platforms, you might need to install the ``python3-venv`` - package. - - Create a virtualenv ******************* @@ -51,20 +33,12 @@ a virtual environment named ``silx_venv`` cd mkdir -p venvs cd venvs - virtualenv silx_venv - + python -m venv silx_venv A virtualenv contains a copy of your default python interpreter with a few tools to install packages (pip, setuptools). -To use a different python interpreter, you can specify it on the command line. -For example, to use python 3.4: - -.. code-block:: bash - - virtualenv -p /usr/bin/python3.4 silx_venv - -But for python 3 you should use the builtin ``venv`` module: +Virtual environments are created using a builtin standard library, ``venv`` (Python3 only): .. code-block:: bash @@ -72,11 +46,20 @@ But for python 3 you should use the builtin ``venv`` module: .. note:: + On Debian platforms, you might need to install the ``python3-venv`` package. + If you don't need to start with a clean environment and you don't want to install each required library one by one, you can use a command line option to create a virtualenv with access to all system packages: ``--system-site-packages`` +To use a different python interpreter, use it to create the virtual environment. +For example, to use python 3.5: + +.. code-block:: bash + + /usr/bin/python3.5 -m venv silx_venv + Activate a virtualenv ********************* @@ -128,64 +111,28 @@ install *silx*: .. since 0.5, numpy is now automatically installed when doing `pip install silx` -Install optional dependencies -***************************** - -The following command installs libraries that are needed by various modules -of *silx*: - -.. code-block:: bash - - pip install matplotlib fabio h5py - -The next command installs libraries that are used by the python modules -handling parallel computing: - -.. code-block:: bash - - pip install pyopencl mako - - -Install pyqt +Install silx ************ -If your python version is 3.5 or newer, installing PyQt5 and all required packages -is as simple as typing: - -.. code-block:: bash - - pip install PyQt5 - -For previous versions of python, there are no PyQt wheels available, so the installation -is not as simple. - -The simplest way, assuming that PyQt is installed on your system, is to use that -system package directly. For this, you need to add a symbolic link to your virtualenv. - -If you want to use PyQt5 installed in ``/usr/lib/python2.7/dist-packages/``, type: +To install silx with minimal dependencies, run: .. code-block:: bash - ln -s /usr/lib/python2.7/dist-packages/PyQt5 silx_venv/lib/python2.7/site-packages/ - ln -s /usr/lib/python2.7/dist-packages/sip.so silx_venv/lib/python2.7/site-packages/ - + pip install silx -Install silx -************ +To install silx with all dependencies, run: .. code-block:: bash - pip install silx - + pip install silx[full] -To test *silx*, open an interactive python console. If you managed to install PyQt5 or PySide2 -in your virtualenv, type: +To test *silx*, open an interactive python console: .. code-block:: bash python -If you don't have PyQt, use: +If you don't have PyQt5 or PySide2, run: .. code-block:: bash @@ -195,9 +142,3 @@ Run the test suite using: >>> import silx.test >>> silx.test.run_tests() - - - - - - diff --git a/package/debian10/control b/package/debian10/control index d5f60d34bb..e98ce65223 100644 --- a/package/debian10/control +++ b/package/debian10/control @@ -8,6 +8,7 @@ Priority: optional Build-Depends: cython3 (>= 0.23.2), debhelper (>= 10), dh-python, + graphviz, help2man, ipython3, ipython3-qtconsole, diff --git a/package/debian11/control b/package/debian11/control index de63fa8431..f2791e7e98 100644 --- a/package/debian11/control +++ b/package/debian11/control @@ -9,6 +9,7 @@ Build-Depends: cython3 (>= 0.23.2), cython3-dbg (>= 0.23.2), debhelper-compat (= 12), dh-python, + graphviz, help2man, ipython3, pandoc , diff --git a/package/debian9/control b/package/debian9/control index 6919bef7b9..169e9b5098 100644 --- a/package/debian9/control +++ b/package/debian9/control @@ -8,6 +8,7 @@ Build-Depends: cython3, libstdc++-4.9-dev|libstdc++6, debhelper (>=9.20150101+deb8u2), dh-python, + graphviz, python3-all-dev, python3-numpy, python3-fabio, diff --git a/silx/gui/plot/backends/BackendMatplotlib.py b/silx/gui/plot/backends/BackendMatplotlib.py index 42e85c1d36..036e630952 100755 --- a/silx/gui/plot/backends/BackendMatplotlib.py +++ b/silx/gui/plot/backends/BackendMatplotlib.py @@ -450,6 +450,7 @@ def contains(self, mouseevent): return inside, info def set_data(self, A): + """Overridden to add a fast path for RGBA unit8 images""" A = numpy.array(A, copy=False) if A.ndim != 3 or A.shape[2] != 4 or A.dtype != numpy.uint8: super(Image, self).set_data(A)