From 6afc013fb5c605e058c4c3b020f74aca9603defb Mon Sep 17 00:00:00 2001 From: vgrau98 Date: Tue, 3 Oct 2023 13:52:25 +0000 Subject: [PATCH 1/2] add shape check for arbitrary types for DataStats Fixes: #6844 DataStats was breaking for arbitrary types (other than tensor or array). Signed-off-by: vgrau98 --- monai/transforms/utility/array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/transforms/utility/array.py b/monai/transforms/utility/array.py index ef2a714a25..f9b81865e0 100644 --- a/monai/transforms/utility/array.py +++ b/monai/transforms/utility/array.py @@ -681,7 +681,7 @@ def __call__( if self.data_type if data_type is None else data_type: lines.append(f"Type: {type(img)} {img.dtype if hasattr(img, 'dtype') else None}") if self.data_shape if data_shape is None else data_shape: - lines.append(f"Shape: {img.shape}") + lines.append(f"Shape: {img.shape if hasattr(img, 'shape') else None}") if self.value_range if value_range is None else value_range: if isinstance(img, np.ndarray): lines.append(f"Value range: ({np.min(img)}, {np.max(img)})") From b05a2532d23f1dc57872635893b3ea56873dc84a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 3 Oct 2023 21:31:41 +0100 Subject: [PATCH 2/2] skip pylint 3.0 test Signed-off-by: Wenqi Li --- runtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtests.sh b/runtests.sh index 01f58088ec..f71bc4c9ff 100755 --- a/runtests.sh +++ b/runtests.sh @@ -544,7 +544,7 @@ then if ! is_pip_installed pylint then echo "Pip installing pylint ..." - ${cmdPrefix}${PY_EXE} -m pip install pylint>2.16 + ${cmdPrefix}${PY_EXE} -m pip install "pylint>2.16,!=3.0.0" fi ${cmdPrefix}${PY_EXE} -m pylint --version