[yt-dev] Field naming proposal

Nathan Goldbaum nathan12343 at gmail.com
Tue Dec 23 11:01:47 PST 2014


Hi all,

I've just issued a pull request that bears some developer discussion.

Right now yt is a bit of a wild west in terms of the field naming
convention for fields that reference a coordinate system.  See for example,
see issue 947:

https://bitbucket.org/yt_analysis/yt/issue/947/consistent-field-naming-for-spherical-and

I'd like to propose a naming convention for fields that reference a
coordinate system.  Gas and particle fields should be of the form:

(field_type, "<particle?>_<vector_field_name>_<coordinate>")

while index fields for coordinates should be of the form:

("index", "<coordinate>")

This fits within our existing field naming convention for cartesian
coordinates, e.g.:

("gas", "velocity_x")
(ptype, "particle_velocity_y")

as well as our convention for index coordinate fields, e.g.:

("index", "x")
("index", "spherical_theta")

This means that index fields do not need to explicitly reference themselves
as positions.  So we *won't* have field names like:

("index", "position_x")

I don't like the above construction because it's a bit redundant ("index"
implies that we are talking about a position or something similar).

Some existing field names will need to be changed to fit this.  In
particular, some of the index fields will need to be renamed to be more
verbose ("index", "spherical_r") becomes ("index", "spherical_radius") and
(ptype, "particle_spherical_position_radius") becomes (ptype,
"particle_position_spherical_radius").

Wherever an existing field name needs to change, I propose we mark the
existing field name for deprecation, stub it out, and make it an alias for
the field with the new field name.  In a future release, we can then remove
the deprecated fields.

I've implemented this for the particle fields (for the most part) in PR
1378:

https://bitbucket.org/yt_analysis/yt/pull-request/1378

I'm happy to update the field naming YTEP if this proposed field naming
scheme gets approval in this thread.

What do you all think?  Question, concerns?

-Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20141223/795f79db/attachment.htm>
-------------- next part --------------
_______________________________________________
yt-dev mailing list
yt-dev at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org


More information about the yt-dev mailing list