[yt-svn] commit/yt: jzuhone: Merged in jzuhone/yt-3.x/yt-3.0 (pull request #1005)

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


1 new commit in yt:

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