Serialize Interchange when preparing systems - #170
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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
InterchangeviaForceField.create_interchange(...), serialize it tointerchange.json, and derive the OpenMMSystemviainterchange.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.
| 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"]] |
There was a problem hiding this comment.
Fixed — switched to Molecule.from_smiles which accepts both plain and atom-mapped SMILES.
| 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"), | ||
| ) |
There was a problem hiding this comment.
Fixed — the short-circuit now checks that both openmm_system.xml and interchange.json exist before returning early.
| 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"]], | ||
| ) |
There was a problem hiding this comment.
Fixed — switched to Molecule.from_smiles which accepts both plain and atom-mapped SMILES.
Co-authored-by: mattwthompson <7935382+mattwthompson@users.noreply.github.com>
…rialize-interchange

No description provided.