[yt-svn] commit/yt: brittonsmith: Adding args and kwargs to save_state on Matt's suggestion.

Bitbucket commits-noreply at bitbucket.org
Thu Dec 1 08:45:18 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/c2bfa4fdd6b3/
changeset:   c2bfa4fdd6b3
branch:      yt
user:        brittonsmith
date:        2011-12-01 17:45:07
summary:     Adding args and kwargs to save_state on Matt's suggestion.
affected #:  1 file

diff -r 7ad37382dfce75f81c8167f793d77a59d08eb71f -r c2bfa4fdd6b31ce9128302eea45b677e78fddc41 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -78,11 +78,11 @@
     and ensures that after the function is called, the field_parameters will
     be returned to normal.
     """
-    def save_state(self, grid, field=None):
+    def save_state(self, grid, field=None, *args, **kwargs):
         old_params = grid.field_parameters
         old_keys = grid.field_data.keys()
         grid.field_parameters = self.field_parameters
-        tr = func(self, grid, field)
+        tr = func(self, grid, field, *args, **kwargs)
         grid.field_parameters = old_params
         grid.field_data = YTFieldData( [(k, grid.field_data[k]) for k in old_keys] )
         return tr

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