snapshot engine timeout
I to make a video using snapshot engine:
from yade import qt
qt.View()
qt.SnapshotEngi
Why do I get a timeout of this engine?
16506 WARN yade.SnapshotEngine gui/qt4/
I want to read the manual, but it is an empty page:
https:/
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Anton Gladky
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
You can compile your own version of the manual (see doc/Sphinx/README), and there will be the qt documentation. I hope we will fix that for the online manual to.
Revision history for this message
|
#2 |
# Sphinx version: 0.6.6
# Docutils version: 0.7 release
Traceback (most recent call last):
File "/usr/lib/
warningiserror, tags)
File "/usr/lib/
self.config = Config(confdir, CONFIG_FILENAME, confoverrides, self.tags)
File "/usr/lib/
execfile(
File "/home/
from sphinx.roles import XRefRole
ImportError: cannot import name XRefRole
Revision history for this message
|
#4 |
me@debian ~/YADE/
Welcome to Yade bzr2981
TCP python prompt on localhost:9000, auth cookie `ceukds'
XMLRPC info provider on http://
Running script yadeSphinx.py
Running Sphinx v0.6.6
Exception occurred:
File "/home/
from sphinx.roles import XRefRole
ImportError: cannot import name XRefRole
The full traceback has been saved in /tmp/sphinx-
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://
or report them in the tracker at <http://
Traceback (most recent call last):
File "/home/
execfile(
File "yadeSphinx.py", line 219, in <module>
makeBaseCla
File "yadeSphinx.py", line 151, in makeBaseClasses
for l in open(f):
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '_build/
I am also wondering, because actually I use bzr3011, not bzr2981 ...
Did i do something wrong? Do I have to compile the whole yade package again with scons?
Revision history for this message
|
#5 |
> Running Sphinx v0.6.6
That makes a problem. Python-sphinx version should be >1.0.5
https:/
Anton
Revision history for this message
|
#6 |
For the version question:
This command is actually really running yade and execute special functions from each class, to get documentation:
PYTHONPATH=. yade yadeSphinx.py
I guess you have yade-daily installed (so that yade is in the system's path), so the command is generating the documentation of bzr2981.
For latest version:
PYTHONPATH=. path/to/
Revision history for this message
|
#7 |
With the new sphinx version i was able to compile the documentation, thank you anton.
i increased deadTimeout to 100.
qt.SnapshotEngi
when i run the simulation, i get every 10 seconds a warning, like this one:
12467 WARN yade.SnapshotEngine gui/qt4/
after 100 seconds the engine gets dead and the calculation starts without snapshotengine. so i do not get one snapshot. for running the simulation i use a while command, maybe this is the problem:
while c_clump < 10:
c_clump = c_clump + 1
O.run(3000,True)
Revision history for this message
|
#8 |
There must be a stupid detail, like /tmp/snaps/ doesn't exist, or this sort of thing.
I don't think the while command can create problems.
Did you try to set dead=false after a few iterations?
Revision history for this message
|
#9 |
the folder exists, it has something to do with the while command ... ?!
from yade import qt
v=qt.View()
qt.SnapshotEngi
O.run(20000)
raw_input('press ENTER')
# until here it works fine
while c_clump < 10:
c_clump = c_clump + 1
O.run(3000,True)
then i get:
58555 WARN yade.SnapshotEngine gui/qt4/
i will try that dead=false ...
Revision history for this message
|
#10 |
to reproduce it, try this script:
#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade import qt
#define material properties:
rho = 1000 #density
fric = 2 #friction coefficient
fric_angle = atan(fric) #friction angle in radian
stiff_n = 1e8
stiff_s = 1e8
c_n = 0.0 #normal viscous damping
c_s = 0.0 #shear viscous damping
l_d = 0.7 #local damping
#define a material:
MyMaterial = O.materials.
cn=c_n, cs=c_s, density=rho, frictionAngle=
#create a sphere:
O.bodies.
#create a plane facet:
O.bodies.
#define engines:
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GravityEngine(
NewtonIntegrat
qt.SnapshotEng
]
#show geometry:
v=qt.View(); v.axes=True
v.viewDir=
v.eyePosition=
O.dt = 1e-6
#this works:-
#O.run(1000000)
#this not:---
ii=1
while ii < 200:
ii=ii+1
O.run(1500,True)
Revision history for this message
|
#11 |
Mmmh... maybe a problem with the "True" in run(N,True).
I remember it tends to freeze the interface, hence maybe also the
display. Sorry, I'm not expert of this feature.
Revision history for this message
|
#12 |
Hello,
This also happens to me. To create videos, I have to do this way, for ex:
O.engines = O.engines+
O.run(10000,True)
O.engines = O.engines + [qt.SnapshotEng
O.engines=O.engines + [KinemDirectShe
And when the control board appears, press the Start (or Play) button, it will work. Don't type: O.run(XXX,True) in your script ( I don't know why)
Hope it helps you.
Cheers,
Viet
Revision history for this message
|
#13 |
That's it. O.run(...,True) is not refreshing the display, hence the timeout. Type only run(N).
If you need to stop the simulation with a test, you can always use a periodic engine to do so.
Revision history for this message
|
#14 |
is there a command, where i can disable this synchronised python processing? if i could disable it, then i do not need this ,True within the run command.
Revision history for this message
|
#15 |
I'm not sure I understand your question Christian. You mean stopping the execution of the script until run(N) is completed? This is O.wait() but is exactly the same as O.run(N,True). Same problem with frozen display and timeout.
Revision history for this message
|
#16 |
No, I mean telling python to process commands step by step (sequentially). When one step is finish, then the next step should be processed. I searched in the internet, but I did not find, what I need ... only something with subprocess ...
Revision history for this message
|
#17 |
Christian, if you need to have a video from simulations,
I would strongly recommend you to use vtk-export.
I know, you have problems with Paraview, but I think, you can
try to export video to another format to fix it.
It is much more flexible, than snapshotengine.
Anton
Revision history for this message
|
#18 |
>I mean telling python to process commands step by step (sequentially). When one step is finish, then the next step should be processed.
It is exactly what O.wait() is doing (and so does run(N,True)).
Revision history for this message
|
#19 |
Bruno, you know, that I came from PFC to Yade. In PFC the scripts are written in programming language FISH. With FISH I use e.g.
def abc
a=1
end
abc
cycle 1000
print a
In this language the user has not explicitly to say: wait until cycle 1000 is ready and then print a. It is done automatically. In python the user has to say O.wait() after O.run() explicitly. My question is, if it is possible to change the python behavior in general so that I do not have say O.wait(). As I can read out of your comments it seems, that this is not possible.
Anton, I will try that vtk-export. Codecs were updated for debian, so maybe this paraview-bug could be fixed.
Revision history for this message
|
#20 |
> Anton, I will try that vtk-export. Codecs were updated for debian, so
> maybe this paraview-bug could be fixed.
Try 3.12 version of Paraview, seems, it is stable now.
Anton
Revision history for this message
|
#21 |
Thanks Anton Gladky, that solved my question.