Add tuvx into the python build for linux and macos#409
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/add_tuv_python_build/ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
- Coverage 87.15% 86.62% -0.54%
==========================================
Files 43 43
Lines 3870 3894 +24
==========================================
Hits 3373 3373
- Misses 497 521 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the TUV-x photolysis calculator into the Python build by exposing version information and wiring Fortran/C++/Python bindings, updating build configuration, and adding a basic smoke test for version retrieval.
- Add
GetVersionC++ method and matching Fortran interface for TUV-x version strings - Introduce
MUSICA_USE_TUVXflag in CMake and enable Python‐only build mode - Provide Python bindings (
musica/tuvx.py,musica/tuvx.cpp) and a pytest case forversion
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tuvx/tuvx.cpp | Implements TUVX::GetVersion calling Fortran routines |
| src/tuvx/interface.F90 | Adds internal_get/internal_free Fortran routines |
| include/musica/tuvx/tuvx.hpp | Declares GetVersion, InternalGetTuvxVersion, InternalFreeTuvxVersion |
| src/CMakeLists.txt | Skips C/C++ build in Python‐only mode |
| cmake/setup_musica_target.cmake | Defines MUSICA_USE_TUVX compile definition |
| cmake/dependencies.cmake | Pins TUV-x git tag |
| pyproject.toml | Enables Python‐only build, cleans up dependency lists |
| musica/binding_common.cpp | Conditionally binds the TUV-x module |
| musica/backend.py | Adds tuvx_available() check |
| musica/tuvx.py | Python wrapper for TUVX |
| musica/tuvx.cpp | Pybind11 binding of _get_tuvx_version |
| musica/test/test_tuvx.py | Tests presence and type of version |
| musica/tools/prepare_build_environment_* | Updates platform scripts for macOS/Linux |
| .github/workflows/* | Adjusts CI build/test steps for netCDF and wheel targets |
Comments suppressed due to low confidence (2)
musica/tuvx.py:11
- [nitpick] Fetching
versionat import time may obscure import errors or delay failure. Consider making this a property or a method onTUVXso callers explicitly request it.
version = _backend._tuvx._get_tuvx_version() if backend.tuvx_available() else None
musica/test/test_tuvx.py:8
- This test only verifies that
versionis a non-null string. Consider adding assertions for non-empty or expected version format, and testing theTUVXclass constructor behavior.
version = musica.tuvx.version
This is the second of 3 PRs to address #400
The first PR I tried to make was #393, but that ended up being too large and I split it into 3. The first was #406
This PR adds TUVX into the python build. To do that, I had to use a newer linux image when building the python wheels to get netcdf into the build easily. At this point, we only support macOS and Linux, but it may be possible to support windows; I don't know how to get a fortran compiler on windows with cibibuildhweel and felt like leaving that issue for later.
I created a simple python tuvx class as a place holder and am able to return the tuvx version in python