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

Update closing.py #1669

Merged
merged 4 commits into from
Mar 14, 2025
Merged

Update closing.py #1669

merged 4 commits into from
Mar 14, 2025

Conversation

eseigel
Copy link
Contributor

@eseigel eseigel commented Jan 31, 2025

Changed len(np.unique(gray_img)) to >2

Describe your changes
Changed len(np.unique(gray_img)) to >2, allowing all black or white images to be treated as binary.

Type of update
Is this a:
New feature or feature enhancement

Associated issues
#1635

Additional context
Add any other context about the problem here.

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

Changed len(np.unique(gray_img)) to >2
Copy link

deepsource-io bot commented Jan 31, 2025

Here's the code health analysis summary for commits 0efab99..b80695e. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, ✅ Above Threshold100%, ✅ Above Threshold

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@eseigel eseigel added enhancement Enhancements to existing features ready to review labels Jan 31, 2025
@HaleySchuhl HaleySchuhl mentioned this pull request Jan 31, 2025
33 tasks
@HaleySchuhl HaleySchuhl self-requested a review February 21, 2025 15:19
HaleySchuhl
HaleySchuhl previously approved these changes Feb 21, 2025
@@ -22,7 +22,7 @@ def closing(gray_img, kernel=None):
fatal_error("Input image must be grayscale or binary")

# If image is binary use the faster method
if len(np.unique(gray_img)) == 2:
if len(np.unique(gray_img)) > 2:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eseigel and @HaleySchuhl should this be <= 2?

@HaleySchuhl HaleySchuhl dismissed their stale review March 14, 2025 13:48

we edited the wrong check within this function

@nfahlgren nfahlgren added this to the PlantCV v4.7 milestone Mar 14, 2025
@nfahlgren nfahlgren merged commit 31bd706 into main Mar 14, 2025
5 checks passed
@nfahlgren nfahlgren deleted the update-closing branch March 14, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements to existing features ready to review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants