Skip to content

Fixing calculate atmospheric layer geometry#1352

Merged
davidorme merged 2 commits intodevelopfrom
1351-bug-in-calculate_atmospheric_layer_geometry
Feb 19, 2026
Merged

Fixing calculate atmospheric layer geometry#1352
davidorme merged 2 commits intodevelopfrom
1351-bug-in-calculate_atmospheric_layer_geometry

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Feb 19, 2026

Description

This PR:

  • Fixes a bug in calculate_atmospheric_layer_geometry that was calculating heights between cells rather than between canopy layers.
  • Reworks the compute_layer_thickness_for_varying_canopy function to use a faster parallelized calculation.
  • Adds bottleneck to the package dependencies to speed this calculation up. @dalonsoa I think some of the performance enhancement may be trying to spot where we can use bn

Fixes #1351
Makes partial progress to solving the issues in #1314 (or at least, finds the next bug).

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works
  • Relevant documentation reviewed and updated

@davidorme davidorme linked an issue Feb 19, 2026 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (37d98b2) to head (129f619).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1352      +/-   ##
===========================================
- Coverage    94.96%   94.95%   -0.01%     
===========================================
  Files           71       71              
  Lines         7382     7371      -11     
===========================================
- Hits          7010     6999      -11     
  Misses         372      372              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidorme
Copy link
Copy Markdown
Collaborator Author

@vgro - as you're on leave, I've asked @jacobcook1995 to review this to get the fix down into develop, but you probably want to review this PR!

Copy link
Copy Markdown
Collaborator

@jacobcook1995 jacobcook1995 left a comment

Choose a reason for hiding this comment

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

LGTM, but yes agree @vgro should look at this once she is back

@davidorme davidorme merged commit ac4db90 into develop Feb 19, 2026
13 checks passed
@davidorme davidorme deleted the 1351-bug-in-calculate_atmospheric_layer_geometry branch February 19, 2026 14:53
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.

Bug in calculate_atmospheric_layer_geometry

3 participants