Python wrappers for TUV-x Profile and ProfileMap#611
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/develop-598-profile/ |
There was a problem hiding this comment.
Pull Request Overview
This PR adds Python wrappers for the TUV-x Profile and ProfileMap classes and improves error handling in the existing C/C++ wrappers with more specific error codes and descriptive error messages.
- Adds comprehensive Python bindings for Profile and ProfileMap classes with dictionary-style access
- Replaces generic error codes (1) with specific error constants and descriptive messages
- Adds new C/C++ methods for profile management (get by index, remove, count profiles)
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tuvx/profile_map.cpp | Enhanced error handling with specific error codes and added new ProfileMap methods |
| src/tuvx/profile.cpp | Improved error handling and added Profile name/units getter methods |
| src/tuvx/interface_profile_map.F90 | Added Fortran implementations for new ProfileMap functionality |
| src/tuvx/interface_profile.F90 | Added Profile name/units getters and improved error handling |
| musica/profile_map.py | Python wrapper with dictionary-style ProfileMap interface |
| musica/profile.py | Python wrapper for Profile class with numpy array integration |
| musica/profile_map.cpp | Python C++ bindings for ProfileMap class |
| musica/profile.cpp | Python C++ bindings for Profile class |
| Test files | Comprehensive unit tests for Profile and ProfileMap functionality |
Comments suppressed due to low confidence (5)
src/tuvx/interface_profile.F90:1
- These assignments set error_code to success after the operations complete, but they should only be set if no error occurred. This could mask errors that happened during the array operations.
! Copyright (C) 2023-2025 National Center for Atmospheric Research
src/tuvx/interface_profile.F90:1
- These assignments set error_code to success after the operations complete, but they should only be set if no error occurred. This could mask errors that happened during the array operations.
! Copyright (C) 2023-2025 National Center for Atmospheric Research
src/tuvx/interface_profile.F90:1
- These assignments set error_code to success after the operations complete, but they should only be set if no error occurred. This could mask errors that happened during the array operations.
! Copyright (C) 2023-2025 National Center for Atmospheric Research
src/tuvx/interface_profile.F90:1
- These assignments set error_code to success after the operations complete, but they should only be set if no error occurred. This could mask errors that happened during the array operations.
! Copyright (C) 2023-2025 National Center for Atmospheric Research
src/tuvx/interface_profile.F90:1
- These assignments set error_code to success after the operations complete, but they should only be set if no error occurred. This could mask errors that happened during the array operations.
! Copyright (C) 2023-2025 National Center for Atmospheric Research
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 #611 +/- ##
==========================================
- Coverage 79.92% 78.65% -1.28%
==========================================
Files 54 54
Lines 6367 6783 +416
==========================================
+ Hits 5089 5335 +246
- Misses 1278 1448 +170 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
boulderdaze
left a comment
There was a problem hiding this comment.
Looks good! It might be helpful to organize the files under musica/ in a more hierarchical structure, as the number of files is growing and it doesn't seem to have a clear structure right now. This isn't something related to this task, though. Just one thing that I noticed while reviewing this.
This PR adds Python wrappers for the TUV-x Profile and ProfileMap classes. Also, updates existing C/C++ Profile and ProfileMap wrappers to return more meaningful error codes and messages.
closes #598