Skip to content

Quick filter performance#1878

Open
nfahlgren wants to merge 450 commits intomainfrom
quick-filter-performance
Open

Quick filter performance#1878
nfahlgren wants to merge 450 commits intomainfrom
quick-filter-performance

Conversation

@nfahlgren
Copy link
Member

@nfahlgren nfahlgren commented Feb 18, 2026

Describe your changes
The pcv.roi.quick_filter method was added to improve the performance of pcv.roi.filter. While it is significantly faster, this PR aims to improve performance a little more. The updated approach only impacts the partial overlap method (the slowest). The core update is that the labeled mask + ROI mask is first condensed to a set of unique pixel values and these are filtered for values where a label and the ROI intersect. Then only these objects are added to the output mask. The performance of this approach will be faster when there are more objects outside the ROI because the old approach iterated over all objects.

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

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

@nfahlgren nfahlgren added this to the PlantCV v5.0 milestone Feb 18, 2026
@nfahlgren nfahlgren added enhancement Enhancements to existing features ready to review labels Feb 18, 2026
@deepsource-io
Copy link

deepsource-io bot commented Feb 18, 2026

DeepSource Code Review

DeepSource reviewed changes in the commit range ebe54de..aa1acf4 on this pull request. Below is the summary for the review, and you can see the individual issues we found as review comments.

For detailed review results, please see the PR on DeepSource ↗

PR Report Card

Security × 0 issues Overall PR Quality   

Focus Area: Reliability

Guidance
7 high-severity cyclic import issues detected primarily in `tests/plantcv/visualize/test_color_correction_scatter.py`.
Reliability × 7 issues
Complexity × 0 issues
Hygiene × 1 issue
Coverage × 0 issues

Code Review Summary

Analyzer Status Summary Details
Python 8 new issues detected. 1 existing issue fixed. Review ↗
Test coverage No new issues detected. Review ↗
How are these analyzer statuses calculated?

Administrators can configure which issue categories are reported and cause analysis to be marked as failed when detected. This helps prevent bad and insecure code from being introduced in the codebase. If you're an administrator, you can modify this in the repository's settings.

Code Coverage Summary

Language Line Coverage Branch Coverage
New Code Overall New Code Overall
Aggregate
100%
[✓ above threshold]
100%
100%
100%
Python
100%
[✓ above threshold]
100%
100%
100%

➟ Additional coverage metrics may have been reported. See full coverage report ↗

@nfahlgren nfahlgren added work in progress Mark work in progress and removed ready to review labels Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancements to existing features work in progress Mark work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants