>>> def test():
... x = Nio.open_file("wrfout_d02_2005-08-28_12:00:00.nc", "r")
... y = x.variables["P"]
... return y
...
>>> q = test()
>>> q[:]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ladwig/miniconda2/envs/pynio2_build/lib/python2.7/site-packages/PyNIO/Nio.py", line 347, in __getitem__
ret = get_variable(self.file, self.varname, xsel)
File "/Users/ladwig/miniconda2/envs/pynio2_build/lib/python2.7/site-packages/PyNIO/coordsel.py", line 39, in get_variable
dims = file.variables[varname].cf_dimensions
ReferenceError: weakly-referenced object no longer exists
It looks like in the newer 1.5.x series of PyNIO, variables are being stored as weak references. This is going to be difficult to fix. Ideally, the weak reference stuff needs to be removed in favor of cyclic garbage collection (e.g. (traverseproc)nio_traverse).
The following code fails:
It looks like in the newer 1.5.x series of PyNIO, variables are being stored as weak references. This is going to be difficult to fix. Ideally, the weak reference stuff needs to be removed in favor of cyclic garbage collection (e.g. (traverseproc)nio_traverse).