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

Bitbucket commits-noreply at bitbucket.org
Thu Jun 30 12:36:09 PDT 2011


2 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/1bbc70c6b9be/
changeset:   1bbc70c6b9be
branch:      yt
user:        MatthewTurk
date:        2011-06-30 21:35:47
summary:     Use the Queue.Queue.join() method instead of incorrectly implementing one on
my own.
affected #:  2 files (142 bytes)

--- a/yt/gui/reason/bottle_mods.py	Wed Jun 29 15:16:27 2011 -0600
+++ b/yt/gui/reason/bottle_mods.py	Thu Jun 30 12:35:47 2011 -0700
@@ -38,9 +38,6 @@
 route_watchers = []
 payloads = []
 
-orig_stdout = sys.stdout
-orig_stderr = sys.stderr
-
 def preroute(future_route, *args, **kwargs):
     def router(func):
         route_functions[future_route] = (args, kwargs, func)
@@ -153,8 +150,7 @@
             continue
             w._route_prefix = token
     repl.activate()
-    while not repl.execution_thread.queue.empty():
-        time.sleep(1)
+    repl.execution_thread.wait()
     print
     print
     print "============================================================================="


--- a/yt/gui/reason/extdirect_repl.py	Wed Jun 29 15:16:27 2011 -0600
+++ b/yt/gui/reason/extdirect_repl.py	Thu Jun 30 12:35:47 2011 -0700
@@ -108,23 +108,26 @@
         while 1:
             #print "Checking for a queue ..."
             try:
-                task = self.queue.get(True, 10)
-            except (Queue.Full, Queue.Empty):
+                task = self.queue.get(True, 1)
+            except Queue.Empty:
                 if self.repl.stopped: return
                 continue
-            #print "Received the task", task
+            print "Received the task", task
             if task['type'] == 'code':
                 self.execute_one(task['code'], task['hide'])
                 self.queue.task_done()
             elif task['type'] == 'add_widget':
                 #print "Adding new widget"
-                self.queue.task_done()
                 new_code = self.repl._add_widget(
                     task['name'], task['widget_data_name'])
                 #print "Got this command:", new_code
-                self.repl.execute(new_code, hide=True)
+                self.execute_one(new_code, hide=True)
+                self.queue.task_done()
                 #print "Executed!"
 
+    def wait(self):
+        self.queue.join()
+
     def execute_one(self, code, hide):
         self.repl.executed_cell_texts.append(code)
 
@@ -135,13 +138,13 @@
             print "====================                ===================="
             print result
             print "========================================================"
-        if hide: return
-        self.repl.payload_handler.add_payload(
-            {'type': 'cell_results',
-             'output': result,
-             'input': highlighter(code),
-             'raw_input': code},
-            )
+        if not hide:
+            self.repl.payload_handler.add_payload(
+                {'type': 'cell_results',
+                 'output': result,
+                 'input': highlighter(code),
+                 'raw_input': code},
+                )
 
 def deliver_image(im):
     if hasattr(im, 'read'):


http://bitbucket.org/yt_analysis/yt/changeset/3d8c110211c8/
changeset:   3d8c110211c8
branch:      yt
user:        MatthewTurk
date:        2011-06-30 21:36:03
summary:     Merge
affected #:  1 file (97 bytes)

--- a/yt/visualization/fixed_resolution.py	Thu Jun 30 12:35:47 2011 -0700
+++ b/yt/visualization/fixed_resolution.py	Thu Jun 30 12:36:03 2011 -0700
@@ -29,6 +29,7 @@
     y_dict, \
     axis_names
 import _MPL
+import numpy as na
 
 class FixedResolutionBuffer(object):
     def __init__(self, data_source, bounds, buff_size, antialias = True,
@@ -96,15 +97,16 @@
         self.periodic = periodic
 
         # Handle periodicity, just in case
-        DLE = self.pf.domain_left_edge
-        DRE = self.pf.domain_right_edge
-        DD = float(self.periodic)*(DRE - DLE)
-        axis = self.data_source.axis
-        xax = x_dict[axis]
-        yax = y_dict[axis]
-        self._period = (DD[xax], DD[yax])
-        self._edges = ( (DLE[xax], DRE[xax]), (DLE[yax], DRE[yax]) )
-
+        if self.data_source.axis < 3:
+            DLE = self.pf.domain_left_edge
+            DRE = self.pf.domain_right_edge
+            DD = float(self.periodic)*(DRE - DLE)
+            axis = self.data_source.axis
+            xax = x_dict[axis]
+            yax = y_dict[axis]
+            self._period = (DD[xax], DD[yax])
+            self._edges = ( (DLE[xax], DRE[xax]), (DLE[yax], DRE[yax]) )
+        
     def __getitem__(self, item):
         if item in self.data: return self.data[item]
         mylog.info("Making a fixed resolution buffer of %d by %d" % \

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