yt-project / yt

Main yt repository
http://yt-project.org
Other
463 stars 276 forks source link

SPH datasets generate a large number of duplicate field warnings #979

Closed yt-fido closed 7 years ago

yt-fido commented 9 years ago

Originally reported by: Andrew Myers (Bitbucket: atmyers, GitHub: atmyers)


In PR # 1401, I added a warning that is triggered when a field gets added more than once. It turns out this happens all the time in at least the Gadget and OWLS frontends. These messages are harmless, but annoying. I think the SPH frontends should be changed so that each field is set up only once.


yt-fido commented 9 years ago

Original comment by Andrew Myers (Bitbucket: atmyers, GitHub: atmyers):


This was fixed in PR#1513

yt-fido commented 9 years ago

Original comment by Andrew Myers (Bitbucket: atmyers, GitHub: atmyers):


I think it's because those fields are listed as aliases to themselves in enzo/fields.py:

#!python

    known_particle_fields = (
        ("particle_position_x", ("code_length", [], None)),
        ("particle_position_y", ("code_length", [], None)),
        ("particle_position_z", ("code_length", [], None)),
        ("particle_velocity_x", (vel_units, ["particle_velocity_x"], None)),
        ("particle_velocity_y", (vel_units, ["particle_velocity_y"], None)),
        ("particle_velocity_z", (vel_units, ["particle_velocity_z"], None)),
        ("creation_time", ("code_time", [], None)),
        ("dynamical_time", ("code_time", [], None)),
        ("metallicity_fraction", ("code_metallicity", [], None)),
        ("metallicity", ("", [], None)),
        ("particle_type", ("", [], None)),
        ("particle_index", ("", [], None)),
        ("particle_mass", ("code_mass", ["particle_mass"], None)),
        ("GridID", ("", [], None)),
        ("identifier", ("", ["particle_index"], None)),
        ("level", ("", [], None)),
    )

So the mass and velocity fields get added twice, once as an output field, and again as an alias with the same name.

yt-fido commented 9 years ago

Original comment by Britton Smith (Bitbucket: brittonsmith, GitHub: brittonsmith):


This also triggers similar warnings with the Enzo frontend for the particle mass and particle velocity fields, but nothing else. Does anyone have any idea why this is?