Skip to content

Commit 94b4b72

Browse files
committed
Merge branch 'main' into add-feature-histogram
2 parents 91f6d16 + 76dd23b commit 94b4b72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1090
-330
lines changed

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-upload:
10+
name: Build & Upload Artifact
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- uses: actions/setup-python@v3
16+
with:
17+
python-version: "3.10"
18+
19+
- uses: tlambert03/setup-qt-libs@v1
20+
21+
- name: Install Dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install ".[docs]"
25+
- name: Build Docs
26+
uses: aganders3/headless-gui@v1
27+
with:
28+
run: make html
29+
working-directory: ./docs
30+
31+
- name: Upload artifact
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: docs
35+
path: docs/_build

.github/workflows/test_and_deploy.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: tests
52

63
on:
@@ -13,14 +10,15 @@ on:
1310
branches:
1411
- main
1512
workflow_dispatch:
13+
merge_group:
1614

1715
jobs:
1816
test:
1917
name: ${{ matrix.platform }} py${{ matrix.python-version }}
2018
runs-on: ${{ matrix.platform }}
2119
strategy:
2220
matrix:
23-
platform: [ubuntu-latest]
21+
platform: [ubuntu-latest, macos-latest, windows-latest]
2422
python-version: ['3.8', '3.9', '3.10']
2523

2624
steps:
@@ -50,6 +48,14 @@ jobs:
5048
- name: Test with tox
5149
run: python -m tox
5250

51+
- name: Upload pytest test results
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: pytest-results-${{ matrix.platform }} py${{ matrix.python-version }}
55+
path: reports/
56+
# Use always() to always run this step to publish test results when there are test failures
57+
if: ${{ always() }}
58+
5359
- name: Coverage
5460
uses: codecov/codecov-action@v2
5561

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pip-delete-this-directory.txt
3737
# Unit test / coverage reports
3838
htmlcov/
3939
.tox/
40+
report/
4041
.coverage
4142
.coverage.*
4243
.cache
@@ -84,3 +85,6 @@ venv/
8485

8586
# written by setuptools_scm
8687
**/_version.py
88+
89+
# Generated by test runs
90+
reports

.pre-commit-config.yaml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.2.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-docstring-first
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8+
89
- repo: https://github.com/asottile/setup-cfg-fmt
9-
rev: v1.20.1
10+
rev: v2.2.0
1011
hooks:
1112
- id: setup-cfg-fmt
12-
- repo: https://github.com/PyCQA/flake8
13-
rev: 4.0.1
14-
hooks:
15-
- id: flake8
16-
additional_dependencies: [flake8-typing-imports>=1.9.0]
17-
- repo: https://github.com/myint/autoflake
18-
rev: v1.4
19-
hooks:
20-
- id: autoflake
21-
args: ["--in-place", "--remove-all-unused-imports"]
22-
- repo: https://github.com/PyCQA/isort
23-
rev: 5.10.1
24-
hooks:
25-
- id: isort
13+
2614
- repo: https://github.com/psf/black
27-
rev: 22.3.0
15+
rev: 23.3.0
2816
hooks:
2917
- id: black
30-
- repo: https://github.com/asottile/pyupgrade
31-
rev: v2.32.0
32-
hooks:
33-
- id: pyupgrade
34-
args: [--py38-plus, --keep-runtime-typing]
18+
3519
- repo: https://github.com/tlambert03/napari-plugin-checks
36-
rev: v0.2.0
20+
rev: v0.3.0
3721
hooks:
3822
- id: napari-plugin-checks
23+
3924
- repo: https://github.com/pre-commit/mirrors-mypy
40-
rev: v0.910-1
25+
rev: v1.3.0
4126
hooks:
4227
- id: mypy
43-
args: ["--disallow-incomplete-defs", "--ignore-missing-imports"]
28+
additional_dependencies: [numpy, matplotlib]
29+
30+
- repo: https://github.com/charliermarsh/ruff-pre-commit
31+
# Ruff version.
32+
rev: 'v0.0.270'
33+
hooks:
34+
- id: ruff
35+
36+
ci:
37+
autofix_prs: false

.readthedocs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
python:
4+
install:
5+
- method: pip
6+
path: .
7+
extra_requirements:
8+
- docs
9+
10+
build:
11+
os: ubuntu-22.04
12+
tools:
13+
python: "3.10"
14+
apt_packages:
15+
- xvfb

CHANGELOG.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# napari-matplotlib
22

