Skip to content

Commit

Permalink
#1254 SMARTS with component-level grouping saved without '()'
Browse files Browse the repository at this point in the history
 Fix UTs
  • Loading branch information
AliaksandrDziarkach committed Sep 12, 2023
1 parent b771b83 commit 669601c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion core/indigo-core/molecule/query_molecule.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ namespace indigo
PtrArray<Bond> _bonds;

std::list<std::unordered_set<int>> _component_neighbors;
bool _component_neighbors_valid;
void _calculateComponentNeighbors();
};

Expand Down
6 changes: 2 additions & 4 deletions core/indigo-core/molecule/src/query_molecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

using namespace indigo;

QueryMolecule::QueryMolecule() : spatial_constraints(*this), _component_neighbors_valid(false)
QueryMolecule::QueryMolecule() : spatial_constraints(*this)
{
}

Expand Down Expand Up @@ -2162,8 +2162,6 @@ void QueryMolecule::_calculateComponentNeighbors()

std::list<std::unordered_set<int>>& QueryMolecule::getComponentNeighbors()
{
if (!_component_neighbors_valid)
_calculateComponentNeighbors();

_calculateComponentNeighbors();
return _component_neighbors;
}
2 changes: 1 addition & 1 deletion core/indigo-core/tests/tests/reaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TEST_F(IndigoCoreReactionTest, aliases_complex)
QueryReaction reaction;
loadQueryReaction("[#6:1]=[#6:2][#6:3].[#6:4]=[#6:5][#6:6]>>[#6:3][#6:2]=[#6:5][#6:6] |$;;R1;;;R2;R1;;;R2$|", reaction);
reaction.clearAAM();
ASSERT_STREQ("[#6]=[#6]-[#6].[#6]=[#6]-[#6]>>[#6]-[#6]=[#6]-[#6] |$;;R1;;;R2;R1;;;R2$|", saveReactionSmiles(reaction, true).c_str());
ASSERT_STREQ("[#6]=[#6]-[#6].[#6]=[#6]-[#6]>>[#6]-[#6]=[#6]-[#6]", saveReactionSmiles(reaction, true).c_str());
ASSERT_STREQ("$RXN\n\n -INDIGO- 0100000000\n\n 2 1\n$MOL\n\n -INDIGO-01000000002D\n\n 3 2 0 0 0 0 0 0 0 0999 V2000\n 0.0000 0.0000 "
"0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.0000 "
" 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 2 0 0 0 0\n 2 3 1 0 0 0 0\nA 3\nR1\nM END\n$MOL\n\n "
Expand Down

0 comments on commit 669601c

Please sign in to comment.