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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Apr 30 20:42:37 PDT 2013


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/ab3828c6bcf3/
Changeset:   ab3828c6bcf3
Branch:      yt
User:        MatthewTurk
Date:        2013-04-23 17:30:16
Summary:     Castro frontend brought slightly up to date.
Affected #:  2 files

diff -r 54de3b5fda5d8a9f074cd672ca2a6e066b9f77fc -r ab3828c6bcf3f9d07e6fe4eef1a17c9b2b613cdf yt/frontends/castro/data_structures.py
--- a/yt/frontends/castro/data_structures.py
+++ b/yt/frontends/castro/data_structures.py
@@ -60,7 +60,7 @@
 
     def __init__(self, LeftEdge, RightEdge, index, level, filename, offset,
                  dimensions, start, stop, paranoia=False, **kwargs):
-        super(CastroGrid, self).__init__(self, index, **kwargs)
+        super(CastroGrid, self).__init__(index, **kwargs)
         self.filename = filename
         self._offset = offset
         self._paranoid = paranoia  # TODO: Factor this behavior out in tests
@@ -72,7 +72,7 @@
         self.LeftEdge  = LeftEdge.copy()
         self.RightEdge = RightEdge.copy()
         self.index = index
-        self.level = level
+        self.Level = level
 
     def get_global_startindex(self):
         return self.start_index
@@ -115,8 +115,6 @@
     grid = CastroGrid
 
     def __init__(self, pf, data_style='castro_native'):
-        super(CastroHierarchy, self).__init__(self, pf, self.data_style)
-
         self.field_indexes = {}
         self.parameter_file = weakref.proxy(pf)
         header_filename = os.path.join(pf.fullplotdir, 'Header')
@@ -128,6 +126,8 @@
                                 self.parameter_file.paranoid_read) 
         self.read_particle_header()
         self._cache_endianness(self.levels[-1].grids[-1])
+
+        super(CastroHierarchy, self).__init__(pf, data_style)
         self._setup_data_io()
         self._setup_field_list()
         self._populate_hierarchy()
@@ -181,7 +181,7 @@
         counter += 1
 
         self.dx = np.zeros((self.n_levels, 3))
-        for i, line in enumerate(self.__global_header_lines[counter:counter+self.n_levels]):
+        for i, line in enumerate(self._global_header_lines[counter:counter+self.n_levels]):
             self.dx[i] = np.array(map(float, line.split()))
         counter += self.n_levels
         self.geometry = int(self._global_header_lines[counter])
@@ -424,21 +424,6 @@
         return self.grids[mask]
 
     def _setup_field_list(self):
-        self.derived_field_list = []
-
-        for field in self.field_info:
-            try:
-                fd = self.field_info[field].get_dependencies(pf=self.parameter_file)
-            except:
-                continue
-
-            available = np.all([f in self.field_list for f in fd.requested])
-            if available: self.derived_field_list.append(field)
-
-        for field in self.field_list:
-            if field not in self.derived_field_list:
-                self.derived_field_list.append(field)
-
         if self.parameter_file.use_particles:
             # We know which particle fields will exist -- pending further
             # changes in the future.
