Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deepsource tuple unpacking Fix #1549

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions plantcv/plantcv/output_mask_ori_img.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
4 changes: 3 additions & 1 deletion tests/plantcv/test_output_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])