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:
Brian Kelley
2021-10-02 02:17:50 -04:00
committed by GitHub
parent 85608555fe
commit 6a16d64169
7 changed files with 405 additions and 87 deletions

View File

@@ -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 {