Skip to content

Commit

Permalink
Merge pull request #3140 from t20100/update-doc
Browse files Browse the repository at this point in the history
Update documentation following drop of python<=3.4
  • Loading branch information
vallsv authored Jun 23, 2020
2 parents 94bca13 + d55d39d commit aa9f78d
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 108 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`_::

Expand Down
16 changes: 1 addition & 15 deletions doc/source/modules/gui/plot/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -48,10 +48,6 @@ the way silx loads Qt and the way IPython is doing it through the ``--gui`` opti
`%pylab <http://ipython.org/ipython-doc/stable/interactive/magics.html#magic-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
Expand All @@ -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 <http://ipython.org/ipython-doc/stable/interactive/reference.html#pyqt-and-pyside>`_.


Plot functions
++++++++++++++

Expand Down
7 changes: 0 additions & 7 deletions doc/source/modules/gui/plot/tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
================================

Expand Down
97 changes: 19 additions & 78 deletions doc/source/virtualenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
*******************

Expand All @@ -51,32 +33,33 @@ 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
python3 -m venv /path/to/new/virtual/environment
.. 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
*********************
Expand Down Expand Up @@ -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
Expand All @@ -195,9 +142,3 @@ Run the test suite using:

>>> import silx.test
>>> silx.test.run_tests()






1 change: 1 addition & 0 deletions package/debian10/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Priority: optional
Build-Depends: cython3 (>= 0.23.2),
debhelper (>= 10),
dh-python,
graphviz,
help2man,
ipython3,
ipython3-qtconsole,
Expand Down
1 change: 1 addition & 0 deletions package/debian11/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Build-Depends: cython3 (>= 0.23.2),
cython3-dbg (>= 0.23.2),
debhelper-compat (= 12),
dh-python,
graphviz,
help2man,
ipython3,
pandoc <!nodoc>,
Expand Down
1 change: 1 addition & 0 deletions package/debian9/control
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions silx/gui/plot/backends/BackendMatplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa9f78d

Please sign in to comment.