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

Bitbucket commits-noreply at bitbucket.org
Wed Jun 15 07:57:27 PDT 2011


3 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/79016a0599d5/
changeset:   79016a0599d5
branch:      yt
user:        MatthewTurk
date:        2011-06-13 23:34:52
summary:     Fixing the docstring for the projection
affected #:  1 file (10 bytes)

--- a/yt/data_objects/data_containers.py	Mon Jun 13 10:53:12 2011 -0400
+++ b/yt/data_objects/data_containers.py	Mon Jun 13 17:34:52 2011 -0400
@@ -1431,14 +1431,14 @@
         This is a data object corresponding to a line integral through the
         simulation domain.
 
-        This object is typically accessed through the `quad_proj` object that
+        This object is typically accessed through the `proj` object that
         hangs off of hierarchy objects.  AMRQuadProj is a projection of a
         `field` along an `axis`.  The field can have an associated
         `weight_field`, in which case the values are multiplied by a weight
         before being summed, and then divided by the sum of that weight; the
         two fundamental modes of operating are direct line integral (no
         weighting) and average along a line of sight (weighting.)  What makes
-        `quad_proj` different from the standard projection mechanism is that it
+        `proj` different from the standard projection mechanism is that it
         utilizes a quadtree data structure, rather than the old mechanism for
         projections.  It will not run in parallel, but serial runs should be
         substantially faster.  Note also that lines of sight are integrated at


http://bitbucket.org/yt_analysis/yt/changeset/f4def43e5290/
changeset:   f4def43e5290
branch:      yt
user:        MatthewTurk
date:        2011-06-15 16:42:20
summary:     Merge
affected #:  6 files (535 bytes)

--- a/yt/analysis_modules/star_analysis/sfr_spectrum.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/analysis_modules/star_analysis/sfr_spectrum.py	Wed Jun 15 10:42:20 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"]


--- a/yt/data_objects/data_containers.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/data_objects/data_containers.py	Wed Jun 15 10:42:20 2011 -0400
@@ -1536,7 +1536,7 @@
     def _get_tree(self, nvals):
         xd = self.pf.domain_dimensions[x_dict[self.axis]]
         yd = self.pf.domain_dimensions[y_dict[self.axis]]
-        return QuadTree(na.array([xd,yd]), nvals)
+        return QuadTree(na.array([xd,yd], dtype='int64'), nvals)
 
     def _get_dls(self, grid, fields):
         # Place holder for a time when maybe we will not be doing just


--- a/yt/data_objects/static_output.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/data_objects/static_output.py	Wed Jun 15 10:42:20 2011 -0400
@@ -62,12 +62,13 @@
             _cached_pfs[apath] = obj
         return _cached_pfs[apath]
 
-    def __init__(self, filename, data_style=None):
+    def __init__(self, filename, data_style=None, file_style=None):
         """
         Base class for generating new output types.  Principally consists of
         a *filename* and a *data_style* which will be passed on to children.
         """
         self.data_style = data_style
+        self.file_style = file_style
         self.parameter_filename = str(filename)
         self.basename = os.path.basename(filename)
         self.directory = os.path.expanduser(os.path.dirname(filename))


--- a/yt/frontends/enzo/data_structures.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/frontends/enzo/data_structures.py	Wed Jun 15 10:42:20 2011 -0400
@@ -135,6 +135,10 @@
     def __init__(self, pf, data_style):
         
         self.data_style = data_style
+        if pf.file_style != None:
+            self._bn = pf.file_style
+        else:
+            self._bn = "%s.cpu%%04i"
         self.hierarchy_filename = os.path.abspath(
             "%s.hierarchy" % (pf.parameter_filename))
         harray_fn = self.hierarchy_filename[:-9] + "harrays"
@@ -193,7 +197,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 +292,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
@@ -630,6 +637,7 @@
     _hierarchy_class = EnzoHierarchy
     _fieldinfo_class = EnzoFieldContainer
     def __init__(self, filename, data_style=None,
+                 file_style = None,
                  parameter_override = None,
                  conversion_override = None,
                  storage_filename = None):
