yade-users team mailing list archive
Mailing list archive
Re: [Question #676284]: avg Num Interactions
Question #676284 on Yade changed:
Jérôme Duriez proposed the following answer:
This error meant that your call to avgNumInteractions() triggered a call
to bodyNumInteractionsHistogram()  with a Python list as an argument,
whereas the latter bodyNumInteractionsHistogram() (a Python function
inherited from C++ world thanks to boost::python) wants Python tuples as
arguments . And Python list and Python tuples are different things
(but do not ask me why ;-) )
In more details bodyNumInteractionsHistogram had actually been called with the output of aabbExtrema() as an argument . And, because of recent changes in the C++ world  (and because of the exact manner the C++ and the Python worlds are connected), the return type of aabbExtrema() in the Python world is now a list, whereas it used to be a tuple.
Hence the error, as my 1st paragraph said.
I just committed changes  that solve the bug, as well as the other following example maybe closer to your needs:
# 3 spheres example to avoid the "nan" case in avgNumInteractions(skipFree=True)
print 'Avg Num Interactions', avgNumInteractions(cutoff=0.0,skipFree=True,considerClumps=False)
######### (This could have been your MWE ;-) )
When and how these changes will land in your computer depend on your use of YADE. Thanks for reporting anyway,
 See File "/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/utils.py", line 438, in avgNumInteractions, the command "nums,counts=bodyNumInteractionsHistogram(aabbExtrema(cutoff)"
You received this question notification because your team yade-users is
an answer contact for Yade.