diff --git a/monai/bundle/scripts.py b/monai/bundle/scripts.py index 33affcf31b..f4652fb3e7 100644 --- a/monai/bundle/scripts.py +++ b/monai/bundle/scripts.py @@ -429,7 +429,7 @@ def verify_metadata( try: # the rest key-values in the _args are for `validate` API validate(instance=metadata, schema=schema, **_args) - except ValidationError as e: + except ValidationError as e: # pylint: disable=E0712 # as the error message is very long, only extract the key information logger.info(re.compile(r".*Failed validating", re.S).findall(str(e))[0] + f" against schema `{url}`.") return diff --git a/tests/test_lesion_froc.py b/tests/test_lesion_froc.py index 6b4989a9d5..b135b3eaeb 100644 --- a/tests/test_lesion_froc.py +++ b/tests/test_lesion_froc.py @@ -31,7 +31,7 @@ def save_as_tif(filename, array): if not filename.endswith(".tif"): filename += ".tif" file_path = os.path.join("tests", "testing_data", filename) - imwrite(file_path, array, compress="jpeg", tile=(16, 16)) + imwrite(file_path, array, compression="jpeg", tile=(16, 16)) def around(val, interval=3): diff --git a/tests/test_wsireader.py b/tests/test_wsireader.py index 6ee02143b8..3655100dab 100644 --- a/tests/test_wsireader.py +++ b/tests/test_wsireader.py @@ -84,7 +84,7 @@ TEST_CASE_RGB_1 = [np.ones((3, 100, 100), dtype=np.uint8)] # CHW -TEST_CASE_ERROR_GRAY = [np.ones((16, 16), dtype=np.uint8)] # no color channel +TEST_CASE_ERROR_GRAY = [np.ones((16, 16, 2), dtype=np.uint8)] # wrong color channel TEST_CASE_ERROR_3D = [np.ones((16, 16, 16, 3), dtype=np.uint8)] # 3D + color @@ -115,7 +115,7 @@ def save_gray_tiff(array: np.ndarray, filename: str): filename: the filename to be used for the tiff file. """ img_gray = array - imwrite(filename, img_gray, shape=img_gray.shape, photometric="rgb") + imwrite(filename, img_gray, shape=img_gray.shape, photometric="minisblack") return filename diff --git a/tests/test_wsireader_new.py b/tests/test_wsireader_new.py index 456f5a9453..63d61dfeb3 100644 --- a/tests/test_wsireader_new.py +++ b/tests/test_wsireader_new.py @@ -72,7 +72,7 @@ TEST_CASE_RGB_1 = [np.ones((3, 100, 100), dtype=np.uint8)] # CHW -TEST_CASE_ERROR_GRAY = [np.ones((16, 16), dtype=np.uint8)] # no color channel +TEST_CASE_ERROR_GRAY = [np.ones((16, 16, 2), dtype=np.uint8)] # wrong color channel TEST_CASE_ERROR_3D = [np.ones((16, 16, 16, 3), dtype=np.uint8)] # 3D + color @@ -103,7 +103,7 @@ def save_gray_tiff(array: np.ndarray, filename: str): filename: the filename to be used for the tiff file. """ img_gray = array - imwrite(filename, img_gray, shape=img_gray.shape, photometric="rgb") + imwrite(filename, img_gray, shape=img_gray.shape, photometric="minisblack") return filename