@@ -649,7 +657,7 @@
         self._conversion_override = conversion_override
         self.storage_filename = storage_filename
 
-        StaticOutput.__init__(self, filename, data_style)
+        StaticOutput.__init__(self, filename, data_style, file_style=file_style)
         if "InitialTime" not in self.parameters:
             self.current_time = 0.0
         rp = os.path.join(self.directory, "rates.out")


--- a/yt/frontends/flash/data_structures.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/frontends/flash/data_structures.py	Wed Jun 15 10:42:20 2011 -0400
@@ -297,9 +297,9 @@
 
         # Determine domain dimensions
         try:
-            nxb = self._find_parameter("integer", "nxb", handle = self._handle)
-            nyb = self._find_parameter("integer", "nyb", handle = self._handle)
-            nzb = self._find_parameter("integer", "nzb", handle = self._handle)
+            nxb = self._find_parameter("integer", "nxb", scalar = True, handle = self._handle)
+            nyb = self._find_parameter("integer", "nyb", scalar = True, handle = self._handle)
+            nzb = self._find_parameter("integer", "nzb", scalar = True, handle = self._handle)
         except KeyError:
             nxb, nyb, nzb = [int(self._handle["/simulation parameters"]['n%sb' % ax])
                               for ax in 'xyz']


--- a/yt/visualization/eps_writer.py	Mon Jun 13 17:34:52 2011 -0400
+++ b/yt/visualization/eps_writer.py	Wed Jun 15 10:42:20 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):


http://bitbucket.org/yt_analysis/yt/changeset/30019057676a/
changeset:   30019057676a
branch:      yt
user:        MatthewTurk
date:        2011-06-15 16:55:57
summary:     Adding some particle units -- velocity, mass -- to Nyx/Castro
affected #:  1 file (265 bytes)

--- a/yt/frontends/castro/data_structures.py	Wed Jun 15 10:42:20 2011 -0400
+++ b/yt/frontends/castro/data_structures.py	Wed Jun 15 10:55:57 2011 -0400
@@ -620,6 +620,7 @@
             line = a_file.readline().strip()
             a_file.close()
             self.parameters["CosmologyCurrentRedshift"] = 1/float(line) - 1
+            self.cosmological_scale_factor = float(line)
             self.current_redshift = self.parameters["CosmologyCurrentRedshift"]
         else:
             self.current_redshift = self.omega_lambda = self.omega_matter = \
@@ -668,7 +669,18 @@
         self.time_units = {}
         if len(self.parameters) == 0:
             self._parse_parameter_file()
-        self._setup_nounits_units()
+        if self.cosmological_simulation:
+            cf = 1e5*(self.cosmological_scale_factor)
+            for ax in 'xyz':
+                self.units['particle_velocity_%s' % ax] = cf
+            self.units['particle_mass'] = 1.989e33
+        mylog.warning("Setting 1.0 in code units to be 1.0 cm")
+        if not self.has_key("TimeUnits"):
+            mylog.warning("No time units.  Setting 1.0 = 1 second.")
+            self.conversion_factors["Time"] = 1.0
+        for unit in mpc_conversion.keys():
+            self.units[unit] = mpc_conversion[unit] / mpc_conversion["cm"]
+        
         self.conversion_factors = defaultdict(lambda: 1.0)
         self.time_units['1'] = 1
         self.units['1'] = 1.0
@@ -683,10 +695,3 @@
 
     def _setup_nounits_units(self):
         z = 0
-        mylog.warning("Setting 1.0 in code units to be 1.0 cm")
-        if not self.has_key("TimeUnits"):
-            mylog.warning("No time units.  Setting 1.0 = 1 second.")
-            self.conversion_factors["Time"] = 1.0
-        for unit in mpc_conversion.keys():
-            self.units[unit] = mpc_conversion[unit] / mpc_conversion["cm"]
-

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