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

Bitbucket commits-noreply at bitbucket.org
Tue Jun 14 08:07:05 PDT 2011


2 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/7c8272707015/
changeset:   7c8272707015
branch:      yt
user:        jwise77
date:        2011-06-14 17:00:45
summary:     Possible to specify and use the star particle metallicities as an
argument.
affected #:  1 file (114 bytes)

--- a/yt/analysis_modules/star_analysis/sfr_spectrum.py	Mon Jun 13 12:21:28 2011 -0700
+++ b/yt/analysis_modules/star_analysis/sfr_spectrum.py	Tue Jun 14 11:00:45 2011 -0400
@@ -328,6 +328,8 @@
             if star_metallicity_constant is not None:
                 self.star_metal = na.ones(self.star_mass.size, dtype='float64') * \
                     star_metallicity_constant
+            if star_metallicity_fraction is not None:
+                self.star_metal = star_metallicity_fraction
         else:
             # Get the data we need.
             ct = self._data_source["creation_time"]


http://bitbucket.org/yt_analysis/yt/changeset/bd1190b4d92c/
changeset:   bd1190b4d92c
branch:      yt
user:        jwise77
date:        2011-06-14 17:03:51
summary:     If the dataset cannot be found (i.e. working from a .yt file), then
default to packed HDF5.  This was causing problems from the command
line, but was worked around in a script by specifying the data_style.

Also added the argument to specify the naming convention of the data
files for backwards compatibility.

Fixed small inconsistency in eps_writer for Mpc units.
affected #:  2 files (182 bytes)

--- a/yt/frontends/enzo/data_structures.py	Tue Jun 14 11:00:45 2011 -0400
+++ b/yt/frontends/enzo/data_structures.py	Tue Jun 14 11:03:51 2011 -0400
@@ -132,9 +132,10 @@
     _strip_path = False
     grid = EnzoGrid
 
-    def __init__(self, pf, data_style):
+    def __init__(self, pf, data_style, file_style="%s.cpu%%04i"):
         
         self.data_style = data_style
+        self._bn = file_style
         self.hierarchy_filename = os.path.abspath(
             "%s.hierarchy" % (pf.parameter_filename))
         harray_fn = self.hierarchy_filename[:-9] + "harrays"
@@ -193,7 +194,11 @@
             self.data_style = 'enzo_hdf4'
             mylog.debug("Detected HDF4")
         except:
-            list_of_sets = hdf5_light_reader.ReadListOfDatasets(test_grid, "/")
+            try:
+                list_of_sets = hdf5_light_reader.ReadListOfDatasets(test_grid, "/")
+            except:
+                print "Could not find dataset.  Defaulting to packed HDF5"
+                list_of_sets = []
             if len(list_of_sets) == 0 and rank == 3:
                 mylog.debug("Detected packed HDF5")
                 self.data_style = 'enzo_packed_3d'
@@ -284,7 +289,6 @@
             second_grid.Level = first_grid.Level
         self.grid_levels[sgi] = second_grid.Level
 
-    _bn = "%s.cpu%%04i"
     def _parse_binary_hierarchy(self):
         mylog.info("Getting the binary hierarchy")
         if not ytcfg.getboolean("yt","serialize"): return False


--- a/yt/visualization/eps_writer.py	Tue Jun 14 11:00:45 2011 -0400
+++ b/yt/visualization/eps_writer.py	Tue Jun 14 11:03:51 2011 -0400
@@ -279,7 +279,7 @@
         if isinstance(plot, VMPlot):
             if units == None:
                 # Determine the best units
-                astro_units = ['cm', 'rsun', 'au', 'pc', 'kpc', 'Mpc']
+                astro_units = ['cm', 'rsun', 'au', 'pc', 'kpc', 'mpc']
                 best_fit = 0
                 while plot.width*plot.pf[astro_units[best_fit]] > 1e3 and \
                           best_fit < len(astro_units):

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