From e48ab10464dada488ed75fe963be93090ec50fad Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Wed, 11 Sep 2024 03:46:59 +0200 Subject: [PATCH] Change type of layer Metadata from Dict to Mapping (#357) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com> --- src/npe2/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/npe2/types.py b/src/npe2/types.py index 3f649005..da7e72ba 100644 --- a/src/npe2/types.py +++ b/src/npe2/types.py @@ -1,7 +1,7 @@ +from collections.abc import Mapping from typing import ( TYPE_CHECKING, Callable, - Dict, List, Literal, NewType, @@ -48,7 +48,7 @@ def __array__(self) -> "np.ndarray": LayerName = Literal[ "graph", "image", "labels", "points", "shapes", "surface", "tracks", "vectors" ] -Metadata = Dict +Metadata = Mapping DataType = Union[ArrayLike, Sequence[ArrayLike]] FullLayerData = Tuple[DataType, Metadata, LayerName] LayerData = Union[Tuple[DataType], Tuple[DataType, Metadata], FullLayerData]