Skip to content

Conversation

HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented Dec 19, 2024

Describe your changes

  • Moves _iterative_prune into the _helper.py file to avoid circular imports (this unfortunately touches most of the functions in this package)
  • update find_tips (adds a helper function _find_tips that is used internally by many functions and doesn't store outputs so they do not accidentally get overwritten)
  • adds pcv.morphology.segment_ends which returns: Re-ordered leaf segments, debug image, list of branch point coordinates, list of leaf tip coordinates
  • bugfix to pcv.morphology.analyze_stem where the label=None was causing no data to get saved to Outputs. Resolved by updating with appropriate labels.

Type of update
Is this a:

  • Bug fix
  • New feature or feature enhancement

Associated issues

Additional context

  • Using the internal segment end coordinates for leaf ID order
  • The saved skeleton tips coordinates to Outputs was easily overwritten by other morphology functions that utilize the pcv.morphology.find_tips function.
  • the deepsource complaint about the complexity of segment_insertion_angle will be resolved later in another PR branch (called "update_segment_insertion_angle")
    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

@HaleySchuhl HaleySchuhl added new feature New feature ideas and solutions bugfix Bug fixes work in progress Mark work in progress update Updates an existing feature/method labels Dec 19, 2024
@HaleySchuhl HaleySchuhl self-assigned this Dec 19, 2024
Copy link

deepsource-io bot commented Dec 19, 2024

Here's the code health analysis summary for commits f4caba5..5b45790. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 1 occurence introduced
🎯 1 occurence resolved
View 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.

decided to go with returning a list of sorted objects instead of a list of re-sorting IDs
missing branch points, in the case of disconnected leaves, will not be sortable so remove them from returned resorted segments
@HaleySchuhl HaleySchuhl added work in progress Mark work in progress and removed ready to review labels Apr 28, 2025
@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels May 1, 2025
Copy link
Contributor

@k034b363 k034b363 left a comment

Choose a reason for hiding this comment

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

Looks good to me, it works the way I would expect it to and reorders branches to something biologically meaningful on both well behaved and less clean maize pictures. The movement of some functions to helpers makes the previously complex morphology functions quite a bit easier to read as well.

@nfahlgren nfahlgren added this to the PlantCV v4.8 milestone May 19, 2025
@nfahlgren nfahlgren merged commit ff5a53d into main May 19, 2025
4 of 5 checks passed
@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 May 19, 2025
@nfahlgren nfahlgren deleted the update_morphology_tips_outputs branch May 19, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bug fixes new feature New feature ideas and solutions ready to review update Updates an existing feature/method
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Skeleton tips easily overwritten within the plantcv.morphology sub-package
3 participants