diff --git a/doc/source/_static/navbar_icons/pypi.svg b/doc/source/_static/navbar_icons/pypi.svg new file mode 100644 index 0000000000..095a3f953e --- /dev/null +++ b/doc/source/_static/navbar_icons/pypi.svg @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/_templates/version.html b/doc/source/_templates/version.html new file mode 100644 index 0000000000..1b7d33fd41 --- /dev/null +++ b/doc/source/_templates/version.html @@ -0,0 +1,2 @@ + +{{ version }} \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 94a3ff0a45..d9e74eab42 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -148,12 +148,33 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "default" +html_theme = "pydata_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = { + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/silx-kit/silx", + "icon": "fa-brands fa-github", + }, + { + "name": "PyPI", + "url": "https://pypi.org/project/silx", + "icon": "_static/navbar_icons/pypi.svg", + "type": "local", + }, + ], + "show_toc_level": 1, + "navbar_align": "left", + "show_version_warning_banner": True, + "navbar_start": ["navbar-logo", "version"], + "navbar_center": ["navbar-nav"], + "footer_start": ["copyright"], + "footer_center": ["sphinx-version"], +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -177,7 +198,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = [] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/package/debian12/control b/package/debian12/control index 4979206073..ef9f8f0094 100644 --- a/package/debian12/control +++ b/package/debian12/control @@ -22,6 +22,7 @@ Build-Depends: cython3 (>= 0.23.2), python3-opengl, python3-packaging, python3-pil, + python3-pydata-sphinx-theme, python3-pyopencl, python3-pyqt5.qtopengl, python3-pyqt5.qtsvg, diff --git a/requirements-dev.txt b/requirements-dev.txt index 099aa8824c..6df5c23066 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,6 +7,7 @@ wheel # To build wheels Sphinx # To build the documentation in doc/ sphinx-autodoc-typehints # For leveraging Python type hints from Sphinx pillow # For loading images in documentation generation +pydata_sphinx_theme # Sphinx theme nbsphinx # For converting ipynb in documentation pandoc # For documentation Qt snapshot updates black[jupyter] # Formatting diff --git a/setup.py b/setup.py index b7fa5a9a2c..f7ade30f84 100644 --- a/setup.py +++ b/setup.py @@ -196,8 +196,18 @@ def get_project_configuration(): test_requires = ["pytest", "pytest-xvfb", "pytest-mock", "bitshuffle"] + doc_requires = { + "nbsphinx", + "pandoc", + "pillow", + "pydata_sphinx_theme", + "sphinx", + "sphinx-autodoc-typehints", + } + extras_require = { "full": full_requires, + "doc": doc_requires, "test": test_requires, } diff --git a/src/silx/_version.py b/src/silx/_version.py index 206a434c10..978d6a46d7 100644 --- a/src/silx/_version.py +++ b/src/silx/_version.py @@ -51,7 +51,7 @@ __authors__ = ["Jérôme Kieffer"] __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "30/09/2020" +__date__ = "12/12/2023" __status__ = "production" __docformat__ = "restructuredtext" __all__ = [ diff --git a/src/silx/gui/utils/image.py b/src/silx/gui/utils/image.py index c4116b30a6..b9ab7c357b 100644 --- a/src/silx/gui/utils/image.py +++ b/src/silx/gui/utils/image.py @@ -81,16 +81,19 @@ def convertQImageToArray(image: qt.QImage) -> numpy.ndarray: """Convert a QImage to a numpy array. If QImage format is not one of: + - Format_Grayscale8 - Format_RGB888 - Format_RGBA8888 - Format_ARGB32, + it is first converted to one of this format. The created numpy array is using a copy of the QImage data. :param QImage image: The QImage to convert. :return: Image array of uint8 of shape: + - (height, width) for grayscale images - (height, width, channels (3 or 4)) for RGB and RGBA images """