Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: move to pydata sphinx theme #3994

Merged
merged 6 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
705 changes: 705 additions & 0 deletions doc/source/_static/navbar_icons/pypi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/source/_templates/version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- This will display the version of the docs -->
{{ version }}
27 changes: 24 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions package/debian12/control
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
2 changes: 1 addition & 1 deletion src/silx/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down
3 changes: 3 additions & 0 deletions src/silx/gui/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down