mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Cleaner forloops, deleting of empty header file (#7320)
* clean up of python and c++ for-loops
* readd assignement
* Remove misleading walrus operators (#7323)
* Run installed tests if applicable (#7325)
* simpler check for equality
* Revert "simpler check for equality"
py assert does not work pointwise on lists on all platforms,
we need to iterate through all elements
This reverts commit 03cc0ad1a6.
* fix ambiguity on truth value of np arrays
* compare list elementwise
---------
Co-authored-by: Matt Swain <m.swain@me.com>
This commit is contained in:
@@ -30,9 +30,9 @@ struct chemfeat_pickle_suite : rdkit_pickle_suite {
|
||||
};
|
||||
|
||||
std::string featClassDoc =
|
||||
"Class to represent a free chemical features.\n\
|
||||
"Class to represent free chemical features.\n\
|
||||
These chemical features are not associated with a molecule, though they can be matched \n\
|
||||
to molecular featufres\n";
|
||||
to molecular features\n";
|
||||
struct freefeat_wrapper {
|
||||
static void wrap() {
|
||||
python::class_<FreeChemicalFeature>(
|
||||
|
||||
@@ -18,8 +18,8 @@ void wrap_freefeat();
|
||||
BOOST_PYTHON_MODULE(rdChemicalFeatures) {
|
||||
python::scope().attr("__doc__") =
|
||||
"Module containing free chemical feature functionality\n\
|
||||
These are feature that are not associated with molecules. They are \n\
|
||||
are typically derived from pharmacophores and site-maps.\n";
|
||||
These are features that are not associated with molecules. They are \n\
|
||||
typically derived from pharmacophores and site-maps.\n";
|
||||
|
||||
wrap_freefeat();
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ def feq(v1, v2, tol2=1e-4):
|
||||
|
||||
|
||||
def lstFeq(l1, l2, tol=1.e-4):
|
||||
if (len(l1) != len(l2)):
|
||||
if len(l1) != len(l2):
|
||||
return 0
|
||||
for i in range(len(l1)):
|
||||
if not feq(l1[i], l2[i], tol):
|
||||
for ll1, ll2 in zip(l1, l2):
|
||||
if not feq(ll1, ll2, tol):
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user