Skip to content

Commit

Permalink
Merge branch 'main' into keybind-contribution
Browse files Browse the repository at this point in the history
* main: (38 commits)
  Fix `test_worker_with_progress` by wait on worker end (napari#5548)
  Un-set unified title and tool bar on mac (Qt property) (napari#5533)
  Set PYTHONEXECUTABLE as part of macos fixes on (re)startup (napari#5531)
  Fix key error issue of action manager (napari#5539)
  Clean dangling widget in test (napari#5544)
  Use pytest-pretty for better log readability (napari#5525)
  Update vendoring tool to check on matplotlib colormap (napari#5181)
  MAINT: add time limit for CI. (napari#5495)
  Add show_debug notification (napari#5101)
  Overlays 2.0 (napari#4894)
  Clarify layer's editable property and separate interaction with visible property (napari#5413)
  ci(dependabot): bump docker/build-push-action from 3 to 4 (napari#5523)
  Fix opening file dialogs in PySide (napari#5492)
  [pre-commit.ci] pre-commit autoupdate (napari#5518)
  Replace flake8, isort and pyupgrade by ruff, enable additional usefull rules (napari#5513)
  MAINT: Don't format logs in log call (napari#5504)
  Fix conda avaliability check (napari#5496)
  Handle case when QtDims play thread is partially deleted (napari#5499)
  Bugfix: Add missing Enums and Flags required by PySide6 > 6.4 (napari#5480)
  Refactor Main Window status bar to improve information presentation (napari#5451)
  ...
  • Loading branch information
kne42 committed Feb 28, 2023
2 parents 29cf9ed + ada343a commit 270132e
Show file tree
Hide file tree
Showing 428 changed files with 3,646 additions and 2,852 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"forwardPorts": [5900, 5901, 6080],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip install -U pip && pip install -e .[dev] && pre-commit install",
"postCreateCommand": "pip install -U pip && pip install -e .[pyqt, dev] && pre-commit install",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python -c 'import napari.layers; print(napari.layers.__doc__)'
- name: Build Docs
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
env:
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-singularity-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test_comprehensive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
COLUMNS: 120

concurrency:
group: comprehensive-test

Expand Down Expand Up @@ -100,7 +103,7 @@ jobs:
# in which case we are declaring one specific tox environment to run.
# see tox.ini for more
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: python -m tox
env:
Expand Down Expand Up @@ -151,7 +154,7 @@ jobs:
pip install ./napari-from-github[all,testing]
- name: Test
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: python -m pytest --pyargs napari --color=yes

Expand All @@ -170,6 +173,6 @@ jobs:
pip install setuptools tox tox-gh-actions
- name: Test
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: tox -e py39-linux-pyside2-examples
5 changes: 4 additions & 1 deletion .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
COLUMNS: 120

jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python }} ${{ matrix.backend }} --pre
Expand Down Expand Up @@ -46,7 +49,7 @@ jobs:
- name: Test with tox
# run tests using pip install --pre
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: python -m tox -v --pre
env:
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/test_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,36 @@ concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

env:
COLUMNS: 120

jobs:
manifest:
# make sure all necessary files will be bundled in the release
name: Check Manifest
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
cache-dependency-path: setup.cfg
cache: 'pip'
- name: Install Dependencies
run: pip install --upgrade pip
- name: Install Napari dev
run: pip install -e .[build]
- name: Check Manifest
run: |
pip install --upgrade pip
pip install -e .[build]
make typestubs
make check-manifest
localization_syntax:
# make sure all necessary files will be bundled in the release
name: Check l18n syntax
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -48,6 +56,7 @@ jobs:
test:
name: ${{ matrix.platform }} ${{ matrix.python }} ${{ matrix.toxenv || matrix.backend }} ${{ matrix.MIN_REQ && 'min_req' }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -84,10 +93,9 @@ jobs:
- python: 3.9
platform: ubuntu-latest
backend: pyside6
# uncoment when new qtpy is released
# - python: '3.10'
# platform: ubuntu-latest
# backend: pyside6
- python: '3.10'
platform: ubuntu-latest
backend: pyside6

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -134,7 +142,9 @@ jobs:
# `tox -e py38-linux-pyqt,py38-linux-pyside`
# see tox.ini for more
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
# the longest is macos-latest 3.9 pyqt5 at ~30 minutes.
timeout-minutes: 35
uses: aganders3/headless-gui@v1
with:
run: python -m tox
env:
Expand All @@ -144,6 +154,7 @@ jobs:
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION: ${{ matrix.MIN_REQ || 1 }}
PYVISTA_OFF_SCREEN: True
MIN_REQ: ${{ matrix.MIN_REQ }}
FORCE_COLOR: 1
- uses: actions/upload-artifact@v3
with:
name: upload pytest timing reports as json
Expand Down Expand Up @@ -176,7 +187,7 @@ jobs:
pip install ./napari-from-github[all,testing]
- name: Test
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: |
python -m pytest --pyargs napari --color=yes
Expand All @@ -198,6 +209,6 @@ jobs:
pip install setuptools tox tox-gh-actions
- name: Test
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: tox -e py39-linux-pyside2-examples
31 changes: 7 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,26 @@ repos:
- id: absolufy-imports
exclude: _vendor|vendored|examples
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.2
rev: v2.1.3
hooks:
- id: pycln
- repo: https://github.com/pycqa/isort
rev: 5.11.4
hooks:
- id: isort
exclude: _vendor|vendored|examples
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
pass_filenames: true
exclude: _vendor|vendored|examples
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.206
rev: v0.0.237
hooks:
- id: ruff
exclude: _vendor|vendored
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports]
pass_filenames: true
# this seems to need to be here in addition to setup.cfg
exclude: _vendor|vendored|__init__.py|examples
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py38-plus", "--keep-runtime-typing"]
exclude: _vendor|vendored|examples
- repo: https://github.com/seddonym/import-linter
rev: v1.6.0
rev: v1.7.0
hooks:
- id: import-linter
stages: [manual]


- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.21.0
hooks:
- id: check-github-workflows
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ import napari
viewer = napari.view_image(data.cells3d(), channel_axis=1, ndisplay=3)
```

![napari viewer showing an image of an astronaut.](https://github.com/napari/docs/blob/main/docs/images/screenshot-add-image.png)
![napari viewer with a multichannel image of cells displayed as two image layers: nuclei and membrane.](https://github.com/napari/docs/blob/main/docs/images/multichannel_cells.png)


To use napari from inside a script, use `napari.run()`:

Expand Down
2 changes: 1 addition & 1 deletion examples/3D_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import numpy as np
from skimage import data
import napari

import napari

blobs = data.binary_blobs(
length=128, blob_size_fraction=0.05, n_dim=3, volume_fraction=0.05
Expand Down
5 changes: 3 additions & 2 deletions examples/3Dimage_plane_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
.. tags:: visualization-advanced, gui, layers
"""
import napari
import numpy as np
from napari.utils.translations import trans
from skimage import data

import napari
from napari.utils.translations import trans

viewer = napari.Viewer(ndisplay=3)

# add a 3D image
Expand Down
8 changes: 5 additions & 3 deletions examples/3d_kymograph_.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
.. tags:: experimental
"""
from itertools import product

import numpy as np
import napari
from tqdm import tqdm
from itertools import product

import napari

try:
from omero.gateway import BlitzGateway
Expand Down Expand Up @@ -157,4 +159,4 @@ def IDR_fetch_image(image_id: int, progressbar: bool = True) -> np.ndarray:
v.camera.angles = (-20, 23, -50)
v.camera.zoom = 0.17

napari.run()
napari.run()
5 changes: 0 additions & 5 deletions examples/README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
Examples of napari usage.

.. toctree::
:maxdepth: 1

../_tags/tagsindex
4 changes: 2 additions & 2 deletions examples/add-points-3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
.. tags:: visualization-nD
"""

from skimage import data
from scipy import ndimage as ndi
import napari
from skimage import data

import napari

blobs = data.binary_blobs(
length=128, volume_fraction=0.1, n_dim=3
Expand Down
2 changes: 1 addition & 1 deletion examples/add_3D_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""

from skimage import data
import napari

import napari

blobs = data.binary_blobs(length=64, volume_fraction=0.1, n_dim=3).astype(
float
Expand Down
4 changes: 2 additions & 2 deletions examples/add_grayscale_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
.. tags:: visualization-basic
"""

from skimage import data
import napari
import numpy as np
from skimage import data

import napari

# simulating a grayscale image here for testing contrast limits adjustments
image = data.astronaut().mean(-1) * 100 + 100
Expand Down
1 change: 1 addition & 0 deletions examples/add_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

from skimage import data

import napari

# create the viewer with an image
Expand Down
1 change: 1 addition & 0 deletions examples/add_image_transformed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

from skimage import data

import napari

# create the viewer with an image and transform (rotate) it
Expand Down
6 changes: 3 additions & 3 deletions examples/add_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

from skimage import data
from skimage.filters import threshold_otsu
from skimage.segmentation import clear_border
from skimage.measure import label
from skimage.morphology import closing, square, remove_small_objects
import napari
from skimage.morphology import closing, remove_small_objects, square
from skimage.segmentation import clear_border

import napari

image = data.coins()[50:-50, 50:-50]

Expand Down
8 changes: 4 additions & 4 deletions examples/add_labels_with_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"""


import numpy as np
from skimage import data
from skimage.filters import threshold_otsu
from skimage.segmentation import clear_border
from skimage.measure import label
from skimage.morphology import closing, square, remove_small_objects
import numpy as np
import napari
from skimage.morphology import closing, remove_small_objects, square
from skimage.segmentation import clear_border

import napari

image = data.coins()[50:-50, 50:-50]

Expand Down
4 changes: 2 additions & 2 deletions examples/add_multiscale_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
.. tags:: visualization-advanced
"""

import numpy as np
from skimage import data
from skimage.transform import pyramid_gaussian
import napari
import numpy as np

import napari

# create multiscale from astronaut image
base = np.tile(data.astronaut(), (8, 8, 1))
Expand Down
Loading

0 comments on commit 270132e

Please sign in to comment.