Skip to content

Add analyze.spectral for index summary stats with vectorized efficiency#50

Merged
joshqsumner merged 47 commits intomainfrom
add_analyze_spectral
Oct 29, 2025
Merged

Add analyze.spectral for index summary stats with vectorized efficiency#50
joshqsumner merged 47 commits intomainfrom
add_analyze_spectral

Conversation

@HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented Aug 27, 2025

Describe your changes
Adds a geospatial analysis function for spectral indices, which can be calculated from geo-tifs using pcv.spectral_index._.

Type of update
Is this a:

  • New feature
  • Work in progress

Associated issues

Additional context
Similar trait data as pcv.analyze.spectral_index which is very slow with many objects of interest, except the geospatial algorithm is suitable for large georeferenced data with hundreds or thousands of replicates due to the vectorized approach of rasterstats package.

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-geospatial/mkdocs.yml
  • Changes to function input/output signatures added to changelog.md
  • Code reviewed
  • PR approved

@deepsource-io
Copy link

deepsource-io bot commented Aug 27, 2025

Here's the code health analysis summary for commits 326b577..2dbe657. 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%100%

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

@HaleySchuhl HaleySchuhl marked this pull request as ready for review September 2, 2025 18:48
@joshqsumner joshqsumner self-requested a review September 3, 2025 20:05
Copy link
Contributor

@joshqsumner joshqsumner left a comment

Choose a reason for hiding this comment

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

Made some edits for flexibility in what percentiles are calculated but I think this is good to go. Worth you or @k034b363 taking a look at the edits I made (mainly percentile argument) to see if it is done in a way that makes sense to other people too.

@k034b363 k034b363 self-requested a review September 10, 2025 20:33
@joshqsumner joshqsumner merged commit ebe7fd4 into main Oct 29, 2025
5 checks passed
@joshqsumner joshqsumner deleted the add_analyze_spectral branch October 29, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analyze.spectral_index with zonal_stats

3 participants