Skip to content

Debug gallery #132

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

Merged
merged 10 commits into from
May 25, 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
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build docs

on:
pull_request:
branches:
- main

jobs:
build-and-upload:
name: Build & Upload Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: "3.10"

- uses: tlambert03/setup-qt-libs@v1

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[docs]"
- name: Build Docs
uses: aganders3/headless-gui@v1
with:
run: make html
working-directory: ./docs

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build
4 changes: 2 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog

New features
~~~~~~~~~~~~
- Added `MPLWidget` as a widget containing just a Matplotlib canvas
- Added ``MPLWidget`` as a widget containing just a Matplotlib canvas
without any association with a napari viewer.

Visual improvements
Expand All @@ -24,7 +24,7 @@ Changes
- Labels plotting with the features scatter widget no longer have underscores
replaced with spaces.
- ``NapariMPLWidget.update_layers()`` has been removed as it is intended to be
private API. Use `NapariMPLWidget.on_update_layers` instead to implement
private API. Use ``NapariMPLWidget.on_update_layers`` instead to implement
funcitonality when layer selection is changed.

Bug fixes
Expand Down
29 changes: 14 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# import qtgallery
import qtgallery

# -- Project information -----------------------------------------------------

Expand All @@ -30,27 +30,23 @@
extensions = [
"numpydoc",
"sphinx_gallery.gen_gallery",
# "qtgallery",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
"sphinx.ext.intersphinx",
]

sphinx_gallery_conf = {
# Don't run any gallery examples, because they're not working on
# readthedocs at the moment
"filename_pattern": "a^",
# "image_scrapers": (qtgallery.qtscraper,),
# "reset_modules": (qtgallery.reset_qapp,),
"filename_pattern": ".",
"image_scrapers": (qtgallery.qtscraper,),
"reset_modules": (qtgallery.reset_qapp,),
}


# qtgallery_conf = {
# "xvfb_size": (640, 480),
# "xvfb_color_depth": 24,
# "xfvb_use_xauth": False,
# "xfvb_extra_args": [],
# }
qtgallery_conf = {
"xvfb_size": (640, 480),
"xvfb_color_depth": 24,
"xfvb_use_xauth": False,
"xfvb_extra_args": [],
}

numpydoc_show_class_members = False
automodapi_inheritance_diagram = False
Expand All @@ -66,7 +62,10 @@
nitpicky = True
# Can't work out how to link this properley using intersphinx and the PyQT6 docs.
# TODO: fix at some point
nitpick_ignore = [("py:class", "PyQt6.QtWidgets.QWidget")]
nitpick_ignore = [
("py:class", "PyQt6.QtWidgets.QWidget"),
("py:class", "PyQt5.QtWidgets.QWidget"),
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs =
napari[all]
numpydoc
pydata-sphinx-theme
qtgallery
sphinx
sphinx-automodapi
sphinx-gallery
Expand Down
4 changes: 2 additions & 2 deletions src/napari_matplotlib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ class NapariMPLWidget(MPLWidget):
"""
Widget containing a Matplotlib canvas and toolbar.

In addition to `BaseNapariMPLWidget`, this class handles callbacks
In addition to ``BaseNapariMPLWidget``, this class handles callbacks
to automatically update figures when the layer selection or z-step
is changed in the napari viewer. To take advantage of this sub-classes
should implement the ``clear()`` and ``draw()`` methods.

When both the z-step and layer selection is changed, ``clear()`` is called
When both the z-step and layer selection is changed, ``clear()`` is called
and if the number a type of selected layers are valid for the widget
``draw()`` is then called. When layer selection is changed ``on_update_layers()``
is also called, which can be useful e.g. for updating a layer list in a
Expand Down