mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-06 22:39:55 +08:00
Minor refactor of the python wrappers (#8847)
* refactor python wrappers * fix FilterHierarchyMatcher converted already registered warning
This commit is contained in:
committed by
greg landrum
parent
5d162eaf1f
commit
c63ddaffa2
@@ -71,7 +71,7 @@ python::list pyToList(SparseIntVect<IndexType> &vect) {
|
||||
template <typename T>
|
||||
python::list BulkDice(const T &siv1, python::list sivs, bool returnDistance) {
|
||||
python::list res;
|
||||
unsigned int nsivs = python::extract<unsigned int>(sivs.attr("__len__")());
|
||||
unsigned int nsivs = python::len(sivs);
|
||||
for (unsigned int i = 0; i < nsivs; ++i) {
|
||||
double simVal;
|
||||
const T *siv2 = python::extract<T *>(sivs[i])();
|
||||
@@ -84,7 +84,7 @@ template <typename T>
|
||||
python::list BulkTanimoto(const T &siv1, python::list sivs,
|
||||
bool returnDistance) {
|
||||
python::list res;
|
||||
unsigned int nsivs = python::extract<unsigned int>(sivs.attr("__len__")());
|
||||
unsigned int nsivs = python::len(sivs);
|
||||
for (unsigned int i = 0; i < nsivs; ++i) {
|
||||
double simVal;
|
||||
const T *siv2 = python::extract<T *>(sivs[i])();
|
||||
@@ -98,7 +98,7 @@ template <typename T>
|
||||
python::list BulkTversky(const T &siv1, python::list sivs, double a, double b,
|
||||
bool returnDistance) {
|
||||
python::list res;
|
||||
unsigned int nsivs = python::extract<unsigned int>(sivs.attr("__len__")());
|
||||
unsigned int nsivs = python::len(sivs);
|
||||
for (unsigned int i = 0; i < nsivs; ++i) {
|
||||
double simVal;
|
||||
const T *siv2 = python::extract<T *>(sivs[i])();
|
||||
|
||||
Reference in New Issue
Block a user