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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Apr 16 11:30:16 PDT 2013


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/cd2751781bed/
Changeset:   cd2751781bed
Branch:      yt
User:        xarthisius
Date:        2013-04-16 11:07:27
Summary:     [gdf] field_units attribute is a string not an array. Fixes #550
Affected #:  1 file

diff -r 51292a52b8cb411e6551a20709277e3c6ca22189 -r cd2751781beda239978abacceb02db371ed7ba2a yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -202,7 +202,7 @@
             except:
                 self.units[field_name] = 1.0
             try:
-                current_fields_unit = current_field.attrs['field_units'][0]
+                current_fields_unit = current_field.attrs['field_units']
             except:
                 current_fields_unit = ""
             self._fieldinfo_known.add_field(field_name, function=NullFunc, take_log=False,


https://bitbucket.org/yt_analysis/yt/commits/d0bc82a75da0/
Changeset:   d0bc82a75da0
Branch:      yt
User:        xarthisius
Date:        2013-04-16 17:40:12
Summary:     [gdf] convert bare try, except clauses into if statements. 'field_units' can now be either string or array
Affected #:  1 file

diff -r cd2751781beda239978abacceb02db371ed7ba2a -r d0bc82a75da022a0185165fb8b72c444dc4da104 yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -197,13 +197,13 @@
         self._handle = h5py.File(self.parameter_filename, "r")
         for field_name in self._handle["/field_types"]:
             current_field = self._handle["/field_types/%s" % field_name]
-            try:
+            if 'field_to_cgs' in current_field.attrs:
                 self.units[field_name] = current_field.attrs['field_to_cgs']
-            except:
+            else:
                 self.units[field_name] = 1.0
-            try:
-                current_fields_unit = current_field.attrs['field_units']
-            except:
+            if 'field_units' in current_field.attrs:
+                current_fields_unit = just_one(current_field.attrs['field_units'])
+            else:
                 current_fields_unit = ""
             self._fieldinfo_known.add_field(field_name, function=NullFunc, take_log=False,
                    units=current_fields_unit, projected_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