This stumped me too the first time I saw this behaviour.
Here is a cut down example:
from jug import TaskGenerator
@TaskGenerator
def f(x):
return x*x
x = 2
#x = int(100*random.random())
y = f(x)
With x=2,
y is f(2).
However, if x is a random number, then y=f(x) with x being some number between
0 and 99. Unless you are extremely lucky, x will not always be the same value,
though. So, the first time you run jug, it might see y=f(42) and compute that.
The next time, when you run status, it sees y=f(32) and tells you it can run
it, but has not done it yet. When you run shell, it sees y=f(88) and you
cannot load it, because f(88) never run.
Set the random seed with numpy.random.seed(1234) and you will see consistent
results.
In a way, this is a feature. One of the things I want out of jug is to have
the results be as consistent and reproducible as possible and so, if they
depend on random numbers, the seed should be explicit. But it is really hard
to detect and output a good error message for.
HTH
Luis
--
Luis Pedro Coelho
http://luispedro.org