← Back to team overview

yade-users team mailing list archive

Re: [Question #279256]: Yade documnetation

 

Question #279256 on Yade changed:
https://answers.launchpad.net/yade/+question/279256

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello Mohsen,

I'am confused with yade documentation


There are more versions of the documentation, please send a link..


> 1- what is the difference between Class references (chap 8) and modules
> (chap 9)?
>

the main difference is location of the source code. Class reference is
generated from C++ source files, while modules are Python modules located
in different directory


> 2- as an example, in chap 8 one class is (p. 412):
>      class yade.wrapper.BodyContainer((object)arg1, (BodyContainer)arg2)
>      can anyone explain what is the meaning of each expression:
>      i : yade.wrapper
>

yade.wrapper is a Python module created to wrap the C++ part of Yade for
Python


>      ii: bodyContainer
>

BodyContainer is class name

     iii: (object)arg1, (BodyContainer)arg2--> why font style of these two
> is italic?
>

it comes from the template, to emphasize that they are input arguments


>      iv: arg1, arg2
>

argument1, argument2 :-)
arg1 is always the object itself (like "self" in class definitions in
Python)
other arguments are what the function/class expects, usually also with
type. The very first line of each class is the default constructor. So
BodyContainer expects another BodyContainer as an argument :-) Just to get
an idea (I have never used this code myself) you can try in Yade:

BodyContainer() # results in error complaining about missing argument
BodyContainer(O.bodies) # without error


> 3-In chap 9, in some classes the word 'class' is omitted in other places
> not. why ?(example) :
>     yade.pack.gtsSurface2Facets(surf, **kw) (p 440)
>     class yade.pack.inGtsSurface_py(inherits Predicate) (p. 441)
>

yade.pack.gtsSurface2Facets(surf, **kw) is just a plain function, not
class, that's the reason

I am not sure if I explained everything understandably, if not, just ask
again :-)
cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.