Repository navigation
Update pressure handling - #205
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=======================================
Coverage 83.61% 83.61%
=======================================
Files 58 58
Lines 5195 5195
=======================================
Hits 4344 4344
Misses 851 851 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The gas-phase path this PR enables now lets pressure=None reach the unchanged TensorReporter calls (pressure=pressure * openmm.unit.kilopascal) in _equilibrate.py and _produce.py, which raise a TypeError for None, so gas-phase runs still fail.
2 open issues
What changed in this PR
This PR reworks pressure handling so that gas-phase NVT "simulations" no longer require a pressure value. Previously the compute config required a non-null pressure and the equilibration/production steps raised PressureNotDefinedError whenever pressure was None, which caused gas-phase jobs (where pressure is irrelevant) to fail inside the Parsl machinery (issue #203). The change makes pressure nullable and restricts the "pressure required" guard to liquid NPT runs only.
Changes:
BaseComputeConfig.pressureis nowfloat | None, and gas configs are created withpressure=None.- The
PressureNotDefinedErrorguard is moved inside thetag == "liquid"branch in both_equilibrate.pyand_produce.py. - Documentation/tests updated to assert liquid configs carry a non-null pressure and gas configs carry
None.
| File | Description |
|---|---|
| tyff/configs/_compute.py | Makes pressure nullable (`float |
| tyff/configs/gas.py | Adds a docstring noting pressure should always be None for vacuum/gas. |
| tyff/compute/prep.py | Builds gas configs with pressure=None instead of copying the data entry pressure. |
| tyff/compute/_produce.py | Moves the pressure-required guard inside the liquid branch. |
| tyff/compute/_equilibrate.py | Moves the pressure-required guard inside the liquid branch. |
| tyff/_tests/compute/test_prep.py | Asserts liquid configs have non-null pressure and gas configs have None. |
Review effort: Balanced
| # let pressure be None for gas-phase NVT simulations, including reporting as None to TensorReporter later | ||
| pressure = compute_config.get("pressure", None) |
There was a problem hiding this comment.
Fixed by guarding the reporter pressure before the gas-phase TensorReporter call: pressure is converted to None when absent and is only multiplied by kPa inside the liquid-only path. The liquid PressureNotDefinedError guard remains in place. Commit: 1b9a02a.
| # let pressure be None for gas-phase NVT simulations, including reporting as None to TensorReporter later | ||
| pressure = compute_config.get("pressure", None) |
Co-authored-by: mattwthompson <7935382+mattwthompson@users.noreply.github.com>

From a meeting with @lilyminium we decided #204 was planned incorrectly: #203 (comment)