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

Add segment_ends and Update morphology tips outputs #1644

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

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 saves both ends, the tip coordinates and the coordinates of the segment touching the branch point.

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 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 432fcd2..a38e353. 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.

@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels Jan 3, 2025
@HaleySchuhl
Copy link
Contributor Author

Jan 3 updates: the deepsource complaint about the complexity of segment_insertion_angle will be resolved in another PR branch (called "update_segment_insertion_angle").

While thinking about how to get biologically-ordered observations out from a morphology workflow given this new function, there is a reason to return a re-ordered list of objects. These can then get used downstream to get consistently labeled leaf segment observations.

@HaleySchuhl HaleySchuhl added work in progress Mark work in progress and removed ready to review labels Jan 3, 2025
@HaleySchuhl HaleySchuhl changed the title Update morphology tips outputs Add segment_ends and Update morphology tips outputs Jan 30, 2025
@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels Jan 30, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the context is incomplete, just needs the end of that sentence about grass species.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, in the example usage there is a parenthesis missing, and I think the two segment_id examples are reversed? Should the "without id reassignment" example be with leaf_objs, not sorted_obs?

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: Pull Requests
Development

Successfully merging this pull request may close these issues.

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