Skip to content

Allow optional setting of temperature and pressure#593

Merged
mattldawson merged 1 commit intomainfrom
develop-set-conditions
Sep 3, 2025
Merged

Allow optional setting of temperature and pressure#593
mattldawson merged 1 commit intomainfrom
develop-set-conditions

Conversation

@mattldawson
Copy link
Copy Markdown
Collaborator

This PR updates the MUSICA Python API to allow optional inclusion of temperature and/or pressure in the set_conditions() function. If either is not included, the current temperature/pressure value remains unchanged. This will be used in MusicBox when evolving conditions are set (which may or may not need to update the temperature/pressure).

Also adds unit tests for the Python State wrapper class

@mattldawson mattldawson self-assigned this Sep 3, 2025
Copilot AI review requested due to automatic review settings September 3, 2025 17:06
@mattldawson mattldawson added the bug Something isn't working label Sep 3, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 3, 2025

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 enhances the MUSICA Python API to make temperature and pressure parameters optional in the set_conditions() method, allowing for selective updates of environmental conditions while leaving unchanged parameters intact. This flexibility supports use cases where only specific conditions need to be updated during model evolution.

  • Makes temperature and pressure parameters optional in State.set_conditions()
  • Adds comprehensive unit tests for the Python State wrapper class
  • Updates surface reaction label prefixing to use "SURF." prefix

Reviewed Changes

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

Show a summary per file
File Description
musica/types.py Modified set_conditions() to accept optional temperature/pressure parameters and added default solver type handling
musica/test/unit/test_state.py Added comprehensive unit tests covering State class functionality including initialization, concentration/condition management, and parameter handling
src/micm/v1_parse.cpp Updated convert_surface function to accept prefix parameter and apply "SURF." prefix to surface reaction labels
musica/examples/sulfate_box_model.py Reduced simulation time from 2 hours to 30 minutes
docker/Dockerfile.python Added WORKDIR directive

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.14%. Comparing base (50a1d4d) to head (fd1fbfe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #593   +/-   ##
=======================================
  Coverage   81.14%   81.14%           
=======================================
  Files          54       54           
  Lines        6015     6015           
=======================================
  Hits         4881     4881           
  Misses       1134     1134           

☔ 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 b1b1893 into main Sep 3, 2025
68 checks passed
@mattldawson mattldawson deleted the develop-set-conditions branch September 3, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants