-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1033 CDXML: expanded abbreviation opens as contracted from .cdxm fil…
…es (#1209)
- Loading branch information
Dmitry Malysh
authored
Aug 7, 2023
1 parent
8bf2fcd
commit 94f3e54
Showing
6 changed files
with
220 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
api/tests/integration/ref/formats/cdxml_ket_expanded.py.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
*** CDXML to KET *** | ||
{ | ||
"root": { | ||
"nodes": [ | ||
{ | ||
"$ref": "mol0" | ||
}, | ||
{ | ||
"$ref": "mol1" | ||
} | ||
] | ||
}, | ||
"mol0": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
1.8660635948181153, | ||
-2.6999735832214357, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
1.0, | ||
-3.199960231781006, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "O", | ||
"location": [ | ||
1.8660635948181153, | ||
-1.700000286102295, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
1, | ||
0 | ||
] | ||
}, | ||
{ | ||
"type": 2, | ||
"atoms": [ | ||
0, | ||
2 | ||
] | ||
} | ||
], | ||
"sgroups": [ | ||
{ | ||
"type": "SUP", | ||
"atoms": [ | ||
0, | ||
1, | ||
2 | ||
], | ||
"name": "Ac", | ||
"expanded": true | ||
} | ||
] | ||
}, | ||
"mol1": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
6.266063213348389, | ||
-1.9999737739562989, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
5.400000095367432, | ||
-2.499960422515869, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "O", | ||
"location": [ | ||
6.266063213348389, | ||
-1.0, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
1, | ||
0 | ||
] | ||
}, | ||
{ | ||
"type": 2, | ||
"atoms": [ | ||
0, | ||
2 | ||
] | ||
} | ||
], | ||
"sgroups": [ | ||
{ | ||
"type": "SUP", | ||
"atoms": [ | ||
0, | ||
1, | ||
2 | ||
], | ||
"name": "Ac", | ||
"expanded": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.append( | ||
os.path.normpath( | ||
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") | ||
) | ||
) | ||
|
||
from env_indigo import * # noqa | ||
|
||
indigo = Indigo() | ||
|
||
indigo.setOption("json-saving-pretty", True) | ||
print("*** CDXML to KET ***") | ||
ref_path = joinPathPy("ref/", __file__) | ||
mol = indigo.loadMoleculeFromFile( | ||
joinPathPy("ref/cdxml_ket_expanded.cdxml", __file__) | ||
) | ||
|
||
print(mol.json()) |
55 changes: 55 additions & 0 deletions
55
api/tests/integration/tests/formats/ref/cdxml_ket_expanded.cdxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE CDXML SYSTEM "http://www.cambridgesoft.com/xml/cdxml.dtd"> | ||
<CDXML BondLength="30.000000" LabelFont="3" CaptionFont="4"> | ||
<fonttable id="1"> | ||
<font id="2" charset="utf-8" name="Arial"/> | ||
<font id="3" charset="utf-8" name="Times New Roman"/> | ||
</fonttable> | ||
<colortable> | ||
<color r="1" g="1" b="1"/> | ||
<color r="0" g="0" b="0"/> | ||
<color r="1" g="0" b="0"/> | ||
<color r="1" g="1" b="0"/> | ||
<color r="0" g="1" b="0"/> | ||
<color r="0" g="1" b="1"/> | ||
<color r="0" g="0" b="1"/> | ||
<color r="1" g="0" b="1"/> | ||
<color r="0.5" g="0.5" b="0.5"/> | ||
</colortable> | ||
<page HeightPages="1" WidthPages="1"> | ||
<fragment id="4"> | ||
<n id="15" NodeType="Fragment"> | ||
<fragment id="16"> | ||
<n id="5" p="55.981907 80.999207"/> | ||
<n id="6" p="30.000000 95.998810"/> | ||
<n id="7" Element="8" NumHydrogens="0" p="55.981907 51.000008"> | ||
<t p="55.981907 51.000008" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">O</s> | ||
</t> | ||
</n> | ||
<b id="11" B="6" E="5"/> | ||
<b id="12" B="5" E="7" Order="2"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>Ac</s> | ||
</t> | ||
</n> | ||
<n id="17" NodeType="Fragment"> | ||
<fragment id="18"> | ||
<n id="8" p="187.981903 59.999214"/> | ||
<n id="9" p="162.000000 74.998810"/> | ||
<n id="10" Element="8" NumHydrogens="0" p="187.981903 30.000000"> | ||
<t p="187.981903 30.000000" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">O</s> | ||
</t> | ||
</n> | ||
<b id="13" B="9" E="8"/> | ||
<b id="14" B="8" E="10" Order="2"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>Ac</s> | ||
</t> | ||
</n> | ||
</fragment> | ||
</page> | ||
</CDXML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters