Skip to content

Commit

Permalink
Relint the code
Browse files Browse the repository at this point in the history
It looks like black's opinions changed?
  • Loading branch information
ctrueden committed Aug 12, 2024
1 parent 45cb5de commit feb5933
Show file tree
Hide file tree
Showing 40 changed files with 44 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/napari_imagej/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* jc
- object whose fields are lazily-loaded Java Class instances.
"""

from typing import Any, Callable, Dict

import imagej
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/readers/trackMate_reader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A napari reader plugin for importing TrackMate data stored in XML
"""

import xml.etree.ElementTree as ET

from napari.utils import progress
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module used to help find napari-imagej widget resources
"""

from pathlib import Path

PATH = Path(__file__).parent.resolve()
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* install_converters()
- used to add the napari-imagej Converters to scyjava's conversion framework.
"""

import pkgutil
from importlib.util import module_from_spec
from typing import Any, Callable, List
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/enum_likes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
scyjava Converters for converting JavaEnumLikes into their java equivalents.
"""

from napari_imagej.java import jc
from napari_imagej.types.converters import py_to_java_converter
from napari_imagej.types.enum_likes import OutOfBoundsFactory
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/enums.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
scyjava Converters for converting Java enums to their autogenerated Python enum
"""

from enum import Enum

from napari_imagej.java import jc
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
scyjava Converters for converting between ImgLib2 ImgLabelings
and napari Labels
"""

from imagej.convert import imglabeling_to_labeling
from labeling.Labeling import Labeling
from napari.layers import Labels
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/meshes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
scyjava Converters for converting between ImageJ2 Meshes and napari Surfaces
"""

import numpy as np
from jpype import JArray, JDouble
from napari.layers import Surface
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
scyjava Converters for converting between ImageJ2 RealPointCollections
and napari Points
"""

import numpy as np
from jpype import JArray, JDouble
from napari.layers import Points
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/converters/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
scyjava Converters for converting between ImgLib2 RealMasks
and napari Shapes
"""

import numpy as np
from jpype import JArray, JDouble
from napari.layers import Shapes
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/enum_likes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
JavaEnumLikes are NOT intended for direct use. Instead, use enum_like() to obtain
the correct JavaEnumLike for a Java enum-like!
"""

from enum import Enum, auto
from typing import List

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/type_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* python_type_of()
- determines an "equivalent" python type for a given SciJava ModuleItem
"""

from typing import Callable, List, Optional, Tuple, Type

from jpype import JObject
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
The hint maps are broken up into sub-maps for convenience and utility.
"""

from dataclasses import dataclass
from functools import lru_cache
from typing import Callable, List, Union
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/type_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module containing useful functions for operating on python types
"""

from napari_imagej.types import type_hints


Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/types/widget_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- finds the best widget (as a str) for a ModuleItem
and corresponding python type
"""

from typing import Callable, Dict, Optional, Union, get_args, get_origin

from napari.layers import Image
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/utilities/_module_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* info_for(searchResult)
- converts a SciJava SearchResult to a ModuleInfo
"""

from inspect import Parameter, Signature, _empty, isclass, signature
from time import perf_counter
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/utilities/event_subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Module containing various EventSubscribers used by
napari-imagej functionality
"""

from jpype import JImplements, JOverride
from qtpy.QtCore import Signal

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/utilities/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* log_debug()
- used for logging in a standardized way
"""

import logging
import os

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/info_bar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A display showing information relative to the napari-imagej widget
"""

from qtpy.QtWidgets import QLabel, QVBoxLayout, QWidget


Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/layouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module containing QLayouts used by various napari-imagej widgets
"""

from qtpy.QtCore import QMargins, QPoint, QRect, QSize, Qt
from qtpy.QtWidgets import QLayout, QSizePolicy

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/menu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The top-level menu for the napari-imagej widget.
"""

from pathlib import Path
from typing import Iterable, Optional

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/napari_imagej.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This Widget is made accessible to napari through napari.yml
"""

from traceback import format_exception
from typing import Callable

Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/parameter_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
A collection of QWidgets, each designed to conveniently harvest a particular input.
They should align with a SciJava ModuleItem that satisfies some set of conditions.
"""

import importlib
from dataclasses import dataclass
from functools import lru_cache
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/result_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Calls to ResultRunner.select(result) will generate a set of actions that operate
on the provided SciJava SearchResult. These actions will appear as QPushButtons.
"""

from typing import Callable, Dict, List, Union

from napari import Viewer
Expand Down
1 change: 1 addition & 0 deletions src/napari_imagej/widgets/result_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
SearchResults are grouped by the SciJava Searcher that created them.
"""

from typing import List, Optional

from qtpy.QtCore import Qt, Signal, Slot
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module containing pytest configuration and globally-used fixtures
"""

import os
import sys
from typing import Callable, Generator
Expand Down
1 change: 1 addition & 0 deletions tests/test_scripting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing script discovery and wrapping
"""

from magicgui import magicgui

from napari_imagej.java import JavaClasses
Expand Down
1 change: 1 addition & 0 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari-imagej settings
"""

from scyjava import jimport

from napari_imagej import settings
Expand Down
1 change: 1 addition & 0 deletions tests/types/test_converters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.types.converters
"""

from typing import Any, Dict, List

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/types/test_trackmate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.types.converters.trackmate
"""

from typing import Tuple

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/types/test_type_conversions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.types.type_conversions
"""

from typing import List

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/types/test_widget_mappings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.types.widget_mappings
"""

from typing import Optional

import magicgui
Expand Down
1 change: 1 addition & 0 deletions tests/utilities/test_module_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.utilities._module_utils
"""

import sys
from collections import OrderedDict
from inspect import Parameter, _empty, signature
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module containing testing utilities
"""

from typing import List

from jpype import JImplements, JOverride
Expand Down
1 change: 1 addition & 0 deletions tests/widgets/test_info_bar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.widgets.info_bar
"""

import pytest
from qtpy.QtWidgets import QLabel, QVBoxLayout

Expand Down
8 changes: 5 additions & 3 deletions tests/widgets/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,11 @@ def test_settings_change(popup_handler, gui_widget: NapariImageJMenu):

def provide_updated_values(values={}, title="", **kwargs):
return {
name: new_value
if name == "imagej_directory_or_endpoint"
else settings.defaults[name]
name: (
new_value
if name == "imagej_directory_or_endpoint"
else settings.defaults[name]
)
for name in values
}

Expand Down
1 change: 1 addition & 0 deletions tests/widgets/test_parameter_widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.widgets.parameter_widgets
"""

import importlib

import napari
Expand Down
1 change: 1 addition & 0 deletions tests/widgets/test_result_runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.widgets.result_runner
"""

import pytest
from qtpy.QtWidgets import QLabel, QVBoxLayout, QWidget

Expand Down
1 change: 1 addition & 0 deletions tests/widgets/test_searchbar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module testing napari_imagej.widgets.searchbar
"""

import pytest
from qtpy.QtWidgets import QHBoxLayout, QLineEdit

Expand Down
1 change: 1 addition & 0 deletions tests/widgets/widget_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module containing functionality useful for widget testing
"""

from typing import Optional

from scyjava import Priority
Expand Down

0 comments on commit feb5933

Please sign in to comment.