File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1646,15 +1646,17 @@ def _checkpoint(
16461646 _copyfile (traj_filename , f"{ traj_filename } .prev" )
16471647 traj_chunks = [f"{ traj_filename } .prev" ] + traj_chunks
16481648
1649- # Load the topology and chunked trajectory files.
1650- mols = _sr .load ([topology0 ] + traj_chunks )
1649+ # Make sure there are trajectory chunks to process.
1650+ if len (traj_chunks ) > 0 :
1651+ # Load the topology and chunked trajectory files.
1652+ mols = _sr .load ([topology0 ] + traj_chunks )
16511653
1652- # Save the final trajectory to a single file.
1653- _sr .save (mols .trajectory (), traj_filename , format = ["DCD" ])
1654+ # Save the final trajectory to a single file.
1655+ _sr .save (mols .trajectory (), traj_filename , format = ["DCD" ])
16541656
1655- # Now remove the chunked trajectory files.
1656- for chunk in traj_chunks :
1657- _Path (chunk ).unlink ()
1657+ # Now remove the chunked trajectory files.
1658+ for chunk in traj_chunks :
1659+ _Path (chunk ).unlink ()
16581660
16591661 # Add config and lambda value to the system properties.
16601662 system .set_property ("config" , self ._config .as_dict (sire_compatible = True ))
You can’t perform that action at this time.
0 commit comments