Skip to content

Adds tests checking ability to update TUV-x conditions#705

Merged
K20shores merged 4 commits intoNCAR:mainfrom
mattldawson:develop-601-update-grid-profile
Dec 24, 2025
Merged

Adds tests checking ability to update TUV-x conditions#705
K20shores merged 4 commits intoNCAR:mainfrom
mattldawson:develop-601-update-grid-profile

Conversation

@mattldawson
Copy link
Copy Markdown
Collaborator

This PR adds a test that ensures that TUV-x profiles can be updated via the Python API. (The functionality was already in place to satisfy #601)

Adding this test revealed some incomplete functionality in initializing profiles that was added. Also, unrealistic test conditions were leading to zeros and NaNs in the TUV-x output. These conditions were adjusted to ensure non-negative real values for photolysis rate constants. More comprehensive testing of the calculated rates should be added, possibly as part of #603

closes #601

Copilot AI review requested due to automatic review settings December 5, 2025 20:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive testing for updating TUV-x atmospheric profiles through the Python API and improves profile initialization with automatic layer density calculation. The changes ensure more realistic test conditions by adjusting the vertical profile distribution and solar zenith angle, preventing the zeros and NaNs that were previously occurring in photolysis rate calculations.

  • Adds automatic layer density calculation option in Profile initialization
  • Implements automatic edge value calculation from midpoints (and vice versa)
  • Updates test profiles to use realistic atmospheric distributions centered near ground level
  • Adds validation test ensuring profile updates correctly affect photolysis rate calculations

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.

File Description
python/musica/tuvx/profile.py Adds calculate_layer_densities parameter and automatic edge/midpoint value calculation logic
python/test/integration/test_tuvx.py Updates profile initialization with new parameters, adjusts test conditions to realistic values (SZA=0.3, ground-centered profiles), adds test for profile update functionality with validation assertions
.gitignore Adds python_build/ to ignored directories for build artifacts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.15%. Comparing base (b9a9afa) to head (d72d36d).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
python/musica/tuvx/profile.py 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #705      +/-   ##
==========================================
- Coverage   81.55%   76.15%   -5.41%     
==========================================
  Files         114      105       -9     
  Lines        9912     7792    -2120     
==========================================
- Hits         8084     5934    -2150     
- Misses       1828     1858      +30     
Flag Coverage Δ
cpp_fortran 69.61% <ø> (-10.11%) ⬇️
javascript 90.87% <ø> (-1.26%) ⬇️
python 82.75% <91.66%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@K20shores K20shores merged commit d48ec6f into NCAR:main Dec 24, 2025
68 of 79 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.

Allow updates to grid and profile data via the Python TUV-x class

4 participants