mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +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
GitHub
parent
66787fe604
commit
a4b63d7df5
3
External/CoordGen/Wrap/rdCoordGen.cpp
vendored
3
External/CoordGen/Wrap/rdCoordGen.cpp
vendored
@@ -25,8 +25,7 @@ namespace {
|
||||
void SetCoordMap(CoordGen::CoordGenParams *self, python::dict &coordMap) {
|
||||
self->coordMap.clear();
|
||||
python::list ks = coordMap.keys();
|
||||
for (unsigned int i = 0;
|
||||
i < python::extract<unsigned int>(ks.attr("__len__")()); i++) {
|
||||
for (unsigned int i = 0; i < boost::python::len(ks); ++i) {
|
||||
unsigned int id = python::extract<unsigned int>(ks[i]);
|
||||
self->coordMap[id] = python::extract<RDGeom::Point2D>(coordMap[id]);
|
||||
}
|
||||
|
||||
2
External/FreeSASA/Wrap/rdFreeSASA.cpp
vendored
2
External/FreeSASA/Wrap/rdFreeSASA.cpp
vendored
@@ -71,7 +71,7 @@ double calcSASAHelper(const RDKit::ROMol &mol, python::object radii,
|
||||
|
||||
std::vector<double> vradii;
|
||||
|
||||
unsigned int sz = python::extract<unsigned int>(radii.attr("__len__")());
|
||||
unsigned int sz = boost::python::len(radii);
|
||||
for (unsigned int i = 0; i < sz; ++i) {
|
||||
vradii.push_back(python::extract<double>(radii[i])());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user