Skip to content

Commit

Permalink
Remove napari import
Browse files Browse the repository at this point in the history
  • Loading branch information
adamltyson committed Jul 17, 2024
1 parent b27e62b commit e677851
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions brainglobe_utils/brainreg/napari.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import json
from pathlib import Path
from typing import Any, Dict, List, Union
from typing import TYPE_CHECKING, Any, Dict, List, Union

import napari
import pandas as pd
import tifffile
from brainglobe_atlasapi import BrainGlobeAtlas
Expand Down Expand Up @@ -30,9 +29,12 @@
from brainglobe_utils.qtpy.logo import header_widget
from brainglobe_utils.qtpy.table import DataFrameModel

if TYPE_CHECKING:
import napari

Check warning on line 33 in brainglobe_utils/brainreg/napari.py

View check run for this annotation

Codecov / codecov/patch

brainglobe_utils/brainreg/napari.py#L33

Added line #L33 was not covered by tests


class TransformPoints(QWidget):
def __init__(self, viewer: napari.viewer.Viewer):
def __init__(self, viewer: "napari.viewer.Viewer"):
super(TransformPoints, self).__init__()
self.viewer = viewer
self.raw_data = None
Expand Down Expand Up @@ -74,7 +76,7 @@ def _update_combobox_options(combobox: QComboBox, options_list: List[str]):

def _get_layer_names(
self,
layer_type: napari.layers.Layer = napari.layers.Image,
layer_type: "napari.layers.Layer" = "napari.layers.Image",
default: str = "",
) -> List[str]:
"""
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ brainglobe-utils = "brainglobe_utils:napari.yaml"

[project.optional-dependencies]
qt = ["qtpy", "superqt"]
napari = ["brainglobe-utils[qt]", "napari[all]"]

dev = [
"black",
Expand All @@ -68,7 +69,7 @@ dev = [
"setuptools_scm",
"tox",
"pooch",
"brainglobe-utils[qt]",
"brainglobe-utils[napari]",
]


Expand Down

0 comments on commit e677851

Please sign in to comment.