[yt-svn] commit/yt: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Wed May 9 08:04:06 PDT 2012


2 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/65606cd03a48/
changeset:   65606cd03a48
branch:      yt
user:        xarthisius
date:        2012-05-09 16:34:08
summary:     [universal_fields:_Contours] Don't assume that Density field exists
affected #:  1 file

diff -r c196ec2121348e38845b0cdc1893c27c1f665ff2 -r 65606cd03a48138f9f3d8046c6c90fd556fdeb8a yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -467,7 +467,11 @@
           units=r"\rm{s}^{-1}")
 
 def _Contours(field, data):
-    return na.ones(data["Density"].shape)*-1
+    try:
+       contours = -na.ones_like(data["Density"])
+    except KeyError:
+       contours = -na.ones_like(data[data.pf.field_info.keys()[0]])
+    return contours
 add_field("Contours", validators=[ValidateSpatial(0)], take_log=False,
           display_field=False, function=_Contours)
 add_field("tempContours", function=_Contours,



https://bitbucket.org/yt_analysis/yt/changeset/fa8f89f1a1b1/
changeset:   fa8f89f1a1b1
branch:      yt
user:        xarthisius
date:        2012-05-09 17:02:55
summary:     [universal_fields:_Contours] use 'Ones' field instead of crude invocation to first field. Thanks to mjturk for suggestion
affected #:  1 file

diff -r 65606cd03a48138f9f3d8046c6c90fd556fdeb8a -r fa8f89f1a1b1a53e5d966f305f92dc600bd4273f yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -467,11 +467,7 @@
           units=r"\rm{s}^{-1}")
 
 def _Contours(field, data):
-    try:
-       contours = -na.ones_like(data["Density"])
-    except KeyError:
-       contours = -na.ones_like(data[data.pf.field_info.keys()[0]])
-    return contours
+    return -na.ones_like(data["Ones"])
 add_field("Contours", validators=[ValidateSpatial(0)], take_log=False,
           display_field=False, function=_Contours)
 add_field("tempContours", function=_Contours,

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