Allow optional setting of temperature and pressure#593
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/develop-set-conditions/ |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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