-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
5a7bfaa
commit e94605b
Showing
8 changed files
with
298 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
api/tests/integration/ref/formats/ket_with_query_components.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,2 @@ | ||
*** KET with query components *** | ||
ket_with_query_components.ket:SUCCEED |
35 changes: 35 additions & 0 deletions
35
api/tests/integration/tests/formats/ket_with_query_components.py
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,35 @@ | ||
import difflib | ||
import os | ||
import sys | ||
|
||
|
||
def find_diff(a, b): | ||
return "\n".join(difflib.unified_diff(a.splitlines(), b.splitlines())) | ||
|
||
|
||
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("*** KET with query components ***") | ||
|
||
ref_path = joinPathPy("ref/", __file__) | ||
name = "ket_with_query_components.ket" | ||
filename = os.path.join(ref_path, name) | ||
|
||
mol = indigo.loadQueryMoleculeFromFile(filename) | ||
with open(filename, "r") as file: | ||
ket_ref = file.read() | ||
ket = mol.json() | ||
diff = find_diff(ket_ref, ket) | ||
if not diff: | ||
print(name + ":SUCCEED") | ||
else: | ||
print(name + ":FAILED") | ||
print(diff) |
198 changes: 198 additions & 0 deletions
198
api/tests/integration/tests/formats/ref/ket_with_query_components.ket
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,198 @@ | ||
{ | ||
"root": { | ||
"nodes": [ | ||
{ | ||
"$ref": "mol0" | ||
}, | ||
{ | ||
"$ref": "mol1" | ||
}, | ||
{ | ||
"$ref": "mol2" | ||
} | ||
] | ||
}, | ||
"mol0": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
3.2669873237609865, | ||
-2.674999952316284, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
4.133012771606445, | ||
-2.174999952316284, | ||
0.0 | ||
], | ||
"queryProperties": { | ||
"connectivity": 2, | ||
"ringSize": 4 | ||
} | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
5.016987323760986, | ||
-2.299999952316284, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
5.883012771606445, | ||
-1.7999999523162842, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
2, | ||
3 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
1, | ||
2 | ||
] | ||
} | ||
] | ||
}, | ||
"mol1": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
7.550000190734863, | ||
-3.674999952316284, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
8.050000190734864, | ||
-2.808974504470825, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
9.324999809265137, | ||
-3.299999952316284, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "N", | ||
"location": [ | ||
8.61789321899414, | ||
-4.007106781005859, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
2, | ||
3 | ||
] | ||
} | ||
], | ||
"sgroups": [ | ||
{ | ||
"type": "queryComponent", | ||
"atoms": [ | ||
0, | ||
1, | ||
2, | ||
3 | ||
] | ||
} | ||
] | ||
}, | ||
"mol2": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
3.0999999046325685, | ||
-6.375, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
3.8071067333221437, | ||
-7.082106590270996, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
2.9410812854766847, | ||
-7.582106590270996, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
1, | ||
2 | ||
] | ||
} | ||
], | ||
"sgroups": [ | ||
{ | ||
"type": "queryComponent", | ||
"atoms": [ | ||
0, | ||
1, | ||
2 | ||
] | ||
} | ||
] | ||
} | ||
} |
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
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
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