From 2ac8721463a4e880ef3a298cba925b0f844c8dfe Mon Sep 17 00:00:00 2001 From: Ralf Meyer Date: Thu, 14 Mar 2024 16:54:01 -0400 Subject: [PATCH] Fix acac smiles --- tests/test_Mol2D.py | 11 ++++---- tests/testresources/inputs/io/acac.mol | 6 ++--- tests/testresources/inputs/io/acac.mol2 | 36 ++++++++++++------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/tests/test_Mol2D.py b/tests/test_Mol2D.py index 82110184..fa2966e0 100644 --- a/tests/test_Mol2D.py +++ b/tests/test_Mol2D.py @@ -54,7 +54,7 @@ def acac_Mol2D(): ) mol.add_edges_from( [(0, 1), (1, 2), (1, 3), (2, 7), (2, 8), (2, 9), (3, 4), - (3, 13), (4, 5), (4, 6), (6, 10), (6, 11), (6, 12)] + (3, 10), (4, 5), (4, 6), (6, 11), (6, 12), (6, 13)] ) return mol @@ -64,7 +64,7 @@ def acac_Mol2D(): [ ("water", "O", water_Mol2D()), ("furan", "o1cccc1", furan_Mol2D()), - ("acac", None, acac_Mol2D()), # TODO: find the correct SMILES string for acac + ("acac", "[O-]-C(C)=CC(=O)C", acac_Mol2D()), ] ) def test_Mol2D_constructors(resource_path_root, name, smiles, mol_ref): @@ -81,11 +81,10 @@ def test_Mol2D_constructors(resource_path_root, name, smiles, mol_ref): assert mol.edges == mol_ref.edges # From smiles - if smiles is not None: - mol = Mol2D.from_smiles(smiles) + mol = Mol2D.from_smiles(smiles) - assert mol.nodes == mol_ref.nodes - assert mol.edges == mol_ref.edges + assert mol.nodes == mol_ref.nodes + assert mol.edges == mol_ref.edges @pytest.mark.parametrize( diff --git a/tests/testresources/inputs/io/acac.mol b/tests/testresources/inputs/io/acac.mol index cfedd11a..21de8379 100644 --- a/tests/testresources/inputs/io/acac.mol +++ b/tests/testresources/inputs/io/acac.mol @@ -12,10 +12,10 @@ 0.6247 0.6297 -1.4972 H 0 0 0 0 0 0 0 0 0 0 0 0 0.5611 0.5821 0.3070 H 0 0 0 0 0 0 0 0 0 0 0 0 0.7146 -0.9552 -0.6360 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7035 -0.9212 1.3622 H 0 0 0 0 0 0 0 0 0 0 0 0 4.7384 -1.4561 2.5816 H 0 0 0 0 0 0 0 0 0 0 0 0 6.0070 -0.1796 2.4590 H 0 0 0 0 0 0 0 0 0 0 0 0 6.1702 -1.7146 1.5151 H 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7035 -0.9212 1.3622 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 0 0 0 0 2 3 1 0 0 0 0 2 4 1 0 0 0 0 @@ -23,10 +23,10 @@ 3 9 1 0 0 0 0 3 10 1 0 0 0 0 4 5 2 0 0 0 0 - 4 14 1 0 0 0 0 + 4 11 1 0 0 0 0 5 6 1 0 0 0 0 5 7 1 0 0 0 0 - 7 11 1 0 0 0 0 7 12 1 0 0 0 0 7 13 1 0 0 0 0 + 7 14 1 0 0 0 0 M END diff --git a/tests/testresources/inputs/io/acac.mol2 b/tests/testresources/inputs/io/acac.mol2 index a5c3d382..487be5dc 100644 --- a/tests/testresources/inputs/io/acac.mol2 +++ b/tests/testresources/inputs/io/acac.mol2 @@ -5,20 +5,20 @@ SMALL GASTEIGER @ATOM - 1 O 3.1117 0.8158 -1.3940 O.2 1 UNL1 -0.2958 - 2 C 2.5035 0.2178 -0.5193 C.2 1 UNL1 0.1238 - 3 C 1.0119 0.1135 -0.5927 C.3 1 UNL1 -0.0046 - 4 C 3.2352 -0.4172 0.6354 C.2 1 UNL1 -0.1413 - 5 C 4.7377 -0.3230 0.7389 C.2 1 UNL1 -0.1413 - 6 O 5.3853 0.2682 -0.1114 O.2 1 UNL1 -0.5072 - 7 C 5.4522 -0.9568 1.8929 C.3 1 UNL1 -0.1389 - 8 H 0.6247 0.6297 -1.4972 H 1 UNL1 0.0308 - 9 H 0.5611 0.5821 0.3070 H 1 UNL1 0.0308 - 10 H 0.7146 -0.9552 -0.6360 H 1 UNL1 0.0308 - 11 H 4.7384 -1.4561 2.5816 H 1 UNL1 -0.0057 - 12 H 6.0070 -0.1796 2.4590 H 1 UNL1 -0.0057 - 13 H 6.1702 -1.7146 1.5151 H 1 UNL1 -0.0057 - 14 H 2.7035 -0.9212 1.3622 H 1 UNL1 0.0298 + 1 O 3.1117 0.8158 -1.3940 O.2 1 UNL1 -0.2929 + 2 C 2.5035 0.2178 -0.5193 C.2 1 UNL1 0.1563 + 3 C 1.0119 0.1135 -0.5927 C.3 1 UNL1 -0.0019 + 4 C 3.2352 -0.4172 0.6354 C.2 1 UNL1 0.0227 + 5 C 4.7377 -0.3230 0.7389 C.2 1 UNL1 0.1563 + 6 O 5.3853 0.2682 -0.1114 O.2 1 UNL1 -0.2929 + 7 C 5.4522 -0.9568 1.8929 C.3 1 UNL1 -0.0019 + 8 H 0.6247 0.6297 -1.4972 H 1 UNL1 0.0309 + 9 H 0.5611 0.5821 0.3070 H 1 UNL1 0.0309 + 10 H 0.7146 -0.9552 -0.6360 H 1 UNL1 0.0309 + 11 H 2.7035 -0.9212 1.3622 H 1 UNL1 0.0687 + 12 H 4.7384 -1.4561 2.5816 H 1 UNL1 0.0309 + 13 H 6.0070 -0.1796 2.4590 H 1 UNL1 0.0309 + 14 H 6.1702 -1.7146 1.5151 H 1 UNL1 0.0309 @BOND 1 1 2 2 2 2 3 1 @@ -27,9 +27,9 @@ GASTEIGER 5 3 9 1 6 3 10 1 7 4 5 2 - 8 4 14 1 + 8 4 11 1 9 5 6 1 10 5 7 1 - 11 7 11 1 - 12 7 12 1 - 13 7 13 1 + 11 7 12 1 + 12 7 13 1 + 13 7 14 1