[yt-users] ProfilePlot error: weakly-referenced object no longer exists

Mateusz Ruszkowski mateuszr at umich.edu
Thu Aug 20 16:33:03 PDT 2015



   Hi,

I am trying to plot two profiles on one plot and adjust xlim. I am getting the following error message:

Traceback (most recent call last):
  File "test.py", line 17, in <module>
    plot.set_xlim([0.1, 1.0])
  File "/home/mateuszr/my_yt/yt-x86_64/src/yt-hg/yt/visualization/plot_container.py", line 62, in newfunc
    rv = f(*args, **kwargs)
  File "/home/mateuszr/my_yt/yt-x86_64/src/yt-hg/yt/visualization/profile_plotter.py", line 547, in set_xlim
    extrema=extrema, units=units)
  File "/home/mateuszr/my_yt/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py", line 1436, in create_profile
    bin_fields = data_source._determine_fields(bin_fields)
  File "/home/mateuszr/my_yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 552, in _determine_fields
    finfo = self.ds._get_field_info(ftype, fname)
ReferenceError: weakly-referenced object no longer exists

---------------------------------------------------
I am using the following script:

import yt

profiles = []
labels   = []

for i in range(0,2,1):

   print i
   ds=yt.load("./sedov_hdf5_chk_%04i"%i)
   my_data = ds.sphere(ds.domain_center, 1.0)
   sim_time = ds.current_time 
   profiles.append(yt.create_profile(my_data, "radius", fields=["density"], weight_field="cell_volume", n_bins=32))
   labels.append("t= %.0f" % sim_time)

plot = yt.ProfilePlot.from_profiles(profiles, labels=labels)
plot.set_xlim([0.1, 1.0])
plot.save()

------------------------------------------------------
I am using the following yt version: 

Version = 3.3-dev
Changeset = 603eab147248 (yt) tip


-------------------------------------------------------

Data = standard Flash Sedov test.


Any idea what I may be doing wrong?

    Thanks,
      Mateusz











More information about the yt-users mailing list