[yt-svn] commit/yt: brittonsmith: Fixed bug in dm_density field where it was not checking properly

Bitbucket commits-noreply at bitbucket.org
Fri Dec 9 11:17:03 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/40ea2908895f/
changeset:   40ea2908895f
branch:      yt
user:        brittonsmith
date:        2011-12-09 20:15:00
summary:     Fixed bug in dm_density field where it was not checking properly
for the existence of creation_time.
affected #:  1 file

diff -r 00cb9d84bd3099ac15060e29f0b929cb1ea9367e -r 40ea2908895ff6b9dd0dbbddd6e8da0346273886 yt/frontends/enzo/fields.py
--- a/yt/frontends/enzo/fields.py
+++ b/yt/frontends/enzo/fields.py
@@ -296,11 +296,12 @@
 def _dmpdensity(field, data):
     blank = na.zeros(data.ActiveDimensions, dtype='float32')
     if data.NumberOfParticles == 0: return blank
-    if 'creation_time' in data.keys():
+    if 'creation_time' in data.pf.field_info:
         filter = data['creation_time'] <= 0.0
         if not filter.any(): return blank
     else:
         filter = na.ones(data.NumberOfParticles, dtype='bool')
+    if not filter.any(): return blank
     amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
                            data["particle_position_y"][filter].astype(na.float64),
                            data["particle_position_z"][filter].astype(na.float64),

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

--

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