utils.box() vs. box()

Bug #1166161 reported by Christian Jakob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Invalid
Low
Unassigned

Bug Description

Hi,

I removed all utils stuff from my scripts, now I got this error:

O.bodies.append(box(vec1,vec2,fixed=True,material=WallMat))
TypeError: box() takes at most 1 argument (4 given)

Is it a bug?

... it is working using utils.box() instead of box()

Revision history for this message
Jan Stránský (honzik) wrote : Re: [Yade-dev] [Bug 1166161] [NEW] utils.box() vs. box()

Hello Christian,
I was not able to reproduce your error.. Is it possible, taht you define
"box" function or variable in your script before this call? In case you
will not solve the problem, please attach a script, where the error is
reproducable.
Thanks
Jan

2013/4/8 Christian Jakob <email address hidden>

> Public bug reported:
>
> Hi,
>
> I removed all utils stuff from my scripts, now I got this error:
>
> O.bodies.append(box(vec1,vec2,fixed=True,material=WallMat))
> TypeError: box() takes at most 1 argument (4 given)
>
> Is it a bug?
>
> ... it is working using utils.box() instead of box()
>
> ** Affects: yade
> Importance: Low
> Status: New
>
> --
> You received this bug notification because you are a member of Yade
> developers, which is subscribed to Yade.
> https://bugs.launchpad.net/bugs/1166161
>
> Title:
> utils.box() vs. box()
>
> Status in Yet Another Dynamic Engine:
> New
>
> Bug description:
> Hi,
>
> I removed all utils stuff from my scripts, now I got this error:
>
> O.bodies.append(box(vec1,vec2,fixed=True,material=WallMat))
> TypeError: box() takes at most 1 argument (4 given)
>
> Is it a bug?
>
> ... it is working using utils.box() instead of box()
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/yade/+bug/1166161/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

I was also not able to reproduce in a small example script.
I will given more informations, when I found the bug in my script.

Changed in yade:
status: New → Invalid
Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

Short time ago I had a similar problem with friction angle.
For better understanding I will explain my script handling. I prefer to use a MASTER file:

### MASTER.py ###

execfile('userinput.py')
execfile('scripts/definitions.py')
execfile('scripts/set-filenames.py')

execfile('scripts/0-generate.py')
execfile('scripts/1-replace.py')
...

######

### userinput.py ###

...
friction_coeff = 10
angle = atan(friction_coeff)
...

######

so angle should be a float number, right?

but loading a simulation (xyz.yade) via MASTER file and print angle gave:

print angle
<function angle at 0x2fdfb90>

but:

print atan(friction_coeff)
1.4711276743

I think this is related the the box issue:

print box
<function box at 0x4b2d758>

Revision history for this message
Jan Stránský (honzik) wrote : Re: [Yade-dev] [Bug 1166161] Re: utils.box() vs. box()

> so angle should be a float number, right?
>
>
angle is float number as long as in other files ('scripts/definitions.py'
etc.) or 'userinput.py' itself angle is not a name of a function (as
probably is accodring to your output). With box it is the same case,
somewhere in your files (or possibly in some "from ... import *" or "from
... import box") must be defined 'angle' and 'box' function.

In Ipython, you can try

box?

it could give you some information

cheers
Jan

Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

thanks jan for the hints.
i did not define "angle" or "box" in my scripts.

the problem was in importing pylab,
ipython gives:

In [1]: box
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-19a86833023e> in <module>()
----> 1 box

NameError: name 'box' is not defined

In [2]: angle
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-975bff1628dc> in <module>()
----> 1 angle

NameError: name 'angle' is not defined

In [3]: from pylab import *

In [4]: angle
Out[4]: <function numpy.lib.function_base.angle>

In [5]: box
Out[5]: <function matplotlib.pyplot.box>

solved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.