Skip to content

Commit

Permalink
Fix acac smiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ralf-meyer committed Mar 14, 2024
1 parent 9a68c3f commit 2ac8721
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
11 changes: 5 additions & 6 deletions tests/test_Mol2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/testresources/inputs/io/acac.mol
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
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
3 8 1 0 0 0 0
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
36 changes: 18 additions & 18 deletions tests/testresources/inputs/io/acac.mol2
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ SMALL
GASTEIGER

@<TRIPOS>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
@<TRIPOS>BOND
1 1 2 2
2 2 3 1
Expand All @@ -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

0 comments on commit 2ac8721

Please sign in to comment.