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

Bitbucket commits-noreply at bitbucket.org
Tue Dec 6 13:16:35 PST 2011


2 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/92332f50253a/
changeset:   92332f50253a
branch:      yt
user:        MatthewTurk
date:        2011-12-06 22:15:48
summary:     Adding doublecheck for dimensionality that should work with FLASH 2.5 datasets.
affected #:  1 file

diff -r 01838e47eca2e941b3ab2eece57babea2e3e1715 -r 92332f50253aa5c0d43102dcb1918e8c9c5d9af8 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -265,6 +265,7 @@
     def _find_parameter(self, ptype, pname, scalar = False):
         nn = "/%s %s" % (ptype,
                 {False: "runtime parameters", True: "scalars"}[scalar])
+        if nn not in self._handle: raise KeyError(nn)
         for tpname, pval in self._handle[nn][:]:
             if tpname.strip() == pname:
                 return pval
@@ -285,20 +286,26 @@
             [self._find_parameter("real", "%smin" % ax) for ax in 'xyz'])
         self.domain_right_edge = na.array(
             [self._find_parameter("real", "%smax" % ax) for ax in 'xyz'])
-        self.dimensionality = self._find_parameter("integer", "dimensionality",
-                                scalar = True)
 
         # Determine domain dimensions
         try:
             nxb = self._find_parameter("integer", "nxb", scalar = True)
             nyb = self._find_parameter("integer", "nyb", scalar = True)
             nzb = self._find_parameter("integer", "nzb", scalar = True)
+            dimensionality = self._find_parameter("integer", "dimensionality",
+                                    scalar = True)
         except KeyError:
             nxb, nyb, nzb = [int(self._handle["/simulation parameters"]['n%sb' % ax])
                               for ax in 'xyz']
+            dimensionality = 3
+            if nzb == 1: dimensionality = 2
+            if nyb == 1: dimensionality = 1
+            if dimensionality < 3:
+                mylog.warning("Guessing dimensionality as %s", dimensionality)
         nblockx = self._find_parameter("integer", "nblockx")
         nblocky = self._find_parameter("integer", "nblockx")
         nblockz = self._find_parameter("integer", "nblockx")
+        self.dimensionality = dimensionality
         self.domain_dimensions = \
             na.array([nblockx*nxb,nblocky*nyb,nblockz*nzb])
 



https://bitbucket.org/yt_analysis/yt/changeset/5220b10d9105/
changeset:   5220b10d9105
branch:      yt
user:        MatthewTurk
date:        2011-12-06 22:16:17
summary:     Merging
affected #:  1 file

diff -r 92332f50253aa5c0d43102dcb1918e8c9c5d9af8 -r 5220b10d9105af3cff9abe85bae5a983f26fc2a7 yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -1365,7 +1365,10 @@
             # Prepend the hdf5 file names with the full path.
             temp = []
             for item in line[1:]:
-                temp.append(self.pf.fullpath + '/' + item)
+                if item[0] == "/":
+                    temp.append(item)
+                else:
+                    temp.append(self.pf.fullpath + '/' + item)
             locations.append(temp)
         lines.close()
         return locations

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