MicroMedIAn / PathAIA

Digital Pathology Analysis Tools
GNU General Public License v3.0
3 stars 3 forks source link

Error importing pathaia.patches #41

Closed qadadri closed 1 year ago

qadadri commented 1 year ago

from pathaia.patches import patchify_folder_hierarchically

/usr/local/lib/python3.8/dist-packages/pathaia/patches/init.py in ----> 1 from .functional_api import 2 from .object_api import

/usr/local/lib/python3.8/dist-packages/pathaia/patches/functional_api.py in 9 import numpy 10 import openslide ---> 11 from ..util.paths import slides_in_folder, slide_basename, safe_rmtree, get_files 12 from ..util.images import regular_grid, get_coords_from_mask 13 from ..util.basic import ifnone

/usr/local/lib/python3.8/dist-packages/pathaia/util/paths.py in 8 import shutil 9 from typing import Sequence, List, Optional, Dict ---> 10 from .types import PathLike 11 12

/usr/local/lib/python3.8/dist-packages/pathaia/util/types.py in 138 PathLike = Union[str, os.PathLike] 139 --> 140 NDByteImage = NDArray[(Any, Any, 3), numpy.uint8] 141 NDFloat32Image = NDArray[(Any, Any, 3), numpy.float32] 142 NDFloat64Image = NDArray[(Any, Any, 3), numpy.float64]

/usr/local/lib/python3.8/dist-packages/nptyping/base_meta_classes.py in getitem(cls, item) 136 raise NPTypingError(f"Type nptyping.{cls} is already parameterized.") 137 --> 138 args = cls._get_item(item) 139 additional_values = cls._get_additional_values(item) 140 assert hasattr(cls, "args"), "A SubscriptableMeta must have args."

/usr/local/lib/python3.8/dist-packages/nptyping/ndarray.py in _get_item(cls, item) 67 def _get_item(cls, item: Any) -> Tuple[Any, ...]: 68 cls._check_item(item) ---> 69 shape, dtype = cls._get_from_tuple(item) 70 return shape, dtype 71

/usr/local/lib/python3.8/dist-packages/nptyping/ndarray.py in _get_from_tuple(cls, item) 108 def _get_from_tuple(cls, item: Tuple[Any, ...]) -> Tuple[Shape, DType]: 109 # Return the Shape Expression and DType from a tuple. --> 110 shape = cls._get_shape(item[0]) 111 dtype = cls._get_dtype(item[1]) 112 return shape, dtype

/usr/local/lib/python3.8/dist-packages/nptyping/ndarray.py in _get_shape(cls, dtype_candidate) 121 shape = Shape[shape_expression] 122 else: --> 123 raise InvalidArgumentsError( 124 f"Unexpected argument '{dtype_candidate}', expecting" 125 " Shape[]"

InvalidArgumentsError: Unexpected argument '(typing.Any, typing.Any, 3)', expecting Shape[] or Literal[] or typing.Any.

zeFresk commented 1 year ago

I fixed this error and some other in PR #42