Add dose rates to TUV-x Python output#595
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/develop-tuvx-python/ |
There was a problem hiding this comment.
Pull Request Overview
This PR adds dose rate calculations as a new output to the TUV-x Python API, expanding the functionality beyond photolysis rates and heating rates. The changes integrate dose rate functionality throughout the C++/Fortran interface stack and update the Python API to support both file-based and string-based configuration initialization.
Key changes include:
- Addition of dose rate calculation support in C++ and Fortran interfaces
- Enhanced Python API to support JSON/YAML string configurations in addition to file-based configurations
- Replacement of placeholder rate labeling functions with actual TUV-x API implementations
- Removal of diagnostic output settings from configuration files
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tuvx/tuvx_c_interface.cpp | Adds GetDoseRatesOrdering function to C interface |
| src/tuvx/tuvx.cpp | Implements dose rate support and config string initialization |
| src/tuvx/interface.F90 | Adds Fortran dose rate functions and config string parsing |
| src/test/data/tuvx/fixed/config.json | Updates test configuration with dose rates and additional layers |
| musica/tuvx.py | Enhances Python API with dose rates and string config support |
| musica/tuvx.cpp | Updates Python bindings for dose rates and new config methods |
| musica/test/integration/test_tuvx.py | Adds comprehensive tests for new functionality |
| include/musica/tuvx/tuvx_c_interface.hpp | Updates C interface header with dose rate declarations |
| include/musica/tuvx/tuvx.hpp | Updates C++ class header with dose rate methods |
| configs/tuvx/tuv_5_4.json | Removes diagnostic output settings |
| configs/tuvx/data/photolysis_rate_constants.json | Removes diagnostic output settings |
| configs/tuvx/data/dose_rates.json | Removes diagnostic output settings |
| cmake/dependencies.cmake | Updates TUV-x dependency version |
Comments suppressed due to low confidence (2)
musica/tuvx.py:1
- The names variable is a dictionary (dict[str, int]) but .index() method is being called on it. Use
names[reaction_name]to get the index value instead.
"""
musica/tuvx.py:1
- The temporary file is deleted when the context manager exits, but TUVX constructor may need to read the file after this function returns. Use
delete=Falseand handle cleanup manually, or passconfig_path=temp_file.nameto ensure the file exists when needed.
"""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #595 +/- ##
==========================================
- Coverage 81.14% 80.81% -0.34%
==========================================
Files 54 54
Lines 6015 6040 +25
==========================================
Hits 4881 4881
- Misses 1134 1159 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
boulderdaze
left a comment
There was a problem hiding this comment.
Thank you for answering the questions!
This PR adds dose rates as an output to the TUV-x Python API.
Also: