Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#927: ketcher generate wrong *.ket format while processing reactants and catalysts #1226

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reactants_catalysts.png rendering status: OK
32 changes: 32 additions & 0 deletions api/tests/integration/tests/rendering/reactants_catalysts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import errno
import os
import sys

sys.path.append(
os.path.normpath(
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common")
)
)
from env_indigo import * # noqa
from rendering import *

if not os.path.exists(joinPathPy("out", __file__)):
try:
os.makedirs(joinPathPy("out", __file__))
except OSError as e:
if e.errno != errno.EEXIST:
raise

indigo = Indigo()
renderer = IndigoRenderer(indigo)

rea = indigo.loadReactionFromFile(
joinPathPy("reactions/reactants_catalysts.ket", __file__)
)
indigo.setOption("render-output-format", "png")
renderer.renderToFile(rea, joinPathPy("out/reactants_catalysts.png", __file__))
print(checkImageSimilarity("reactants_catalysts.png"))

if isIronPython():
renderer.Dispose()
indigo.Dispose()
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
{
"root": {
"nodes": [
{
"$ref": "mol0"
},
{
"$ref": "mol1"
},
{
"$ref": "mol2"
},
{
"$ref": "mol3"
},
{
"type": "arrow",
"data": {
"mode": "open-angle",
"pos": [
{
"x": 3.762229427795525,
"y": -5.60919196487642,
"z": 0
},
{
"x": 7.212229427795526,
"y": -5.584191964876419,
"z": 0
}
]
}
},
{
"type": "plus",
"location": [
-3.7627705722044764,
-5.584191964876419,
0
],
"prop": {}
}
]
},
"mol0": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
-6.794436882534505,
-6.060437271653115,
0
]
},
{
"label": "C",
"location": [
-6.794235922203033,
-5.0579466580997225,
0
]
},
{
"label": "C",
"location": [
-6.089066119064041,
-4.352676374794996,
0
]
},
{
"label": "C",
"location": [
-6.088865158732569,
-6.76580803512358,
0
]
},
{
"label": "C",
"location": [
-5.086475025344912,
-6.76580803512358,
0
]
},
{
"label": "C",
"location": [
-4.381104261874448,
-6.060437271653115,
0
]
},
{
"label": "C",
"location": [
-4.381204742040184,
-5.0579466580997225,
0
]
},
{
"label": "C",
"location": [
-5.086475025344912,
-4.3525758946292585,
0
]
}
],
"bonds": [
{
"type": 1,
"atoms": [
0,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
},
{
"type": 1,
"atoms": [
0,
3
]
},
{
"type": 1,
"atoms": [
3,
4
]
},
{
"type": 1,
"atoms": [
4,
5
]
},
{
"type": 1,
"atoms": [
5,
6
]
},
{
"type": 1,
"atoms": [
6,
7
]
},
{
"type": 1,
"atoms": [
7,
2
]
}
]
},
"mol1": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
-1.6957832740966954,
-5.48419196487642,
0
]
},
{
"label": "C",
"location": [
-0.8297578703122561,
-4.98419196487642,
0
]
},
{
"label": "O",
"location": [
0.036267533472182256,
-5.484191964876421,
0
],
"charge": -1
},
{
"label": "O",
"location": [
-0.8297578703122552,
-3.9841919648764197,
0
]
}
],
"bonds": [
{
"type": 1,
"atoms": [
0,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
},
{
"type": 2,
"atoms": [
1,
3
]
}
]
},
"mol2": {
"type": "molecule",
"atoms": [
{
"label": "Na",
"location": [
1.3872294277955246,
-5.709191964876419,
0
],
"charge": 1
}
]
},
"mol3": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
10.344436882534504,
-5.431740708341137,
0
]
},
{
"label": "C",
"location": [
10.340733542460436,
-4.4366432214117,
0
]
},
{
"label": "C",
"location": [
9.33252422986335,
-5.418829063218034,
0
]
},
{
"label": "C",
"location": [
9.330021973056548,
-4.4366432214117,
0
]
}
],
"bonds": [
{
"type": 1,
"atoms": [
0,
1
]
},
{
"type": 1,
"atoms": [
0,
2
]
},
{
"type": 1,
"atoms": [
1,
3
]
},
{
"type": 1,
"atoms": [
2,
3
]
}
]
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.