Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent c451c14 commit c04a41d
Show file tree
Hide file tree
Showing 139 changed files with 145 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/add_centroids.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example showing how to plot centroids."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_few_large_lines.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example showing how to plot multiple line sand adjust axis labels."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The MultiLine layer is implemented to enable better performance when plotting multiple lines of long length.
In the example below we are plotting several long lines with no noticeable performance drop.
"""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_line_with_apex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example showing simple line and 'infinite' line to show the apex"""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_lines_and_span.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example showing how to plot multiple line sand adjust axis labels."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_multiline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The MultiLine layer is implemented to enable better performance when plotting multiple lines of long length.
In the example below we are plotting several long lines with no noticeable performance drop.
"""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_multiline_with_different_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The MultiLine layer accepts data of different sizes. You can provide dict of `xs` and `ys` of arbitrary lengths
as long as the number of lines arrays is the same and the corresponding arrays have identical size.
"""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_multiple_infinite_lines.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Multiple infinite lines in a single layer."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_multiple_regions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Multiple infinite regions in a single layer."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The MultiLine layer is implemented to enable better performance when plotting multiple lines of long length.
In the example below we are plotting several long lines with no noticeable performance drop.
"""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/add_simple_lines.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example showing how to plot multiple line sand adjust axis labels."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/change_tick_formatter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom formatter."""

import napari_plot
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions examples/live_update_lines.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example shows a sine wave `moving` over time.."""

import time
import napari_plot
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/live_update_multiple_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This method does not do many checks so you must make sure that whatever data you replace, it has the same
characteristics as the original or at least it's valid.
"""

import napari_plot
import numpy as np
from napari.qt import thread_worker
Expand Down
1 change: 1 addition & 0 deletions examples/live_update_scatter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example shows a sin and cos scatter points moving over time."""

import time
import napari_plot
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/show_layer_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Display image and 1d plot."""

import numpy as np

import napari_plot
Expand Down
1 change: 1 addition & 0 deletions examples_with_napari/napari-and-1d-canvas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Display image and 1d plot."""

import napari
import numpy as np
from skimage import data
Expand Down
1 change: 1 addition & 0 deletions examples_with_napari/napari-and-1d-live-callback.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create simple callback that modifies the line visual."""

import napari
import numpy as np
from skimage import data, measure
Expand Down
1 change: 1 addition & 0 deletions napari_plot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Init"""

try:
from napari_plot._version import version as __version__
except ImportError:
Expand Down
1 change: 1 addition & 0 deletions napari_plot/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""napari-plot command line viewer."""

import argparse
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_contribution.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Napari contributions in old npe1 style."""

from napari_plugin_engine import napari_hook_implementation

from napari_plot._plot_widget import NapariPlotWidget
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_plot_widget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dock widget"""

from qtpy.QtWidgets import QVBoxLayout, QWidget

from napari_plot._qt.helpers import get_parent
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/_tests/test_icon_button.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test image buttons."""

import pytest
from napari.layers import Points
from napari.layers.points._points_constants import Mode
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/_tests/test_icon_label.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test image labels."""

import pytest

from napari_plot._qt.widgets.qt_icon_label import SIZES, QtQtaLabel
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/_tests/test_qt_viewer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Check QtViewer"""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/component_controls/qt_axis_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""X/Y-axis controls"""

from typing import TYPE_CHECKING

from napari._qt.utils import disable_with_opacity, qt_signals_blocked
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/component_controls/qt_camera_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Camera controls"""

import typing as ty

from napari.utils.events import disconnect_events
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper functions to easily create UI elements."""

import typing as ty
from contextlib import contextmanager

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test controls"""

import numpy as np
import pytest
from napari.utils.colormaps.standardize_color import transform_color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test controls"""

import numpy as np
import pytest
from napari.utils.colormaps.standardize_color import transform_color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test controls"""

import numpy as np
import pytest
from napari.utils.colormaps.standardize_color import transform_color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test controls"""

import numpy as np
import pytest
from napari.utils.colormaps.standardize_color import transform_color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test controls"""

import numpy as np
import pytest
from napari.utils.colormaps.standardize_color import transform_color
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_centroids_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Centroids controls"""

import typing as ty

from napari._qt.utils import disable_with_opacity, qt_signals_blocked
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_infline_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Line controls"""

import typing as ty

from napari._qt.utils import disable_with_opacity, qt_signals_blocked
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_layer_controls_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base layer controls"""

