[yt-svn] commit/yt: MatthewTurk: Quick fix to get around roundoff error in the progressbar.

Bitbucket commits-noreply at bitbucket.org
Wed Sep 19 06:05:00 PDT 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/2120043a7851/
changeset:   2120043a7851
branch:      yt
user:        MatthewTurk
date:        2012-09-19 15:04:53
summary:     Quick fix to get around roundoff error in the progressbar.

Sam, any suggestions would help!
affected #:  1 file

diff -r d77fb0031d39753d51694f464b35a4622fe98441 -r 2120043a7851f77c41c67f5301640528cc8b5314 yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -998,11 +998,11 @@
         anprocs = 2**par_tree_depth
 
         volume_partitioned = 0.0
-        pbar = get_pbar("Building kd-Tree",
-                np.prod(self.domain_right_edge-self.domain_left_edge))
+        total_vol = np.prod(self.domain_right_edge-self.domain_left_edge)
+        pbar = get_pbar("Building kd-Tree", total_vol)
 
         while current_node is not None:
-            pbar.update(volume_partitioned)
+            pbar.update(min(volume_partitioned, total_vol))
 
             # If we don't have any grids, that means we are revisiting
             # a dividing node, and there is nothing to be done.

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