[Yt-dev] Namespace Issue

Stephen Skory stephenskory at yahoo.com
Fri Jun 4 11:06:55 PDT 2010


Hi All,

I am attempting to formulate an example method of using my Two Point Functions (née Structure Function Generator) stuff for two point correlations of halos. This means that I want the ability to have multiple Fortran kd trees active at once. However, I think I am running into a namespace issue of Python. See below:

In [1]: import yt.extensions.kdtree as One

In [2]: One.fKD.pos = na.random.random((3,100))

In [3]: One.fKD.pos.shape 
Out[3]: (3, 100)

In [5]: import yt.extensions.kdtree as Two

In [6]: Two.fKD.pos = na.random.random((3,200))

In [7]: Two.fKD.pos.shape
Out[7]: (3, 200)

In [8]: One.fKD.pos.shape
Out[8]: (3, 200)

(In [4] was a typo) This isn't just a Forthon issue:

In [1]: import numpy as na

In [2]: na.NaN
Out[2]: nan

In [3]: na.NaN = 8

In [4]: na.NaN
Out[4]: 8

In [5]: import numpy as np

In [6]: np.NaN
Out[6]: 8


I want np.NaN==NaN, not 8. Does anyone know of a way around this?

Thanks!

 _______________________________________________________
sskory at physics.ucsd.edu           o__  Stephen Skory
http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student
________________________________(_)_\(_)_______________




More information about the yt-dev mailing list