Skip to content

Add CARMA#418

Merged
K20shores merged 19 commits intomainfrom
develop-add-carma
Jul 15, 2025
Merged

Add CARMA#418
K20shores merged 19 commits intomainfrom
develop-add-carma

Conversation

@mattldawson
Copy link
Copy Markdown
Collaborator

This PR adds CARMA to MUSICA C and Python. Currently the only thing you can do is query the version of CARMA through both APIs

@mattldawson mattldawson added this to the CARMA milestone Jul 11, 2025
@mattldawson mattldawson added the enhancement New feature or request label Jul 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

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 integrates the CARMA aerosol model into MUSICA’s C, C++, and Python interfaces, enabling users to query the CARMA version via all APIs.

  • Adds Fortran-to-C interface routines for CARMA version retrieval and matching free functions
  • Implements C API and C++ CARMA::GetVersion(), Python bindings, and unit tests
  • Updates CMake, packaging, CI, and documentation to conditionally build and expose CARMA

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tuvx/tuvx.cpp Updated InternalFreeTuvxVersion call to include version_length
src/tuvx/interface.F90 Adjusted TUVX interface to null-terminate strings and free memory
src/carma/interface.F90 Added Fortran interface routines for CARMA version retrieval
src/carma/carma_c_interface.cpp Implemented C API GetCarmaVersion and matching free calls
src/carma/carma.cpp Added CARMA::GetVersion() method
src/CMakeLists.txt Integrated CARMA sources into the main build
src/packaging/CMakeLists.txt Installed CARMA target alongside MUSICA exports
spack/packages/musica/package.py Introduced +carma variant and dependencies
musica/carma.py Exposed musica.carma.version and CARMA class
musica/carma.cpp Added PyBind11 binding for CARMA version
musica/backend.py Added carma_available() check
musica/init.py Exported CARMA in the public API
CMakeLists.txt Added MUSICA_ENABLE_CARMA option and enabled Fortran when needed
.github/workflows/ubuntu.yml Updated CI matrix to include CARMA build flag
README.md Documented CARMA component in project overview
Comments suppressed due to low confidence (3)

musica/binding_common.cpp:20

  • [nitpick] The submodule description refers to a photolysis calculator (TUVX). Please update it to correctly describe CARMA as the aerosol model.
  py::module_ carma = m.def_submodule("_carma", "Wrapper classes for CARMA photolysis calculator");

.github/workflows/ubuntu.yml:26

  • The CI matrix never enables CARMA. Add at least one combination with carma: ON to exercise the CARMA backend in CI.
          - {micm: ON, tuvx: OFF, carma: OFF, python: ON}

include/musica/carma/carma_c_interface.hpp:17

  • [nitpick] Document that the caller is responsible for freeing the returned pointer (e.g., using delete[]) or provide a matching FreeCarmaVersion function for C consumers.
  char* GetCarmaVersion();

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 9 lines in your changes missing coverage. Please review.

Project coverage is 83.63%. Comparing base (1880ced) to head (7a4c9ee).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/tuvx/interface.F90 0.00% 8 Missing ⚠️
src/carma/carma.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   86.62%   83.63%   -2.99%     
==========================================
  Files          44       48       +4     
  Lines        3894     4093     +199     
==========================================
+ Hits         3373     3423      +50     
- Misses        521      670     +149     

☔ 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.

Copy link
Copy Markdown
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

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

Looks good!

@K20shores K20shores merged commit 970c092 into main Jul 15, 2025
73 of 74 checks passed
@K20shores K20shores deleted the develop-add-carma branch July 15, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants