From 3b0657048731227004c056b5dbd04fcb43771e33 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 21 Nov 2024 09:47:34 +0100 Subject: [PATCH 1/3] remove extra itp files from being written into topol file --- vermouth/gmx/topology.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vermouth/gmx/topology.py b/vermouth/gmx/topology.py index ccd537c3..07a4b0dd 100644 --- a/vermouth/gmx/topology.py +++ b/vermouth/gmx/topology.py @@ -148,16 +148,15 @@ def write_gmx_topology(system, raise ValueError("No molecule in the system. Nothing to write.") include_string = "" + external_itps = [] # First we write the atomtypes directive if "atomtypes" in system.gmx_topology_params: _path = itp_paths['atomtypes'] write_atomtypes(system, _path, C6C12) - include_string += f'\n #include "{_path}"' # Next we write the nonbond_params directive if "nonbond_params" in system.gmx_topology_params: _path = itp_paths['nonbond_params'] write_nonbond_params(system, _path, C6C12) - include_string += f'\n #include "{_path}"\n' # Write the ITP files for the molecule types, and prepare writing the # [ molecules ] section of the top file. # * We write one ITP file for each different moltype in the system, the From 1dcd341e0b355203453396f3db6656438b61c5ee Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 21 Nov 2024 09:49:49 +0100 Subject: [PATCH 2/3] remove extra itp files from being written into topol file --- vermouth/gmx/topology.py | 1 - 1 file changed, 1 deletion(-) diff --git a/vermouth/gmx/topology.py b/vermouth/gmx/topology.py index 07a4b0dd..28584e09 100644 --- a/vermouth/gmx/topology.py +++ b/vermouth/gmx/topology.py @@ -148,7 +148,6 @@ def write_gmx_topology(system, raise ValueError("No molecule in the system. Nothing to write.") include_string = "" - external_itps = [] # First we write the atomtypes directive if "atomtypes" in system.gmx_topology_params: _path = itp_paths['atomtypes'] From 88084848aa9b1823f56d6864b7215dd34635c9bc Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 21 Nov 2024 11:08:52 +0100 Subject: [PATCH 3/3] fix topology file test --- vermouth/tests/gmx/test_topology.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/vermouth/tests/gmx/test_topology.py b/vermouth/tests/gmx/test_topology.py index 659612f0..a413d4d4 100644 --- a/vermouth/tests/gmx/test_topology.py +++ b/vermouth/tests/gmx/test_topology.py @@ -193,9 +193,6 @@ def test_toplevel_topology(tmp_path, dummy_molecule): reference =f"""#define random #include "martini.itp" - -#include "{tmp_path}/atomtypes.itp" -#include "{tmp_path}/nonbond_params.itp" #include "molecule_0.itp" [ system ]