[yt-svn] commit/yt: ngoldbaum: Merged in atmyers/yt-fixes/yt-3.0 (pull request #987)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jul 1 17:46:47 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/5403193d8a46/
Changeset:   5403193d8a46
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-02 02:46:39
Summary:     Merged in atmyers/yt-fixes/yt-3.0 (pull request #987)

Fixing an issue in the Chombo frontend related to the switch to HDF5FileHandler
Affected #:  3 files

diff -r 21ae8b1d754407e453111684de7f6cb7f621d69d -r 5403193d8a46d5f8c166dbaa259653f6437056e6 yt/frontends/chombo/data_structures.py
--- a/yt/frontends/chombo/data_structures.py
+++ b/yt/frontends/chombo/data_structures.py
@@ -145,14 +145,14 @@
 
         # look for fluid fields
         output_fields = []
-        for key, val in self._handle['/'].attrs.items():
+        for key, val in self._handle.attrs.items():
             if key.startswith("component"):
                 output_fields.append(val)
         self.field_list = [("chombo", c) for c in output_fields]
 
         # look for particle fields
         particle_fields = []
-        for key, val in self._handle['/'].attrs.items():
+        for key, val in self._handle.attrs.items():
             if key.startswith("particle"):
                 particle_fields.append(val)
         self.field_list.extend([("io", c) for c in particle_fields])        

diff -r 21ae8b1d754407e453111684de7f6cb7f621d69d -r 5403193d8a46d5f8c166dbaa259653f6437056e6 yt/frontends/chombo/io.py
--- a/yt/frontends/chombo/io.py
+++ b/yt/frontends/chombo/io.py
@@ -37,7 +37,7 @@
         if self._field_dict is not None:
             return self._field_dict
         field_dict = {}
-        for key, val in self._handle['/'].attrs.items():
+        for key, val in self._handle.attrs.items():
             if key.startswith('component_'):
                 comp_number = int(re.match('component_(\d)', key).groups()[0])
                 field_dict[val] = comp_number
@@ -50,7 +50,7 @@
         if self._particle_field_index is not None:
             return self._particle_field_index
         field_dict = {}
-        for key, val in self._handle['/'].attrs.items():
+        for key, val in self._handle.attrs.items():
             if key.startswith('particle_'):
                 comp_number = int(re.match('particle_component_(\d)', key).groups()[0])
                 field_dict[val] = comp_number
@@ -58,8 +58,8 @@
         return self._particle_field_index        
         
     def _read_field_names(self,grid):
-        ncomp = int(self._handle['/'].attrs['num_components'])
-        fns = [c[1] for c in f['/'].attrs.items()[-ncomp-1:-1]]
+        ncomp = int(self._handle.attrs['num_components'])
+        fns = [c[1] for c in f.attrs.items()[-ncomp-1:-1]]
     
     def _read_data(self,grid,field):
 

diff -r 21ae8b1d754407e453111684de7f6cb7f621d69d -r 5403193d8a46d5f8c166dbaa259653f6437056e6 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -40,6 +40,10 @@
     def keys(self):
         return self.handle.keys
 
+    @property
+    def items(self):
+        return self.handle.items
+
 class FITSFileHandler(HDF5FileHandler):
     def __init__(self, filename):
         from yt.utilities.on_demand_imports import _astropy

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