@@ -521,15 +506,15 @@
          * ASCII (not implemented in yt)
 
         """
-        super(CastroStaticOutput, self).__init__(self, plotname.rstrip("/"),
-                                                 data_style='castro_native')
         self.storage_filename = storage_filename
         self.paranoid_read = paranoia
         self.parameter_filename = paramFilename
         self.fparameter_filename = fparamFilename
         self.__ipfn = paramFilename
+        self.fparameters = {}
+        super(CastroStaticOutput, self).__init__(plotname.rstrip("/"),
+                                                 data_style='castro_native')
 
-        self.fparameters = {}
 
         # These should maybe not be hardcoded?
         ### TODO: this.
@@ -618,6 +603,7 @@
                 self.domain_left_edge = np.array([float(i) for i in vals.split()])
             elif param.startswith("particles.write_in_plotfile"):
                 self.use_particles = boxlib_bool_to_int(vals)
+            self.fparameters[param] = vals
 
         self.parameters["TopGridRank"] = len(self.parameters["TopGridDimensions"])
         self.dimensionality = self.parameters["TopGridRank"]
@@ -655,8 +641,11 @@
         for line in lines:
             if line.count("=") == 1:
                 param, vals = map(strip, map(rstrip, line.split("=")))
-                if vals.count("'") == 0:
-                    t = map(float, [a.replace('D','e').replace('d','e') for a in vals.split()]) # all are floating point.
+                if vals.count("'") == 0 and vals.count("\"") == 0:
+                    try:
+                        t = map(float, [a.replace('D','e').replace('d','e') for a in vals.split()]) # all are floating point.
+                    except ValueError:
+                        print "Failed on line", line
                 else:
                     t = vals.split()
                 if len(t) == 1:

diff -r 54de3b5fda5d8a9f074cd672ca2a6e066b9f77fc -r ab3828c6bcf3f9d07e6fe4eef1a17c9b2b613cdf yt/frontends/castro/io.py
--- a/yt/frontends/castro/io.py
+++ b/yt/frontends/castro/io.py
@@ -100,10 +100,10 @@
             if (gridSize != grid.ActiveDimensions).any():
                 print "Paranoia Error: Cell_H and %s do not agree on grid dimensions." %grid.filename
                 error_count += 1
-            if bytesPerReal != grid.hierarchy._bytesPerReal:
+            if bytesPerReal != grid.hierarchy._bytes_per_real:
                 print "Paranoia Error: Cell_H and %s do not agree on bytes per real number." %grid.filename
                 error_count += 1
-            if (bytesPerReal == grid.hierarchy._bytesPerReal and dtype != grid.hierarchy._dtype):
+            if (bytesPerReal == grid.hierarchy._bytes_per_real and dtype != grid.hierarchy._dtype):
                 print "Paranoia Error: Cell_H and %s do not agree on endianness." %grid.filename
                 error_count += 1
 
@@ -114,7 +114,7 @@
             start = grid.start_index
             stop = grid.stop_index
             dtype = grid.hierarchy._dtype
-            bytesPerReal = grid.hierarchy._bytesPerReal
+            bytesPerReal = grid.hierarchy._bytes_per_real
 
         nElements = grid.ActiveDimensions.prod()
 


https://bitbucket.org/yt_analysis/yt/commits/c5ca570658c6/
Changeset:   c5ca570658c6
Branch:      yt
User:        MatthewTurk
Date:        2013-05-01 05:42:32
Summary:     Merged in MatthewTurk/yt (pull request #483)

Castro frontend brought slightly up to date.
Affected #:  2 files

diff -r 8da80188ed6862e0bf9e04dab41b726bb7df8b97 -r c5ca570658c61817278dcd5047e1f532c1043ac2 yt/frontends/castro/data_structures.py
--- a/yt/frontends/castro/data_structures.py
+++ b/yt/frontends/castro/data_structures.py
@@ -60,7 +60,7 @@
 
     def __init__(self, LeftEdge, RightEdge, index, level, filename, offset,
                  dimensions, start, stop, paranoia=False, **kwargs):
-        super(CastroGrid, self).__init__(self, index, **kwargs)
+        super(CastroGrid, self).__init__(index, **kwargs)
         self.filename = filename
         self._offset = offset
         self._paranoid = paranoia  # TODO: Factor this behavior out in tests
@@ -72,7 +72,7 @@
         self.LeftEdge  = LeftEdge.copy()
         self.RightEdge = RightEdge.copy()
         self.index = index
-        self.level = level
+        self.Level = level
 
     def get_global_startindex(self):
         return self.start_index
@@ -115,8 +115,6 @@
     grid = CastroGrid
 
     def __init__(self, pf, data_style='castro_native'):
-        super(CastroHierarchy, self).__init__(self, pf, self.data_style)
-
         self.field_indexes = {}
         self.parameter_file = weakref.proxy(pf)
         header_filename = os.path.join(pf.fullplotdir, 'Header')
@@ -128,6 +126,8 @@
                                 self.parameter_file.paranoid_read) 
         self.read_particle_header()
         self._cache_endianness(self.levels[-1].grids[-1])
+
+        super(CastroHierarchy, self).__init__(pf, data_style)
         self._setup_data_io()
         self._setup_field_list()
         self._populate_hierarchy()
@@ -181,7 +181,7 @@
         counter += 1
 
         self.dx = np.zeros((self.n_levels, 3))
-        for i, line in enumerate(self.__global_header_lines[counter:counter+self.n_levels]):
+        for i, line in enumerate(self._global_header_lines[counter:counter+self.n_levels]):
             self.dx[i] = np.array(map(float, line.split()))
         counter += self.n_levels
         self.geometry = int(self._global_header_lines[counter])
@@ -424,21 +424,6 @@
         return self.grids[mask]
 
     def _setup_field_list(self):
-        self.derived_field_list = []
-
-        for field in self.field_info:
-            try:
-                fd = self.field_info[field].get_dependencies(pf=self.parameter_file)
-            except:
-                continue
-
-            available = np.all([f in self.field_list for f in fd.requested])
-            if available: self.derived_field_list.append(field)
-
-        for field in self.field_list:
-            if field not in self.derived_field_list:
-                self.derived_field_list.append(field)
-
         if self.parameter_file.use_particles:
             # We know which particle fields will exist -- pending further
             # changes in the future.
@@ -521,15 +506,15 @@
          * ASCII (not implemented in yt)
 
         """
