particle smoothing bug in latest version of yt
Hi YT, I have a function that loads a pf from a Gadget data set, and then smooths a few physical quantities (gas metallicity; mass; density) onto an octree, and then returns them: http://paste.yt-project.org/show/4624/ in an older version of yt (3.0) that I'm using: 7cf523a36d10 (yt-3.0) this works, no problem. if I run yt-update, to get to: 4d1488b8fa47 this gives the following traceback copied below. Has something important changed that should affect the way I use smoothing functions? -desika File "/Users/desika/Dropbox/powderday/particle_smooth_yt.py", line 41, in yt_smooth saved["metallicity"] = ad["gas", "metallicity"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 214, in __getitem__ self.get_data(f) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 623, in get_data self._generate_fields(fields_to_generate) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 640, in _generate_fields fd = self._generate_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 251, in _generate_field tr = self._generate_fluid_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 271, in _generate_fluid_field rv = finfo(gen_obj) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/derived_field.py", line 178, in __call__ dd = self._function(self, data) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/fluid_fields.py", line 153, in _metallicity tr = data[ftype, "metal_density"] / data[ftype, "density"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 207, in __getitem__ f = self._determine_fields([key])[0] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 455, in _determine_fields finfo = self.pf._get_field_info(ftype, fname) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 487, in _get_field_info raise YTFieldNotFound((ftype, fname), self) yt.utilities.exceptions.YTFieldNotFound: Could not find field '('gas', 'metal_density')' in snapshot_006.
Hi Desika, Looks like a bug, yes. I think the problem is that "metal_density" is not getting aliased correctly for your dataset. What is the output of: import pprint pprint.pprint(sorted(ds.field_list)) where ds is your dataset. -Matt On Wed, May 14, 2014 at 9:05 AM, Desika Narayanan <dnarayan@haverford.edu> wrote:
Hi YT,
I have a function that loads a pf from a Gadget data set, and then smooths a few physical quantities (gas metallicity; mass; density) onto an octree, and then returns them:
http://paste.yt-project.org/show/4624/
in an older version of yt (3.0) that I'm using: 7cf523a36d10 (yt-3.0)
this works, no problem. if I run yt-update, to get to: 4d1488b8fa47
this gives the following traceback copied below. Has something important changed that should affect the way I use smoothing functions?
-desika
File "/Users/desika/Dropbox/powderday/particle_smooth_yt.py", line 41, in yt_smooth saved["metallicity"] = ad["gas", "metallicity"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 214, in __getitem__ self.get_data(f) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 623, in get_data self._generate_fields(fields_to_generate) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 640, in _generate_fields fd = self._generate_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 251, in _generate_field tr = self._generate_fluid_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 271, in _generate_fluid_field rv = finfo(gen_obj) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/derived_field.py", line 178, in __call__ dd = self._function(self, data) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/fluid_fields.py", line 153, in _metallicity tr = data[ftype, "metal_density"] / data[ftype, "density"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 207, in __getitem__ f = self._determine_fields([key])[0] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 455, in _determine_fields finfo = self.pf._get_field_info(ftype, fname) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 487, in _get_field_info raise YTFieldNotFound((ftype, fname), self) yt.utilities.exceptions.YTFieldNotFound: Could not find field '('gas', 'metal_density')' in snapshot_006.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hey Matt, Thanks for looking into it - the field list is printed below (Pdb) pprint.pprint(sorted(pf.field_list)) [('PartType0', 'Coordinates'), ('PartType0', 'Density'), ('PartType0', 'ElectronAbundance'), ('PartType0', 'InternalEnergy'), ('PartType0', 'Masses'), ('PartType0', 'Metallicity'), ('PartType0', 'NeutralHydrogenAbundance'), ('PartType0', 'ParticleIDs'), ('PartType0', 'Potential'), ('PartType0', 'SmoothingLength'), ('PartType0', 'StarFormationRate'), ('PartType0', 'Velocities'), ('PartType1', 'Coordinates'), ('PartType1', 'Masses'), ('PartType1', 'ParticleIDs'), ('PartType1', 'Potential'), ('PartType1', 'Velocities'), ('PartType2', 'Coordinates'), ('PartType2', 'Masses'), ('PartType2', 'ParticleIDs'), ('PartType2', 'Potential'), ('PartType2', 'Velocities'), ('PartType3', 'Coordinates'), ('PartType3', 'Masses'), ('PartType3', 'ParticleIDs'), ('PartType3', 'Potential'), ('PartType3', 'Velocities'), ('PartType4', 'Coordinates'), ('PartType4', 'Masses'), ('PartType4', 'Metallicity'), ('PartType4', 'ParticleIDs'), ('PartType4', 'Potential'), ('PartType4', 'StellarFormationTime'), ('PartType4', 'Velocities'), ('PartType5', 'BH_Mass'), ('PartType5', 'BH_Mdot'), ('PartType5', 'Coordinates'), ('PartType5', 'Masses'), ('PartType5', 'ParticleIDs'), ('PartType5', 'Potential'), ('PartType5', 'Velocities'), ('all', 'Coordinates'), ('all', 'Masses'), ('all', 'ParticleIDs'), ('all', 'Potential'), ('all', 'Velocities')] On Thu, May 15, 2014 at 6:49 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Desika,
Looks like a bug, yes. I think the problem is that "metal_density" is not getting aliased correctly for your dataset. What is the output of:
import pprint pprint.pprint(sorted(ds.field_list))
where ds is your dataset.
-Matt
Hi YT,
I have a function that loads a pf from a Gadget data set, and then smooths a few physical quantities (gas metallicity; mass; density) onto an octree, and then returns them:
http://paste.yt-project.org/show/4624/
in an older version of yt (3.0) that I'm using: 7cf523a36d10 (yt-3.0)
this works, no problem. if I run yt-update, to get to: 4d1488b8fa47
this gives the following traceback copied below. Has something important changed that should affect the way I use smoothing functions?
-desika
File "/Users/desika/Dropbox/powderday/particle_smooth_yt.py", line 41, in yt_smooth saved["metallicity"] = ad["gas", "metallicity"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
214, in __getitem__ self.get_data(f) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
623, in get_data self._generate_fields(fields_to_generate) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
640, in _generate_fields fd = self._generate_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
251, in _generate_field tr = self._generate_fluid_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
271, in _generate_fluid_field rv = finfo(gen_obj) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/derived_field.py",
178, in __call__ dd = self._function(self, data) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/fluid_fields.py",
153, in _metallicity tr = data[ftype, "metal_density"] / data[ftype, "density"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
207, in __getitem__ f = self._determine_fields([key])[0] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
On Wed, May 14, 2014 at 9:05 AM, Desika Narayanan <dnarayan@haverford.edu> wrote: line line line line line line line line line
455, in _determine_fields finfo = self.pf._get_field_info(ftype, fname) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 487, in _get_field_info raise YTFieldNotFound((ftype, fname), self) yt.utilities.exceptions.YTFieldNotFound: Could not find field '('gas', 'metal_density')' in snapshot_006.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Desika, I've issued a PR to alias "Metallicity" too. That should fix it. https://bitbucket.org/yt_analysis/yt/pull-request/904/adding-metallicity-for... -Matt On Thu, May 15, 2014 at 6:59 AM, Desika Narayanan <dnarayan@haverford.edu> wrote:
Hey Matt,
Thanks for looking into it - the field list is printed below
(Pdb) pprint.pprint(sorted(pf.field_list))
[('PartType0', 'Coordinates'),
('PartType0', 'Density'),
('PartType0', 'ElectronAbundance'),
('PartType0', 'InternalEnergy'),
('PartType0', 'Masses'),
('PartType0', 'Metallicity'),
('PartType0', 'NeutralHydrogenAbundance'),
('PartType0', 'ParticleIDs'),
('PartType0', 'Potential'),
('PartType0', 'SmoothingLength'),
('PartType0', 'StarFormationRate'),
('PartType0', 'Velocities'),
('PartType1', 'Coordinates'),
('PartType1', 'Masses'),
('PartType1', 'ParticleIDs'),
('PartType1', 'Potential'),
('PartType1', 'Velocities'),
('PartType2', 'Coordinates'),
('PartType2', 'Masses'),
('PartType2', 'ParticleIDs'),
('PartType2', 'Potential'),
('PartType2', 'Velocities'),
('PartType3', 'Coordinates'),
('PartType3', 'Masses'),
('PartType3', 'ParticleIDs'),
('PartType3', 'Potential'),
('PartType3', 'Velocities'),
('PartType4', 'Coordinates'),
('PartType4', 'Masses'),
('PartType4', 'Metallicity'),
('PartType4', 'ParticleIDs'),
('PartType4', 'Potential'),
('PartType4', 'StellarFormationTime'),
('PartType4', 'Velocities'),
('PartType5', 'BH_Mass'),
('PartType5', 'BH_Mdot'),
('PartType5', 'Coordinates'),
('PartType5', 'Masses'),
('PartType5', 'ParticleIDs'),
('PartType5', 'Potential'),
('PartType5', 'Velocities'),
('all', 'Coordinates'),
('all', 'Masses'),
('all', 'ParticleIDs'),
('all', 'Potential'),
('all', 'Velocities')]
On Thu, May 15, 2014 at 6:49 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Desika,
Looks like a bug, yes. I think the problem is that "metal_density" is not getting aliased correctly for your dataset. What is the output of:
import pprint pprint.pprint(sorted(ds.field_list))
where ds is your dataset.
-Matt
On Wed, May 14, 2014 at 9:05 AM, Desika Narayanan <dnarayan@haverford.edu> wrote:
Hi YT,
I have a function that loads a pf from a Gadget data set, and then smooths a few physical quantities (gas metallicity; mass; density) onto an octree, and then returns them:
http://paste.yt-project.org/show/4624/
in an older version of yt (3.0) that I'm using: 7cf523a36d10 (yt-3.0)
this works, no problem. if I run yt-update, to get to: 4d1488b8fa47
this gives the following traceback copied below. Has something important changed that should affect the way I use smoothing functions?
-desika
File "/Users/desika/Dropbox/powderday/particle_smooth_yt.py", line 41, in yt_smooth saved["metallicity"] = ad["gas", "metallicity"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 214, in __getitem__ self.get_data(f) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 623, in get_data self._generate_fields(fields_to_generate) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 640, in _generate_fields fd = self._generate_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 251, in _generate_field tr = self._generate_fluid_field(field) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 271, in _generate_fluid_field rv = finfo(gen_obj) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/derived_field.py", line 178, in __call__ dd = self._function(self, data) File "/Users/desika/yt-x86_64/src/yt-hg/yt/fields/fluid_fields.py", line 153, in _metallicity tr = data[ftype, "metal_density"] / data[ftype, "density"] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 207, in __getitem__ f = self._determine_fields([key])[0] File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 455, in _determine_fields finfo = self.pf._get_field_info(ftype, fname) File "/Users/desika/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 487, in _get_field_info raise YTFieldNotFound((ftype, fname), self) yt.utilities.exceptions.YTFieldNotFound: Could not find field '('gas', 'metal_density')' in snapshot_006.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Desika Narayanan
-
Matthew Turk