[yt-svn] commit/yt-3.0: MatthewTurk: This fixes broken tests. However: it relies on a .shape attribute.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri May 24 13:21:19 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/cdcd37b6f2fa/
Changeset:   cdcd37b6f2fa
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-05-24 22:18:20
Summary:     This fixes broken tests.  However: it relies on a .shape attribute.

In another PR, Doug has started removing the .shape attributes.  I am making a
note that we need a better solution to this -- for instance, we should be able
to query .ires, but unfortunately because of how covering grids work right now
we cannot.  I will be addressing this before we better support a non-global
mesh, which is on the roadmap for this Summer.
Affected #:  1 file

diff -r 1c607a2db7281ee3db313a707b62805b53cfad73 -r cdcd37b6f2fa39e411569d1fde8972dbad7e737f yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -90,18 +90,18 @@
           display_field=False)
 
 def _Zeros(field, data):
-    return np.zeros(data.ActiveDimensions, dtype='float64')
+    return np.zeros(data.shape, dtype='float64')
 add_field("Zeros", function=_Zeros,
-          validators=[ValidateSpatial(0)],
           projection_conversion="unitary",
           display_field = False)
 
 def _Ones(field, data):
-    return np.ones(data.ires.size, dtype='float64')
+    return np.ones(data.shape, dtype='float64')
 add_field("Ones", function=_Ones,
           projection_conversion="unitary",
           display_field = False)
-add_field("CellsPerBin", function=_Ones, display_field = False)
+add_field("CellsPerBin", function=_Ones,
+          display_field = False)
 
 def _SoundSpeed(field, data):
     if data.pf["EOSType"] == 1:

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