Skip to content

Commit

Permalink
sort fix
Browse files Browse the repository at this point in the history
  • Loading branch information
even1024 committed Jan 30, 2025
1 parent 26a9961 commit 4336396
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 21 deletions.
2 changes: 2 additions & 0 deletions api/tests/integration/ref/layout/acs_style_reaction.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ acs_issue_2389.ket:SUCCEED
Molecule #4: Success
Molecule #5: Success
Molecule #6: Success
Molecule #7: Success
Molecule #8: Success
66 changes: 50 additions & 16 deletions api/tests/integration/tests/layout/ref/acs_issue_2458.ket
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
{
"$ref": "mol6"
},
{
"$ref": "mol7"
},
{
"$ref": "mol8"
},
{
"type": "arrow",
"data": {
Expand All @@ -33,7 +39,7 @@
"z": 0.0
},
{
"x": 16.708332,
"x": 20.458332,
"y": 0.0,
"z": 0.0
}
Expand Down Expand Up @@ -284,9 +290,9 @@
"type": "molecule",
"atoms": [
{
"label": "O",
"label": "P",
"location": [
10.423611,
9.451388,
0.902778,
0.0
]
Expand Down Expand Up @@ -323,92 +329,106 @@
"bonds": []
},
"mol5": {
"type": "molecule",
"atoms": [
{
"label": "O",
"location": [
16.048611,
0.902778,
0.0
]
}
],
"bonds": []
},
"mol6": {
"type": "molecule",
"atoms": [
{
"label": "N",
"location": [
17.854164,
21.604164,
1.309017,
0.0
]
},
{
"label": "C",
"location": [
18.805222,
22.555222,
1.0,
0.0
]
},
{
"label": "C",
"location": [
17.26638,
21.01638,
0.5,
0.0
]
},
{
"label": "C",
"location": [
18.805222,
22.555222,
-0.0,
0.0
]
},
{
"label": "N",
"location": [
19.671247,
23.421247,
1.5,
0.0
]
},
{
"label": "N",
"location": [
17.854166,
21.604166,
-0.309017,
0.0
]
},
{
"label": "C",
"location": [
19.671247,
23.421247,
-0.5,
0.0
]
},
{
"label": "C",
"location": [
20.537273,
24.287273,
1.0,
0.0
]
},
{
"label": "N",
"location": [
20.537273,
24.287273,
0.0,
0.0
]
},
{
"label": "O",
"location": [
19.671247,
23.421247,
-1.5,
0.0
]
},
{
"label": "N",
"location": [
21.403297,
25.153297,
1.5,
0.0
]
Expand Down Expand Up @@ -501,13 +521,27 @@
}
]
},
"mol6": {
"mol7": {
"type": "molecule",
"atoms": [
{
"label": "P",
"location": [
15.076388,
16.951387,
0.902778,
0.0
]
}
],
"bonds": []
},
"mol8": {
"type": "molecule",
"atoms": [
{
"label": "O",
"location": [
19.798611,
0.902778,
0.0
]
Expand Down
10 changes: 6 additions & 4 deletions core/indigo-core/reaction/src/reaction_multistep_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,9 +1432,9 @@ void ReactionMultistepDetector::constructSimpleArrowReaction(BaseReaction& rxn)
switch (comp.component_type)
{
case ReactionComponent::MOLECULE: {
if (comp.molecule && comp.summ_block_idx != ReactionComponent::NOT_CONNECTED &&
_component_summ_blocks[comp.summ_block_idx].role != BaseReaction::UNDEFINED)
if (comp.molecule && comp.summ_block_idx != ReactionComponent::NOT_CONNECTED)
{
auto role = _component_summ_blocks[comp.summ_block_idx].role;
auto& cmol = *comp.molecule;
for (int idx = cmol.vertexBegin(); idx < cmol.vertexEnd(); idx = cmol.vertexNext(idx))
{
Expand All @@ -1449,10 +1449,12 @@ void ReactionMultistepDetector::constructSimpleArrowReaction(BaseReaction& rxn)
rxn.addCatalystCopy(cmol, 0, 0);
break;
case KProductArea:
rxn.addProductCopy(cmol, 0, 0);
if (role != BaseReaction::UNDEFINED)
rxn.addProductCopy(cmol, 0, 0);
break;
default:
rxn.addReactantCopy(cmol, 0, 0);
if (role != BaseReaction::UNDEFINED)
rxn.addReactantCopy(cmol, 0, 0);
break;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion utils/indigo-depict/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ int main(int argc, char* argv[])
_prepare(obj, p.aromatization);
if (p.action == ACTION_LAYOUT)
{
indigoLayout(obj);
//indigoLayout(obj);
if (p.out_ext == OEXT_CML)
indigoSaveCmlToFile(obj, p.outfile);
else if (p.out_ext == OEXT_RXN)
Expand Down

0 comments on commit 4336396

Please sign in to comment.