[yt-svn] commit/yt-3.0: MatthewTurk: ActiveParticle types now add correctly to the unknown fields list.

Bitbucket commits-noreply at bitbucket.org
Thu Aug 9 15:37:06 PDT 2012


1 new commit in yt-3.0:


https://bitbucket.org/yt_analysis/yt-3.0/changeset/7e96504cc534/
changeset:   7e96504cc534
branch:      yt-3.0
user:        MatthewTurk
date:        2012-08-10 00:36:57
summary:     ActiveParticle types now add correctly to the unknown fields list.
affected #:  2 files

diff -r 124c39a69756b859be5606fdfc64729b8efc89e8 -r 7e96504cc5344671a63cbbe689f60b82b882f068 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -471,10 +471,8 @@
                                         fluids, self, self._current_chunk)
         self.field_data.update(read_fluids)
 
-        print "READING GENNING", particles
         read_particles, gen_particles = self.hierarchy._read_particle_fields(
                                         particles, self, self._current_chunk)
-        print "BACK", read_particles, gen_particles
         self.field_data.update(read_particles)
         fields_to_generate = gen_fluids + gen_particles
         index = 0


diff -r 124c39a69756b859be5606fdfc64729b8efc89e8 -r 7e96504cc5344671a63cbbe689f60b82b882f068 yt/geometry/geometry_handler.py
--- a/yt/geometry/geometry_handler.py
+++ b/yt/geometry/geometry_handler.py
@@ -109,6 +109,11 @@
             # it.
             ff = self.parameter_file.field_info.pop(field, None)
             if field not in known_fields:
+                if isinstance(field, types.TupleType) and \
+                   field[0] in self.parameter_file.particle_types:
+                    particle_type = True
+                else:
+                    particle_type = False
                 rootloginfo("Adding unknown field %s to list of fields", field)
                 cf = None
                 if self.parameter_file.has_key(field):
@@ -121,7 +126,7 @@
                 # will allow the same field detection mechanism to work for 1D, 2D
                 # and 3D fields.
                 self.pf.field_info.add_field(
-                        field, NullFunc,
+                        field, NullFunc, particle_type = particle_type,
                         convert_function=cf, take_log=False, units=r"Unknown")
             else:
                 mylog.debug("Adding known field %s to list of fields", field)

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list