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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 10 00:08:22 PDT 2014


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/75d5ec718de6/
Changeset:   75d5ec718de6
Branch:      yt-3.0
User:        jzuhone
Date:        2014-07-10 02:05:43
Summary:     pc_unitsbase and unitsystem are entirely separate--this was causing FLASH bugs
Affected #:  1 file

diff -r bf3a99952c4ebd06f1ed085a840779f9beb5ad11 -r 75d5ec718de691dded827059f236340097f04046 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -208,9 +208,8 @@
         self.parameters["Time"] = 1. # default unit is 1...
         
     def _set_code_unit_attributes(self):
-        if "cgs" in (self.parameters.get('pc_unitsbase', "").lower(),
-                     self.parameters.get('unitsystem', "").lower()):
-             b_factor = 1
+        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":
@@ -245,9 +244,9 @@
         for tpname, pval in zip(self._handle[nn][:,'name'],
                                 self._handle[nn][:,'value']):
             if tpname.strip() == pname:
-                if ptype == "string" :
+                if ptype == "string":
                     return pval.strip()
-                else :
+                else:
                     return pval
         raise KeyError(pname)
 


https://bitbucket.org/yt_analysis/yt/commits/0b17729b7b98/
Changeset:   0b17729b7b98
Branch:      yt-3.0
User:        jzuhone
Date:        2014-07-10 02:26:16
Summary:     This needed to be set too
Affected #:  1 file

diff -r 75d5ec718de691dded827059f236340097f04046 -r 0b17729b7b983c54a92d0441509f62cfe09b18df yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -208,6 +208,7 @@
         self.parameters["Time"] = 1. # default unit is 1...
         
     def _set_code_unit_attributes(self):
+
         if self['unitsystem'].lower() == "cgs":
              b_factor = 1.0
         elif self['unitsystem'].lower() == "si":
@@ -224,6 +225,7 @@
             length_factor = 1.0
             temperature_factor = 1.0
         self.magnetic_unit = self.quan(b_factor, "gauss")
+
         self.length_unit = self.quan(length_factor, "cm")
         self.mass_unit = self.quan(1.0, "g")
         self.time_unit = self.quan(1.0, "s")
@@ -231,7 +233,8 @@
         self.temperature_unit = self.quan(temperature_factor, "K")
         # Still need to deal with:
         #self.conversion_factors['temp'] = (1.0 + self.current_redshift)**-2.0
-
+        self.unit_registry.modify("code_magnetic", self.magnetic_unit)
+        
     def set_code_units(self):
         super(FLASHDataset, self).set_code_units()
         self.unit_registry.modify("code_temperature",


https://bitbucket.org/yt_analysis/yt/commits/cbc8aad03100/
Changeset:   cbc8aad03100
Branch:      yt-3.0
User:        xarthisius
Date:        2014-07-10 09:08:15
Summary:     Merged in jzuhone/yt-3.x/yt-3.0 (pull request #1003)

FLASH magnetic field units are incorrect
Affected #:  1 file

diff -r c6b09204f3e728a7d3611ffc16a962ad037ddbee -r cbc8aad0310012de974ce8f194f18b48cd82073a yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -210,9 +210,9 @@
         self.parameters["Time"] = 1. # default unit is 1...
         
     def _set_code_unit_attributes(self):
-        if "cgs" in (self.parameters.get('pc_unitsbase', "").lower(),
-                     self.parameters.get('unitsystem', "").lower()):
-             b_factor = 1
+
+        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":
@@ -227,6 +227,7 @@
             length_factor = 1.0
             temperature_factor = 1.0
         self.magnetic_unit = self.quan(b_factor, "gauss")
+
         self.length_unit = self.quan(length_factor, "cm")
         self.mass_unit = self.quan(1.0, "g")
         self.time_unit = self.quan(1.0, "s")
@@ -234,7 +235,8 @@
         self.temperature_unit = self.quan(temperature_factor, "K")
         # Still need to deal with:
         #self.conversion_factors['temp'] = (1.0 + self.current_redshift)**-2.0
-
+        self.unit_registry.modify("code_magnetic", self.magnetic_unit)
+        
     def set_code_units(self):
         super(FLASHDataset, self).set_code_units()
         self.unit_registry.modify("code_temperature",
@@ -247,9 +249,9 @@
         for tpname, pval in zip(self._handle[nn][:,'name'],
                                 self._handle[nn][:,'value']):
             if tpname.strip() == pname:
-                if ptype == "string" :
+                if ptype == "string":
                     return pval.strip()
-                else :
+                else:
                     return pval
         raise KeyError(pname)

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