New issue 1267: Profile datasets don't save profile.field_info dict data https://bitbucket.org/yt_analysis/yt/issues/1267/profile-datasets-dont-save
Nathan Goldbaum:
This is illustrated by the following script:
import yt
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
ad = ds.all_data()
prof = yt.create_profile(ad, [('gas', 'H_number_density'), ('gas', 'temperature')\
], fields='cell_mass')
print (prof.field_info)
prof.save_as_dataset()
prof_ds = yt.load('galaxy0030_Profile2D.h5')
print (prof_ds.profile.field_info)
plot = yt.PhasePlot(prof_ds.data, "H_number_density", "temperature", "cell_mass",\
weight_field=None)
On my machine this prints:
{('gas', 'temperature'): Alias Field for "('enzo', 'Temperature')" (gas,
temperature): (units: K), ('gas', 'H_number_density'): Derived Field (gas,
H_number_density): (units: cm**(-3)), ('gas', 'cell_mass'): Derived Field (gas,
cell_mass): (units: g)}
{}
And then crashes with the following traceback:
Traceback (most recent call last):
File "test.py", line 11, in <module>
weight_field=None)
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/profile_plotter.py", line 745, in
__init__
if isinstance(data_source.ds, YTProfileDataset):
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/profile_plotter.py", line 775, in
_initialize_instance
obj._setup_plots()
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/profile_plotter.py", line 856, in
_setup_plots
x_scale, y_scale, z_scale = self._get_field_log(f, self.profile)
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/profile_plotter.py", line 815, in
_get_field_log
zfi = profile.field_info[field_z]
KeyError: ('data', 'cell_mass')
@brittonsmith any chance you can take a look at this?