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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 10 08:43:17 PDT 2014


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/42ecd53d33d8/
Changeset:   42ecd53d33d8
Branch:      yt-3.0
User:        jzuhone
Date:        2014-07-10 16:30:36
Summary:     Fix for simulations that don't have this parameter
Affected #:  1 file

diff -r 0b17729b7b983c54a92d0441509f62cfe09b18df -r 42ecd53d33d89f440a301be1ffa70c0e160c9c66 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -209,15 +209,16 @@
         
     def _set_code_unit_attributes(self):
 
-        if self['unitsystem'].lower() == "cgs":
-             b_factor = 1.0
-        elif self['unitsystem'].lower() == "si":
-             b_factor = np.sqrt(4*np.pi/1e7)
-        elif self['unitsystem'].lower() == "none":
-             b_factor = np.sqrt(4*np.pi)
-        else:
-            raise RuntimeError("Runtime parameter unitsystem with "
-                               "value %s is unrecognized" % self['unitsystem'])
+        if 'unitsystem' in self.parameters:
+            if self['unitsystem'].lower() == "cgs":
+                b_factor = 1.0
+            elif self['unitsystem'].lower() == "si":
+                b_factor = np.sqrt(4*np.pi/1e7)
+            elif self['unitsystem'].lower() == "none":
+                b_factor = np.sqrt(4*np.pi)
+            else:
+                raise RuntimeError("Runtime parameter unitsystem with "
+                                   "value %s is unrecognized" % self['unitsystem'])
         if self.cosmological_simulation == 1:
             length_factor = 1.0 / (1.0 + self.current_redshift)
             temperature_factor = 1.0 / (1.0 + self.current_redshift)**2


https://bitbucket.org/yt_analysis/yt/commits/1657bc359ffc/
Changeset:   1657bc359ffc
Branch:      yt-3.0
User:        jzuhone
Date:        2014-07-10 16:33:10
Summary:     Need to set it to something otherwise
Affected #:  1 file

diff -r 42ecd53d33d89f440a301be1ffa70c0e160c9c66 -r 1657bc359ffcf8a2aebcdd40143449bfc89a6d15 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -219,6 +219,8 @@
             else:
                 raise RuntimeError("Runtime parameter unitsystem with "
                                    "value %s is unrecognized" % self['unitsystem'])
+        else:
+            b_factor = 1.
         if self.cosmological_simulation == 1:
             length_factor = 1.0 / (1.0 + self.current_redshift)
             temperature_factor = 1.0 / (1.0 + self.current_redshift)**2


https://bitbucket.org/yt_analysis/yt/commits/1b364c80fa28/
Changeset:   1b364c80fa28
Branch:      yt-3.0
User:        jzuhone
Date:        2014-07-10 17:43:08
Summary:     Merged in jzuhone/yt-3.x/yt-3.0 (pull request #1005)

Fix for FLASH simulations without 'unitsystem'
Affected #:  1 file

diff -r 8cf716a73ef2005294d1737d84d30486b239b2f2 -r 1b364c80fa285211a0ba828e88e683201c58440d yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -211,15 +211,18 @@
         
     def _set_code_unit_attributes(self):
 
-        if self['unitsystem'].lower() == "cgs":
-             b_factor = 1.0
-        elif self['unitsystem'].lower() == "si":
-             b_factor = np.sqrt(4*np.pi/1e7)
-        elif self['unitsystem'].lower() == "none":
-             b_factor = np.sqrt(4*np.pi)
+        if 'unitsystem' in self.parameters:
+            if self['unitsystem'].lower() == "cgs":
+                b_factor = 1.0
+            elif self['unitsystem'].lower() == "si":
+                b_factor = np.sqrt(4*np.pi/1e7)
+            elif self['unitsystem'].lower() == "none":
+                b_factor = np.sqrt(4*np.pi)
+            else:
+                raise RuntimeError("Runtime parameter unitsystem with "
+                                   "value %s is unrecognized" % self['unitsystem'])
         else:
-            raise RuntimeError("Runtime parameter unitsystem with "
-                               "value %s is unrecognized" % self['unitsystem'])
+            b_factor = 1.
         if self.cosmological_simulation == 1:
             length_factor = 1.0 / (1.0 + self.current_redshift)
             temperature_factor = 1.0 / (1.0 + self.current_redshift)**2

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