@@ -80,31 +80,38 @@ def test_openmm_run_engine(
8080
8181 assert r .ok ()
8282
83- # get the path to the simulation unit shared dict
84- for pur in r .protocol_unit_results :
85- if "Simulation" in pur .name :
86- sim_shared = tmpdir / f"shared_{ pur .source_key } _attempt_0"
87- assert sim_shared .exists ()
88- assert pathlib .Path (sim_shared ).is_dir ()
89-
90- # check the analysis outputs
91- for pur in r .protocol_unit_results :
92- if "Analysis" not in pur .name :
93- continue
94-
95- unit_shared = tmpdir / f"shared_{ pur .source_key } _attempt_0"
96- assert unit_shared .exists ()
97- assert pathlib .Path (unit_shared ).is_dir ()
98-
99- # Does the checkpoint file exist?
100- checkpoint = pur .outputs ["checkpoint" ]
101- assert checkpoint == sim_shared / f"{ pur .outputs ['simtype' ]} _checkpoint.nc"
102- assert checkpoint .exists ()
103-
104- # Does the trajectory file exist?
105- nc = pur .outputs ["trajectory" ]
106- assert nc == sim_shared / f"{ pur .outputs ['simtype' ]} .nc"
107- assert nc .exists ()
83+ # Check outputs of solvent & vacuum results
84+ for phase in ["solvent" , "vacuum" ]:
85+ purs = [
86+ pur for pur in r .protocol_unit_results
87+ if pur .outputs ["simtype" ] == phase
88+ ]
89+
90+ # get the path to the simulation unit shared dict
91+ for pur in purs :
92+ if "Simulation" in pur .name :
93+ sim_shared = tmpdir / f"shared_{ pur .source_key } _attempt_0"
94+ assert sim_shared .exists ()
95+ assert pathlib .Path (sim_shared ).is_dir ()
96+
97+ # check the analysis outputs
98+ for pur in purs :
99+ if "Analysis" not in pur .name :
100+ continue
101+
102+ unit_shared = tmpdir / f"shared_{ pur .source_key } _attempt_0"
103+ assert unit_shared .exists ()
104+ assert pathlib .Path (unit_shared ).is_dir ()
105+
106+ # Does the checkpoint file exist?
107+ checkpoint = pur .outputs ["checkpoint" ]
108+ assert checkpoint == sim_shared / f"{ pur .outputs ['simtype' ]} _checkpoint.nc"
109+ assert checkpoint .exists ()
110+
111+ # Does the trajectory file exist?
112+ nc = pur .outputs ["trajectory" ]
113+ assert nc == sim_shared / f"{ pur .outputs ['simtype' ]} .nc"
114+ assert nc .exists ()
108115
109116 # Test results methods that need files present
110117 results = protocol .gather ([r ])
0 commit comments