Advanced & more¶
Particle size distribution¶
Clumps¶
Testing laws¶
Visualization¶
See the example 3d-postprocessing and video recording
Convert python 2 scripts to python 3¶
Below is a non-exhaustive list of common things to do to convert your scripts to python 3.
Mandatory:¶
print ...
becomesprint(...)
,myDict.iterkeys()
,myDict.itervalues()
,myDict.iteritems()
becomesmyDict.keys()
,myDict.values()
,myDict.items()
,import cPickle
becomesimport pickle
,`` and
<>
operators are no longer recognized,inconsistent use of tabs and spaces in indentation is prohibited, for this reason all scripts in yade use tabs for indentation.
Should be checked, but not always mandatory:¶
(euclidian) division of two integers:
i1/i2
becomesi1//i2
,myDict.keys()
,myDict.values()
,myDict.items()
becomes sometimeslist(myDict.keys())
,list(myDict.values())
,list(myDict.items())
(depending on your usage),map()
,filter()
,zip()
becomes sometimeslist(map())
,list(filter())
,list(zip())
(depending on your usage),string encoding is now UTF8 everywhere, it may cause problems on user inputs/outputs (keyboard, file…) with special chars.
Optional:¶
# encoding: utf-8
no longer needed