3-
[![License](https://img.shields.io/pypi/l/napari-matplotlib.svg?color=green)](https://github.com/dstansby/napari-matplotlib/raw/main/LICENSE)
3+
[![License](https://img.shields.io/pypi/l/napari-matplotlib.svg?color=green)](https://github.com/matplotlib/napari-matplotlib/raw/main/LICENSE)
44
[![PyPI](https://img.shields.io/pypi/v/napari-matplotlib.svg?color=green)](https://pypi.org/project/napari-matplotlib)
55
[![Python Version](https://img.shields.io/pypi/pyversions/napari-matplotlib.svg?color=green)](https://python.org)
6-
[![tests](https://github.com/dstansby/napari-matplotlib/workflows/tests/badge.svg)](https://github.com/dstansby/napari-matplotlib/actions)
7-
[![codecov](https://codecov.io/gh/dstansby/napari-matplotlib/branch/main/graph/badge.svg)](https://codecov.io/gh/dstansby/napari-matplotlib)
6+
[![tests](https://github.com/matplotlib/napari-matplotlib/workflows/tests/badge.svg)](https://github.com/matplotlib/napari-matplotlib/actions)
7+
[![codecov](https://codecov.io/gh/matplotlib/napari-matplotlib/branch/main/graph/badge.svg)](https://codecov.io/gh/matplotlib/napari-matplotlib)
8+
[![readthedocs](https://readthedocs.org/projects/napari-matplotlib/badge/?version=latest)](https://napari-matplotlib.readthedocs.io/en/latest/)
89
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/matplotlib/pytest-mpl/master.svg)](https://results.pre-commit.ci/latest/github/matplotlib/pytest-mpl/master)
910
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-matplotlib)](https://napari-hub.org/plugins/napari-matplotlib)
1011

@@ -19,15 +20,15 @@ A plugin to create Matplotlib plots from napari layers
1920

2021
### `Slice`
2122
Plots 1D slices of data along a specified axis.
22-
![](https://raw.githubusercontent.com/dstansby/napari-matplotlib/main/examples/slice.png)
23+
![](https://raw.githubusercontent.com/matplotlib/napari-matplotlib/main/examples/slice.png)
2324

2425
### `Histogram`
2526
Plots histograms of individual image layers, or RGB histograms of an RGB image
26-
![](https://raw.githubusercontent.com/dstansby/napari-matplotlib/main/examples/hist.png)
27+
![](https://raw.githubusercontent.com/matplotlib/napari-matplotlib/main/examples/hist.png)
2728

2829
### `Scatter`
2930
Scatters the values of two similarly sized images layers against each other.
30-
![](https://raw.githubusercontent.com/dstansby/napari-matplotlib/main/examples/scatter.png)
31+
![](https://raw.githubusercontent.com/matplotlib/napari-matplotlib/main/examples/scatter.png)
3132

3233
## Installation
3334

@@ -39,7 +40,7 @@ You can install `napari-matplotlib` via [pip]:
3940

4041
To install latest development version :
4142

42-
pip install git+https://github.com/dstansby/napari-matplotlib.git
43+
pip install git+https://github.com/matplotlib/napari-matplotlib.git
4344

4445

4546
## Contributing

docs/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS ?= -W
6+
SPHINXOPTS ?= -W --keep-going
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build
@@ -12,6 +12,11 @@ BUILDDIR = _build
1212
help:
1313
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

15+
clean:
16+
@echo Removing files created by sphinx-build
17+
rm -rf $(BUILDDIR)
18+
rm -rf $(SOURCEDIR)/api/
19+
1520
.PHONY: help Makefile
1621

1722
# Catch-all target: route all unknown targets to Sphinx using the new

docs/api/napari_matplotlib.HistogramWidget.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/changelog.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Changelog
2+
=========
3+
4+
0.3.0
5+
-----
6+
7+
New features
8+
~~~~~~~~~~~~
9+
- Added ``MPLWidget`` as a widget containing just a Matplotlib canvas
10+
without any association with a napari viewer.
11+
- Added text to each widget indicating how many layers need to be selected
12+
for the widget to plot something.
13+
14+
Visual improvements
15+
~~~~~~~~~~~~~~~~~~~
16+
- The background of ``napari-matplotlib`` figures and axes is now transparent, and the text and axis colour respects the ``napari`` theme.
17+
- The icons in the Matplotlib toolbar are now the same size as icons in the napari window.
18+
19+
Changes
20+
~~~~~~~
21+
- The scatter widgets no longer use a LogNorm() for 2D histogram scaling.
22+
This is to move the widget in line with the philosophy of using Matplotlib default
23+
settings throughout ``napari-matplotlib``. This still leaves open the option of
24+
adding the option to change the normalization in the future. If this is something
25+
you would be interested in please open an issue at https://github.com/matplotlib/napari-matplotlib.
26+
- Labels plotting with the features scatter widget no longer have underscores
27+
replaced with spaces.
28+
- ``NapariMPLWidget.update_layers()`` has been removed as it is intended to be
29+
private API. Use ``NapariMPLWidget.on_update_layers`` instead to implement
30+
funcitonality when layer selection is changed.
31+
32+
Bug fixes
33+
~~~~~~~~~
34+
- Importing ``napari-matplotlib`` no longer affects how plots are rendered in
35+
Jupyter notebooks.
36+
37+
Other
38+
~~~~~
39+
- ``napari-matplotlib`` is now tested on macOS and Windows.
40+
- Type annotations have been completed throughout the code base.

0 commit comments

Comments
 (0)