Closed Jacketless closed 8 years ago
Ah, this is indeed a bug that is created due to the way we low-level concatenate two Python functions. The quick fix for this is to explicitly put an import statement (import numpy as np
, or even from numpy import random
) inside the RandomWalk
kernel function itself. I'll see if I can fix the concatenation function to improve this.
Ok I think I figured out how to fix this (see PR #29). Thanks @Jacketless, this is a really important fix.
Given that PR #29 has landed, I believe this is now fixed; so closing.
I'm calling np.random functions in a RandomWalk function, as discussed in issue #27, and trying to use "pure python" mode for the moment as these functions are not implemented in the compiler.
However, when from the terminal I run
pythonw2.7 tests/test_moving_eddies.py scipy --grid 200 200 -v -p 50
I still get the errorFile "<ast>", line 260, in AdvectionRK4RandomWalk
NameError: global name 'np' is not defined
which does not makes sense because I believed calling mode 'scipy' did not even generate a AdvectionRK4RandomWalk C function, let alone not understand the np shorthand for numpy. If I force the default mode to be scipy rather than jit, I get the same error without the terminal line scipy argument, so this must be something else....