Skip to content

Conversation

@iosefa
Copy link
Owner

@iosefa iosefa commented Oct 8, 2025

ref #31

Add canopy cover metric

  • Implements canopy cover calculation and exports in init.
  • Refines zero-return column masking in calculate.py/process.py.
  • Updates example notebook and adds usage docs.
  • Extends tests in tests/test_calculate.py.

iosefa added 3 commits October 2, 2025 14:43
- calculate: add  using 1 − exp(−k·PAIabove(z))
- process: support  with  and  options
- api: export  in
- tests: add unit tests for canopy cover (expected value, zero PAD, NaNs, monotonic with z)
- docs: add canopy cover usage page, link from intro, and update example notebook to compute and plot cover (z=2 m)

Signed-off-by: iosefa <[email protected]>
Improved masking by targeting columns with zero returns across all Z levels, ensuring accuracy in handling truly empty columns.
@iosefa iosefa self-assigned this Oct 8, 2025
@iosefa iosefa requested a review from benleamon October 8, 2025 21:36
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyforestscan/process.py 18.18% 9 Missing ⚠️
pyforestscan/utils.py 42.85% 8 Missing ⚠️
pyforestscan/calculate.py 85.71% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
pyforestscan/__init__.py 100.00% <100.00%> (ø)
tests/test_calculate.py 100.00% <100.00%> (ø)
tests/test_utils.py 96.15% <100.00%> (+0.50%) ⬆️
pyforestscan/calculate.py 87.14% <85.71%> (-0.36%) ⬇️
pyforestscan/utils.py 76.82% <42.85%> (-6.51%) ⬇️
pyforestscan/process.py 43.51% <18.18%> (-2.84%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@iosefa iosefa requested a review from cankanoa October 8, 2025 22:07
- Enhance error handling for malformed or missing bounds data.
- Support multiple bounds formats, including list/tuple and dictionary.
- Update related test cases for better coverage and assertions.
- Adjust docstring for clarity and updated argument descriptions.
cankanoa
cankanoa previously approved these changes Oct 9, 2025
Copy link
Collaborator

@cankanoa cankanoa left a comment

Choose a reason for hiding this comment

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

Looks great!

- Replace random voxel returns with structured values to avoid flaky test behavior.
- Add columns for entropy edge cases: single-bin mass (entropy 0) and uniform distribution (maximal entropy).
@iosefa iosefa merged commit bf15b74 into main Oct 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants