[yt-svn] commit/yt-3.0: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Aug 16 13:45:54 PDT 2013


3 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/7372a6bb4bb0/
Changeset:   7372a6bb4bb0
Branch:      yt-3.0
User:        ngoldbaum
Date:        2013-08-16 20:25:12
Summary:     Fixing an error in float casting during enzo particle selection.
Affected #:  1 file

diff -r e596b87e779b561820921a24902fb076239c6907 -r 7372a6bb4bb0bd9891b670b19191fe95391aea5f yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -115,6 +115,7 @@
                 if g.NumberOfParticles == 0: continue
                 x, y, z = (data[g.id].pop("particle_position_%s" % ax)
                            for ax in 'xyz')
+                x, y, z = (np.array(arr, dtype='float64') for arr in (x, y, z))
                 size += g.count_particles(selector, x, y, z)
         read_fields = fields[:]
         for field in fields:
@@ -132,6 +133,7 @@
                 if g.NumberOfParticles == 0: continue
                 x, y, z = (data[g.id]["particle_position_%s" % ax]
                            for ax in 'xyz')
+                x, y, z = (np.array(arr, dtype='float64') for arr in (x, y, z))
                 mask = g.select_particles(selector, x, y, z)
                 if mask is None: continue
                 for field in set(fields):


https://bitbucket.org/yt_analysis/yt-3.0/commits/4c00e946446a/
Changeset:   4c00e946446a
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-08-16 20:35:38
Summary:     Adding a YTIllDefinedBounds exception.
Affected #:  2 files

diff -r 7372a6bb4bb0bd9891b670b19191fe95391aea5f -r 4c00e946446aeffade7bbf03f74df789df48a2b6 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -183,6 +183,8 @@
 
         # Get our bins
         if log_space:
+            if lower_bound <= 0.0 or upper_bound <= 0.0:
+                raise YTIllDefinedBounds(lower_bound, upper_bound)
             func = np.logspace
             lower_bound, upper_bound = np.log10(lower_bound), np.log10(upper_bound)
         else:
@@ -522,7 +524,10 @@
         return [self.x_bin_field, self.y_bin_field]
 
 def fix_bounds(upper, lower, logit):
-    if logit: return np.log10(upper), np.log10(lower)
+    if logit:
+        if lower <= 0.0 or upper <= 0.0:
+            raise YTIllDefinedBounds(lower, upper)
+        return np.log10(upper), np.log10(lower)
     return upper, lower
 
 class BinnedProfile2DInlineCut(BinnedProfile2D):

diff -r 7372a6bb4bb0bd9891b670b19191fe95391aea5f -r 4c00e946446aeffade7bbf03f74df789df48a2b6 yt/utilities/exceptions.py
--- a/yt/utilities/exceptions.py
+++ b/yt/utilities/exceptions.py
@@ -287,3 +287,14 @@
     def __str__(self):
         return "Filter '%s' ill-defined.  Applied to shape %s but is shape %s." % (
             self.filter, self.s1, self.s2)
+
+class YTIllDefinedBounds(YTException):
+    def __init__(self, lb, ub):
+        self.lb = lb
+        self.ub = ub
+
+    def __str__(self):
+        v =  "The bounds %0.3e and %0.3e are ill-defined. " % (self.lb, self.ub)
+        v += "Typically this happens when a log binning is specieid"
+        v += "and zero or negative values are given for the bounds."
+        return v


https://bitbucket.org/yt_analysis/yt-3.0/commits/ae9b8be1c76e/
Changeset:   ae9b8be1c76e
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-08-16 22:44:56
Summary:     Fixing typo
Affected #:  1 file

diff -r 4c00e946446aeffade7bbf03f74df789df48a2b6 -r ae9b8be1c76e2198c24d3299bb0e69217f4b7ac0 yt/utilities/exceptions.py
--- a/yt/utilities/exceptions.py
+++ b/yt/utilities/exceptions.py
@@ -295,6 +295,6 @@
 
     def __str__(self):
         v =  "The bounds %0.3e and %0.3e are ill-defined. " % (self.lb, self.ub)
-        v += "Typically this happens when a log binning is specieid"
+        v += "Typically this happens when a log binning is specified "
         v += "and zero or negative values are given for the bounds."
         return v

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