← Back to team overview

yade-users team mailing list archive

Re: [Question #701030]: Why is my pyrunner command not being called?

 

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

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

> but it doesn't work.

please be more specific. Is there any error? It has / seems to have no effect? ... ?
Also, try to provide a MWE [1]. I.e., if your problem is PyRunner, use just one PyRunner and try to localize the problem.

> So I was wondering maybe there's something wrong with the engine code,
so I add the "print ('hello')"

why did not you put it inside the PyRunner, but to the topmost code?

> and it did work. But the pyrunner command still doesn't work. I do not
know what is going wrong.

put the print inside PyRunner function, together with more valuable info then "hello", (e.g. O.iter etc.)
PyRunner is called at the intervals you provide and does what you tell it to do.

> triaxload.command=('triaxunload')

('triaxunload') does nothing. Next time the PyRunner calls what you provide, i.e. triaxunload, which is just name of a function. It does not call it.
What about
triaxload.command='triaxunload()'
?

> O.engines=O.engines[0:5]+[...]+O.engines[5:7]

this code is very likely to produce errors. E.g. if you add an engine and leave indices 5 and 7, it does completely different thing than you want.
It has some use cases, like setting engines, do running, change engines.
But since you do this before any running, put the "additional" engines directly to O.engines = [...] code.

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

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