[Yt-svn] commit/yt: MatthewTurk: Adding fn argument to two point functions to specify output filenames.

Bitbucket commits-noreply at bitbucket.org
Fri May 27 07:36:31 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/82ef600d56d0/
changeset:   82ef600d56d0
branches:    
user:        MatthewTurk
date:        2011-05-27 16:36:20
summary:     Adding fn argument to two point functions to specify output filenames.
affected #:  1 file (18 bytes)

--- a/yt/analysis_modules/two_point_functions/two_point_functions.py	Fri May 27 10:20:39 2011 -0400
+++ b/yt/analysis_modules/two_point_functions/two_point_functions.py	Fri May 27 07:36:20 2011 -0700
@@ -610,7 +610,7 @@
                 added_points = False
 
     @parallel_blocking_call
-    def write_out_means(self):
+    def write_out_means(self, fn = "%s.txt"):
         r"""Writes out the weighted-average value for each function for
         each dimension for each ruler length to a text file. The data is written
         to files of the name 'function_name.txt' in the current working
@@ -621,7 +621,7 @@
         >>> tpf.write_out_means()
         """
         for fset in self._fsets:
-            fp = self._write_on_root("%s.txt" % fset.function.__name__)
+            fp = self._write_on_root(fn % fset.function.__name__)
             fset._avg_bin_hits()
             line = "# length".ljust(sep)
             line += "count".ljust(sep)
@@ -643,7 +643,7 @@
             fp.close()
     
     @parallel_root_only
-    def write_out_arrays(self):
+    def write_out_arrays(self, fn = "%s.h5"):
         r"""Writes out the raw probability bins and the bin edges to an HDF5 file
         for each of the functions. The files are named 
         'function_name.txt' and saved in the current working directory.
@@ -654,7 +654,7 @@
         """
         if self.mine == 0:
             for fset in self._fsets:
-                f = h5py.File("%s.h5" % fset.function.__name__, "w")
+                f = h5py.File(fn % fset.function.__name__, "w")
                 bin_names = []
                 prob_names = []
                 bin_counts = []

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