Skip to content

Update pressure handling - #205

Merged
mattwthompson merged 4 commits into
mainfrom
fix-gas-pressure
Oct 19, 2026
Merged

mattwthompson merged 4 commits into
mainfrom
fix-gas-pressure

Conversation

@mattwthompson

@mattwthompson mattwthompson commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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

@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.61%. Comparing base (6f3e337) to head (0bd185f).

Files with missing lines Patch % Lines
tyff/compute/_produce.py 0.00% 3 Missing ⚠️
tyff/compute/_equilibrate.py 0.00% 2 Missing ⚠️
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.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.pressure is now float | None, and gas configs are created with pressure=None.
  • The PressureNotDefinedError guard is moved inside the tag == "liquid" branch in both _equilibrate.py and _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

Comment on lines +95 to 96
# let pressure be None for gas-phase NVT simulations, including reporting as None to TensorReporter later
pressure = compute_config.get("pressure", None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread tyff/compute/_produce.py
Comment on lines +94 to +95
# 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>
@mattwthompson
mattwthompson marked this pull request as ready for review October 19, 2026 22:48
@mattwthompson
mattwthompson merged commit 2ec99d3 into main Oct 19, 2026
5 checks passed
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.

4 participants