[yt-svn] commit/yt: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Aug 20 09:52:01 PDT 2015


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/c186764bbfad/
Changeset:   c186764bbfad
Branch:      yt
User:        ngoldbaum
Date:        2015-08-13 18:28:05+00:00
Summary:     Ensure the FRB is valid before executing _setup_plots.

This fixes issues with invalid FRBs being used if users call _setup_plots
directly in their own scripts.
Affected #:  1 file

diff -r 603eab147248f1a165778c76208906201eb7baae -r c186764bbfad3c6821d8819e17dedf2fafd3b987 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -731,7 +731,11 @@
         return xc, yc
 
     def _setup_plots(self):
-        if self._plot_valid: return
+        if self._plot_valid:
+            return
+        if not self._data_valid:
+            self._recreate_frb()
+            self._data_valid = True
         self._colorbar_valid = True
         for f in list(set(self.data_source._determine_fields(self.fields))):
             axis_index = self.data_source.axis


https://bitbucket.org/yt_analysis/yt/commits/2e606477eeda/
Changeset:   2e606477eeda
Branch:      yt
User:        ngoldbaum
Date:        2015-08-13 20:09:21+00:00
Summary:     Delete commented code from the apply_callbacks() function
Affected #:  1 file

diff -r c186764bbfad3c6821d8819e17dedf2fafd3b987 -r 2e606477eeda75654d1f2523368fc7dae40b14db yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -81,7 +81,6 @@
 def apply_callback(f):
     @wraps(f)
     def newfunc(*args, **kwargs):
-        #rv = f(*args[1:], **kwargs)
         args[0]._callbacks.append((f.__name__, (args, kwargs)))
         return args[0]
     return newfunc


https://bitbucket.org/yt_analysis/yt/commits/7e379732bed2/
Changeset:   7e379732bed2
Branch:      yt
User:        ngoldbaum
Date:        2015-08-13 20:10:19+00:00
Summary:     Call run_callbacks in _setup_plots in case _setup_plots was called by a user
Affected #:  2 files

diff -r 2e606477eeda75654d1f2523368fc7dae40b14db -r 7e379732bed28259900126d36934d191790e212a yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -71,9 +71,9 @@
             if not args[0]._data_valid:
                 args[0]._recreate_frb()
         if not args[0]._plot_valid:
+            # it is the responsibility of _setup_plots to call
+            # args[0].run_callbacks()
             args[0]._setup_plots()
-            if hasattr(args[0], 'run_callbacks'):
-                args[0].run_callbacks()
         rv = f(*args, **kwargs)
         return rv
     return newfunc

diff -r 2e606477eeda75654d1f2523368fc7dae40b14db -r 7e379732bed28259900126d36934d191790e212a yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -977,7 +977,7 @@
                 self.plots[f]._toggle_colorbar(draw_colorbar)
 
         self._set_font_properties()
-
+        self.run_callbacks()
         self._plot_valid = True
 
     def setup_callbacks(self):


https://bitbucket.org/yt_analysis/yt/commits/37669d402f18/
Changeset:   37669d402f18
Branch:      yt
User:        chummels
Date:        2015-08-20 16:51:52+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1698)

Ensure the FRB is valid before executing _setup_plots.
Affected #:  2 files

diff -r 4bfdb0ddccdb3bad26724484a89149b5a7ecfe51 -r 37669d402f187cc7b51d3f6043f2e23dd80eb8be yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -71,9 +71,9 @@
             if not args[0]._data_valid:
                 args[0]._recreate_frb()
         if not args[0]._plot_valid:
+            # it is the responsibility of _setup_plots to call
+            # args[0].run_callbacks()
             args[0]._setup_plots()
-            if hasattr(args[0], 'run_callbacks'):
-                args[0].run_callbacks()
         rv = f(*args, **kwargs)
         return rv
     return newfunc
@@ -81,7 +81,6 @@
 def apply_callback(f):
     @wraps(f)
     def newfunc(*args, **kwargs):
-        #rv = f(*args[1:], **kwargs)
         args[0]._callbacks.append((f.__name__, (args, kwargs)))
         return args[0]
     return newfunc

diff -r 4bfdb0ddccdb3bad26724484a89149b5a7ecfe51 -r 37669d402f187cc7b51d3f6043f2e23dd80eb8be yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -729,7 +729,11 @@
         return xc, yc
 
     def _setup_plots(self):
-        if self._plot_valid: return
+        if self._plot_valid:
+            return
+        if not self._data_valid:
+            self._recreate_frb()
+            self._data_valid = True
         self._colorbar_valid = True
         for f in list(set(self.data_source._determine_fields(self.fields))):
             axis_index = self.data_source.axis
@@ -971,7 +975,7 @@
                 self.plots[f]._toggle_colorbar(draw_colorbar)
 
         self._set_font_properties()
-
+        self.run_callbacks()
         self._plot_valid = True
 
     def setup_callbacks(self):

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