Skip to content

Serialize Interchange when preparing systems - #170

Merged
mattwthompson merged 4 commits into
mainfrom
serialize-interchange
Sep 25, 2026
Merged

mattwthompson merged 4 commits into
mainfrom
serialize-interchange

Conversation

@mattwthompson

Copy link
Copy Markdown
Member

No description provided.

@codecov-commenter

codecov-commenter commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.39%. Comparing base (727332b) to head (d126d50).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   81.37%   81.39%   +0.01%     
==========================================
  Files          56       56              
  Lines        5064     5068       +4     
==========================================
+ Hits         4121     4125       +4     
  Misses        943      943              

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

Copilot review overview

🟡 Changes recommended

The prepare/minimize steps now assume mapped SMILES and the prepare short-circuit should verify interchange.json exists too, otherwise common configs and downstream consumers can break.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 Medium severity

Open (3)
What changed in this PR

This PR updates the compute preparation pipeline to serialize an OpenFF Interchange object alongside the OpenMM System, and adjusts downstream code/tests and golden test data to reflect the new serialization and resulting simulation outputs.

Changes:

  • Generate an Interchange via ForceField.create_interchange(...), serialize it to interchange.json, and derive the OpenMM System via interchange.to_openmm().
  • Update preparation/minimization code to construct molecules via Molecule.from_mapped_smiles(...).
  • Refresh preparation tests and sample-density golden artifacts (PDB remark date, CSV outputs, target config id).
File Description
tyff/​compute/​_prepare.py Writes interchange.json during system preparation and converts Interchange → OpenMM.
tyff/​compute/​_minimize.py Uses mapped SMILES when reconstructing molecules for minimization topology building.
tyff/​compute/​_files.py Adds interchange: File to PreparingFiles.
tyff/​_tests/​data/​app_files/​sample_density/​target_config.json Updates sample target identifier.
tyff/​_tests/​data/​app_files/​sample_density/​production.csv Updates golden production trajectory state data.
tyff/​_tests/​data/​app_files/​sample_density/​packed_topology.pdb Updates PDB remark timestamp in golden packed topology.
tyff/​_tests/​data/​app_files/​sample_density/​equilibration.csv Updates golden equilibration trajectory state data.
tyff/​_tests/​compute/​test_prepare.py Extends short-circuit test to validate loading serialized Interchange + OpenMM system.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tyff/compute/_minimize.py Outdated
temperature = compute_config["temperature"]

molecules = [Molecule.from_smiles(smiles) for smiles in compute_config["smiles"]]
molecules = [Molecule.from_mapped_smiles(smiles) for smiles in compute_config["smiles"]]

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 — switched to Molecule.from_smiles which accepts both plain and atom-mapped SMILES.

Comment thread tyff/compute/_prepare.py
Comment on lines 27 to 31
files = PreparingFiles(
openmm_system=File(f"{job_dir}/openmm_system.xml"),
interchange=File(f"{job_dir}/interchange.json"),
packed_topology=File(f"{job_dir}/packed_topology.pdb"),
)

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 — the short-circuit now checks that both openmm_system.xml and interchange.json exist before returning early.

Comment thread tyff/compute/_prepare.py
Comment on lines 42 to 45
packed_topology: Topology = Topology.from_pdb(
file_path=packing_files["packed_topology"].filepath,
unique_molecules=[Molecule.from_smiles(smiles) for smiles in compute_config["smiles"]],
unique_molecules=[Molecule.from_mapped_smiles(smiles) for smiles in compute_config["smiles"]],
)

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 — switched to Molecule.from_smiles which accepts both plain and atom-mapped SMILES.

mattwthompson and others added 2 commits September 25, 2026 09:45
Co-authored-by: mattwthompson <7935382+mattwthompson@users.noreply.github.com>
@mattwthompson
mattwthompson marked this pull request as ready for review September 25, 2026 15:03
@mattwthompson
mattwthompson merged commit 1e50c4d into main Sep 25, 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