From abfb8c8071ecb34db44721f166ae335e7a0fbb10 Mon Sep 17 00:00:00 2001 From: natejly Date: Thu, 6 Jun 2024 23:29:01 -0500 Subject: [PATCH 1/2] output_mask returns 2 strings --- tests/plantcv/test_output_mask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/plantcv/test_output_mask.py b/tests/plantcv/test_output_mask.py index bf55e19a5..f0e2deb99 100644 --- a/tests/plantcv/test_output_mask.py +++ b/tests/plantcv/test_output_mask.py @@ -10,5 +10,5 @@ def test_output_mask(test_data, tmpdir): # Read in test data img = cv2.imread(test_data.small_gray_img, -1) mask = cv2.imread(test_data.small_bin_img, -1) - imgpath, maskpath, _ = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False) + imgpath, maskpath = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False) assert all([os.path.exists(imgpath) is True, os.path.exists(maskpath) is True]) From b4e1f1d6a0f26fcbd5dfa76aecfa3d81a74ebd9f Mon Sep 17 00:00:00 2001 From: natejly Date: Thu, 6 Jun 2024 23:37:31 -0500 Subject: [PATCH 2/2] fixed output mask documentation --- plantcv/plantcv/output_mask_ori_img.py | 6 ++---- tests/plantcv/test_output_mask.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plantcv/plantcv/output_mask_ori_img.py b/plantcv/plantcv/output_mask_ori_img.py index 973ce1bb2..bb11b707e 100755 --- a/plantcv/plantcv/output_mask_ori_img.py +++ b/plantcv/plantcv/output_mask_ori_img.py @@ -17,16 +17,14 @@ def output_mask(img, mask, filename, outdir=None, mask_only=False): mask_only = bool for printing only mask Returns: - imgpath = path to image - maskpath path to mask + results = list of output paths, [imgpath, maskpath, analysis_images] :param img: numpy.ndarray :param mask: numpy.ndarray :param filename: str :param outdir: str :param mask_only: bool - :return imgpath: str - :return maskpath: str + :return results: list """ analysis_images = [] diff --git a/tests/plantcv/test_output_mask.py b/tests/plantcv/test_output_mask.py index f0e2deb99..31372eac2 100644 --- a/tests/plantcv/test_output_mask.py +++ b/tests/plantcv/test_output_mask.py @@ -10,5 +10,7 @@ def test_output_mask(test_data, tmpdir): # Read in test data img = cv2.imread(test_data.small_gray_img, -1) mask = cv2.imread(test_data.small_bin_img, -1) - imgpath, maskpath = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False) + results = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False) + imgpath = results[0] + maskpath = results[1] assert all([os.path.exists(imgpath) is True, os.path.exists(maskpath) is True])