-        super(CastroStaticOutput, self).__init__(self, plotname.rstrip("/"),
-                                                 data_style='castro_native')
         self.storage_filename = storage_filename
         self.paranoid_read = paranoia
         self.parameter_filename = paramFilename
         self.fparameter_filename = fparamFilename
         self.__ipfn = paramFilename
+        self.fparameters = {}
+        super(CastroStaticOutput, self).__init__(plotname.rstrip("/"),
+                                                 data_style='castro_native')
 
-        self.fparameters = {}
 
         # These should maybe not be hardcoded?
         ### TODO: this.
@@ -618,6 +603,7 @@
                 self.domain_left_edge = np.array([float(i) for i in vals.split()])
             elif param.startswith("particles.write_in_plotfile"):
                 self.use_particles = boxlib_bool_to_int(vals)
+            self.fparameters[param] = vals
 
         self.parameters["TopGridRank"] = len(self.parameters["TopGridDimensions"])
         self.dimensionality = self.parameters["TopGridRank"]
@@ -655,8 +641,11 @@
         for line in lines:
             if line.count("=") == 1:
                 param, vals = map(strip, map(rstrip, line.split("=")))
-                if vals.count("'") == 0:
-                    t = map(float, [a.replace('D','e').replace('d','e') for a in vals.split()]) # all are floating point.
+                if vals.count("'") == 0 and vals.count("\"") == 0:
+                    try:
+                        t = map(float, [a.replace('D','e').replace('d','e') for a in vals.split()]) # all are floating point.
+                    except ValueError:
+                        print "Failed on line", line
                 else:
                     t = vals.split()
                 if len(t) == 1:

diff -r 8da80188ed6862e0bf9e04dab41b726bb7df8b97 -r c5ca570658c61817278dcd5047e1f532c1043ac2 yt/frontends/castro/io.py
--- a/yt/frontends/castro/io.py
+++ b/yt/frontends/castro/io.py
@@ -100,10 +100,10 @@
             if (gridSize != grid.ActiveDimensions).any():
                 print "Paranoia Error: Cell_H and %s do not agree on grid dimensions." %grid.filename
                 error_count += 1
-            if bytesPerReal != grid.hierarchy._bytesPerReal:
+            if bytesPerReal != grid.hierarchy._bytes_per_real:
                 print "Paranoia Error: Cell_H and %s do not agree on bytes per real number." %grid.filename
                 error_count += 1
-            if (bytesPerReal == grid.hierarchy._bytesPerReal and dtype != grid.hierarchy._dtype):
+            if (bytesPerReal == grid.hierarchy._bytes_per_real and dtype != grid.hierarchy._dtype):
                 print "Paranoia Error: Cell_H and %s do not agree on endianness." %grid.filename
                 error_count += 1
 
@@ -114,7 +114,7 @@
             start = grid.start_index
             stop = grid.stop_index
             dtype = grid.hierarchy._dtype
-            bytesPerReal = grid.hierarchy._bytesPerReal
+            bytesPerReal = grid.hierarchy._bytes_per_real
 
         nElements = grid.ActiveDimensions.prod()

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