From 27e7a908d211cdcab7bb0bd528b6abc2d289a306 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Fri, 8 Mar 2024 08:44:56 +0100 Subject: [PATCH] revert to absence of quotes in annotations, taking PR review suggestion https://github.com/napari/docs/pull/367/files\#r1517015542 --- docs/plugins/building_a_plugin/_layer_data_guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/plugins/building_a_plugin/_layer_data_guide.md b/docs/plugins/building_a_plugin/_layer_data_guide.md index 74c0f7776..600d49ac6 100644 --- a/docs/plugins/building_a_plugin/_layer_data_guide.md +++ b/docs/plugins/building_a_plugin/_layer_data_guide.md @@ -39,14 +39,14 @@ LayerData = Union[Tuple[DataType], Tuple[DataType, LayerProps], FullLayerData] where ... ```python -from typing import Dict, Literal, Protocol, Sequence, Tuple, Union +from typing import Literal, Protocol, Sequence import numpy as np LayerTypeName = Literal[ "image", "labels", "points", "shapes", "surface", "tracks", "vectors" ] LayerProps = Dict -DataType = Union["ArrayLike", Sequence["ArrayLike"]] +DataType = Union[ArrayLike, Sequence[ArrayLike]] FullLayerData = Tuple[DataType, LayerProps, LayerTypeName] LayerData = Union[Tuple[DataType], Tuple[DataType, LayerProps], FullLayerData] @@ -57,7 +57,7 @@ class ArrayLike(Protocol): ndim: int dtype: np.dtype def __array__(self) -> np.ndarray: ... - def __getitem__(self, key) -> "ArrayLike": ... + def __getitem__(self, key) -> ArrayLike: ... # the main point is that we're more concerned with structural # typing than literal array types (e.g. numpy, dask, xarray, etc...)