Commit 74717a30 by Maarten L. Hekkelman

Do not bail out in bondmap creation if compound is unknown

parent 0ca04bed
......@@ -69,7 +69,7 @@ if(MSVC)
set(COFF_SPEC "--coff=${COFF_TYPE}")
endif()
if(LINUX)
if(UNIX AND NOT APPLE)
# On Linux, install in the $HOME/.local folder by default
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(WARNING "The library and auxiliary files will be installed in $ENV{HOME}/.local")
......@@ -349,4 +349,4 @@ if(CIFPP_BUILD_TESTS)
endif()
message("Still to do: libcifpp.pc, package, tools, create symop_Data")
message("Still to do: package, tools, create symop_Data")
......@@ -323,14 +323,16 @@ bool CompoundBondMap::bonded(const std::string &compoundID, const std::string& a
return bi.bonded(a1, a2);
}
// not found in our cache, calculate
auto compound = mmcif::CompoundFactory::instance().create(compoundID);
if (not compound)
throw BondMapException("Missing compound bond info for " + compoundID);
bool result = false;
// not found in our cache, calculate
CompoundBondInfo bondInfo{ id };
auto compound = mmcif::CompoundFactory::instance().create(compoundID);
if (not compound)
std::cerr << "Missing compound bond info for " << compoundID << std::endl;
else
{
for (auto &atom: compound->bonds())
{
uint32_t ca1 = getAtomID(atom.atomID[0]);
......@@ -341,6 +343,7 @@ bool CompoundBondMap::bonded(const std::string &compoundID, const std::string& a
bondInfo.mBonded.insert({ca1, ca2});
result = result or (a1 == ca1 and a2 == ca2);
}
}
mCompounds.push_back(bondInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment