def nonbond_matrix(): toppath = TEST_DATA + "/struc_build/system.top" topology = Topology.from_gmx_topfile(name="test", path=toppath) topology.preprocess() topology.volumes = {"PEO": 0.43} return NonBondEngine.from_topology(topology.molecules, topology, box=np.array([10., 10., 10.]))
def test_add_positions_from_pdb(): top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/pdb.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.pdb") for meta_mol in top.molecules: for node in meta_mol.molecule.nodes: assert "position" in meta_mol.molecule.nodes[node].keys() for meta_mol in top.molecules: for node in meta_mol.nodes: assert "position" in meta_mol.nodes[node].keys() assert meta_mol.nodes[node]["build"] == False
def test_add_positions_from_gro(): top = Topology.from_gmx_topfile( TEST_DATA + "/topology_test/system.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.gro") for node in top.molecules[0].molecule.nodes: if node < 14: assert "position" in top.molecules[0].molecule.nodes[ node].keys() for node in top.molecules[0].nodes: if node != 2: assert "position" in top.molecules[0].nodes[node].keys() assert top.molecules[0].nodes[node]["build"] == False else: assert top.molecules[0].nodes[node]["build"] == True
def test_convert_to_vermouth_system(): top = Topology.from_gmx_topfile( TEST_DATA + "/topology_test/system.top", "test") system = top.convert_to_vermouth_system() assert isinstance(system, vermouth.system.System) assert len(system.molecules) == 1
def test_from_gmx_topfile(): top = Topology.from_gmx_topfile( TEST_DATA + "/topology_test/system.top", "test") assert len(top.molecules) == 1
def molecule(): toppath = TEST_DATA + "/struc_build/system.top" topology = Topology.from_gmx_topfile(name="test", path=toppath) return topology.molecules[0]