[yt-svn] commit/yt: MatthewTurk: Off-by-one error in data structures for enzo in grid random selection that

Bitbucket commits-noreply at bitbucket.org
Mon Mar 26 03:31:23 PDT 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/f66e9ce5d8aa/
changeset:   f66e9ce5d8aa
branch:      yt
user:        MatthewTurk
date:        2012-03-26 12:31:11
summary:     Off-by-one error in data structures for enzo in grid random selection that
shows up when you have two grids, the first of which having no fields and the
second of which having all the fields.
affected #:  1 file

diff -r 156942ea2ee49b2afbac8405304a22c9d41f89a2 -r f66e9ce5d8aab699ed91977f4c1b9a5c68711aab yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -481,7 +481,7 @@
                 mylog.debug("Added additional grid %s", first_grid)
             mylog.debug("Checking grids: %s", random_sample.tolist())
         else:
-            random_sample = na.mgrid[0:max(len(self.grids)-1,1)].astype("int32")
+            random_sample = na.mgrid[0:max(len(self.grids),1)].astype("int32")
         return self.grids[(random_sample,)]
 
     def find_particles_by_type(self, ptype, max_num=None, additional_fields=None):

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