Skip to content

Add CARMA_Create features#491

Merged
mattldawson merged 9 commits intomainfrom
develop-469-carma-create
Jul 25, 2025
Merged

Add CARMA_Create features#491
mattldawson merged 9 commits intomainfrom
develop-469-carma-create

Conversation

@mattldawson
Copy link
Copy Markdown
Collaborator

This PR updates the CARMA wrapper to include all options from the CARMA_Create() function in the Python API. It also moves initialization steps to the constructor instead of the Run() function

closes #469

@mattldawson mattldawson requested review from K20shores and Copilot July 24, 2025 21:42
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 updates the CARMA wrapper to include all options from the CARMA_Create() function in the Python API and moves initialization steps from the Run() function to the constructor. The changes refactor the CARMA interface to separate object creation from simulation execution.

Key changes:

  • CARMA instance initialization moved to constructor with parameters
  • Added wavelength bin configuration support with emission flags
  • Split CARMA lifecycle into create, run, and destroy phases

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
valgrind.supp Removes CARMA-specific memory leak suppression rules
src/test/unit/carma/carma_c_api.cpp Updates tests to use constructor-based initialization
src/carma/interface.F90 Splits run function into create/run/destroy phases and adds wavelength support
src/carma/carma_parameters.F90 Adds wavelength bin structure and removes nwave parameter
src/carma/carma.cpp Refactors to use constructor initialization and pointer-based parameter management
musica/test/test_carma.py Updates Python tests to use new constructor pattern
musica/carma.py Adds wavelength bin class and updates parameter structure
musica/carma.cpp Updates Python binding to handle wavelength bins and new API
include/musica/carma/carma_c_interface.hpp Adds wavelength bin structure and updates interface signatures
include/musica/carma/carma.hpp Updates class interface to use constructor initialization
Comments suppressed due to low confidence (1)

src/test/unit/carma/carma_c_api.cpp:56

  • This test is checking for a field params.nwave that no longer exists according to the changes in the parameters structure. This line should be removed or updated to check the new wavelength_bins field.
  EXPECT_EQ(params.dtime, 1800.0);

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 24, 2025

Codecov Report

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

Project coverage is 85.04%. Comparing base (a2dbbd3) to head (2d0b67e).

Files with missing lines Patch % Lines
src/carma/carma.cpp 93.67% 5 Missing ⚠️
src/carma/interface.F90 94.28% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
+ Coverage   84.85%   85.04%   +0.18%     
==========================================
  Files          49       49              
  Lines        4815     4873      +58     
==========================================
+ Hits         4086     4144      +58     
  Misses        729      729              

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

@mattldawson mattldawson merged commit 2a31a4d into main Jul 25, 2025
70 checks passed
@mattldawson mattldawson deleted the develop-469-carma-create branch July 25, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrap CARMA_Create function

4 participants