mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
Adds KeyFromPropHolder to hold user defined indices (#4571)
* Adds KeyFromPropHolder to hold user defined indices * Add missing file * I hate swig. Had to move keyholder classes into main header file, yuck. But I added tests, so yay? * Remove removed dependency * Fix borked test * Make consistent getKeys function, fix constness * Fix overloaded call * Remove GetKey/s from SubstructLibrary
This commit is contained in:
@@ -95,13 +95,20 @@ struct Bits {
|
||||
};
|
||||
|
||||
unsigned int SubstructLibrary::addMol(const ROMol &m) {
|
||||
unsigned int size = mols->addMol(m);
|
||||
unsigned int idx = mols->addMol(m);
|
||||
if (fps) {
|
||||
unsigned int fpsize = fps->addMol(m);
|
||||
CHECK_INVARIANT(size == fpsize,
|
||||
unsigned int fpidx = fps->addMol(m);
|
||||
CHECK_INVARIANT(idx == fpidx,
|
||||
"#mols different than #fingerprints in SubstructLibrary");
|
||||
}
|
||||
return size;
|
||||
if(keyholder.get() != nullptr) {
|
||||
unsigned int keyidx = keyholder->addMol(m);
|
||||
CHECK_INVARIANT(idx == keyidx,
|
||||
"#mols different than #keys in SubstructLibrary");
|
||||
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Reference in New Issue
Block a user