![]() |
| ||||||||||||||||||
![]() |
| ||||||||||||||||||
|
Since Yanaconda is a reinterpreted language
, YASARA commands can accept arguments in a rather flexible way. In Python on the other hand,
the number and order of function arguments must not change. If a YASARA command supports more than one format,
it thus has to be wrapped by different Python functions. The names of these Python functions differ at the end,
using either an increasing number or the name of the first argument. Example for an increasing number: # In Yanaconda: # Format 1: Show an arrow between atoms 123 and 456 ShowArrow Start=AtAtom,123,End=AtAtom,456,Radius=0.5,Color=Red # Format 2: Show an arrow between points 1/2/3 and 4/5/6 ShowArrow Start=Point,X=1,Y=2,Z=3,End=Point,X=4,Y=5,Y=6,Radius=0.5,Color=Red # In Python: ShowArrow(start="AtAtom",selection1=123,end="AtAtom",selection2=456,radius=0.5,color="Red") ShowArrow2(start="Point",x=1,y=2,z=3,end="Point",x2=4,y2=5,z2=6,radius=0.5,color="Red") Note above that argument names in Python are case-sensitive and expected to be all lowercase. They may also not be repeated,
that's why the coordinates of the second point are x2/y2/z2. Example for using the name of the first argument:
# In Yanaconda:
# Format 1: Define a 20x30x40 A cell with angles 80/90/70 degrees:
Cell X=20,Y=30,Z=40,Alpha=80,Beta=90,Gamma=70
# Format 2: Define cell automatically to enclose everything with a 10 A extension:
Cell Auto,Extension=10
# Format 3: Define cell like the crystallographic cell of object 1crn:
Cell Crystal,1crn
# In Python:
Cell(x=20,y=30,z=40,alpha=80,beta=90,gamma=70)
CellAuto(extension=10)
CellCrystal("1crn")
Again, to find out details about the function variants available in Python,
check out the Python prototypes on the documentation page, e.g. ShowArrow
and Cell.
| ||||||||||||||||||