from napari.layers.base._base_constants import BLENDING_TRANSLATIONS
from napari.utils.events import disconnect_events
from qtpy.QtCore import Qt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Layer controls."""

import napari._qt.layer_controls.qt_layer_controls_container
from napari._qt.layer_controls.qt_layer_controls_container import QtLayerControlsContainer # noqa

Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_layers_dialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tool dialog to display layer controls"""

from weakref import ref

from qtpy.QtWidgets import QVBoxLayout
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_line_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Line controls"""

import typing as ty

from napari._qt.utils import disable_with_opacity, qt_signals_blocked
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_multiline_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MultiLine controls"""

import typing as ty

from napari._qt.utils import disable_with_opacity, qt_signals_blocked
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/layer_controls/qt_region_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Scatter layer controls"""

import typing as ty

import numpy as np
Expand Down
13 changes: 7 additions & 6 deletions napari_plot/_qt/layer_controls/qt_scatter_controls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Scatter layer controls"""

import typing as ty

import numpy as np
Expand Down Expand Up @@ -70,17 +71,17 @@ def __init__(self, layer: "Scatter"):
self.size_slider.valueChanged.connect(self.on_change_size)

self.face_color_swatch = QColorSwatch(
initial_color=self.layer.face_color[-1]
if self.layer.face_color.size > 0
else self.layer._default_face_color,
initial_color=(
self.layer.face_color[-1] if self.layer.face_color.size > 0 else self.layer._default_face_color
),
tooltip="Click to set face color",
)
self.face_color_swatch.color_changed.connect(self.on_change_face_color) # noqa

self.edge_color_swatch = QColorSwatch(
initial_color=self.layer.edge_color[-1]
if self.layer.edge_color.size > 0
else self.layer._default_edge_color,
initial_color=(
self.layer.edge_color[-1] if self.layer.edge_color.size > 0 else self.layer._default_edge_color
),
tooltip="Click to set edge color",
)
self.edge_color_swatch.color_changed.connect(self.on_change_edge_color) # noqa
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/qt_event_loop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Event loop"""

import os
import sys
from warnings import warn
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/qt_layer_buttons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Layer buttons"""

from napari._qt.widgets.qt_viewer_buttons import QtDeleteButton
from qtpy.QtWidgets import QFrame, QHBoxLayout

Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/qt_main_window.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Native window."""

import time
import typing as ty
from functools import partial
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/qt_toolbar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Toolbar"""

from weakref import ref

from qtpy.QtCore import Qt
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/qt_viewer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Qt widget that embeds the canvas"""

import warnings
from contextlib import suppress
from weakref import WeakSet
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/widgets/qt_dev.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Development widgets."""

import importlib
import pkgutil
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/widgets/qt_icon_button.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""QtImagePushButton"""

import typing as ty

import qtawesome
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/widgets/qt_icon_label.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""QtIconLabel"""

import qtawesome
from napari.settings import get_settings
from napari.utils.events.event_utils import connect_no_arg
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/widgets/qt_line.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Horizontal and Vertical lines"""

from qtpy.QtWidgets import QFrame


Expand Down
1 change: 1 addition & 0 deletions napari_plot/_qt/widgets/qt_mini_toolbar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mini toolbar"""

import typing as ty

from qtpy.QtCore import Qt
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_scatter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This widget is inspired by ScatterWidget in https://github.com/dstansby/napari-matplotlib
"""

import typing as ty
from contextlib import suppress
from warnings import warn
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_tests/test_scatter_widget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ScatterPlotWidget"""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions napari_plot/_tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for tests."""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions napari_plot/_vispy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Init"""

# this import is needed to overwrite the default behaviour of ticker
from napari_plot._vispy.components import axis # noqa: F401
1 change: 1 addition & 0 deletions napari_plot/_vispy/camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Camera model"""

import typing as ty

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_vispy/canvas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Line-specific vispy canvas"""

from contextlib import contextmanager

from napari._vispy.utils.gl import get_max_texture_sizes
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_vispy/components/axis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reimplementation of axis-visual"""

import numpy as np
import vispy.visuals.axis
from vispy.visuals.axis import Ticker as _Ticker
Expand Down
1 change: 1 addition & 0 deletions napari_plot/_vispy/components/camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Specialized camera for 1d data"""

import typing as ty

import numpy as np
Expand Down
Loading

0 comments on commit c04a41d

Please sign in to comment.