Adds tests checking ability to update TUV-x conditions#705
Adds tests checking ability to update TUV-x conditions#705
Conversation
There was a problem hiding this comment.
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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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