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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Apr 18 12:17:13 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/1ad99439ff94/
Changeset:   1ad99439ff94
Branch:      yt-3.0
User:        mzingale
Date:        2014-04-18 21:00:08
Summary:     we have the stub of parsing of species (nuclei) in the Maestro
front end, but of course, we sometimes need to be difficult
in Maestro and instead of doing species like "Ni56", we have something
generic like "ash".  This makes the frontend not crash when we
encounter those.  We should rework the species to read in the table
from the job_info to get the full information instead.
Affected #:  1 file

diff -r 4f3296e59a3259bb77bccea21fd718b88f5fef27 -r 1ad99439ff943b001990f5daf635557b834cc6dd yt/frontends/boxlib/fields.py
--- a/yt/frontends/boxlib/fields.py
+++ b/yt/frontends/boxlib/fields.py
@@ -243,12 +243,17 @@
                 self.add_field(name = ("gas", "%s_density" % nice_name),
                                function = func,
                                units = "g/cm**3")
-                # We know this will either have one letter, or two.
-                if field[3] in string.letters:
-                    element, weight = field[2:4], field[4:-1]
-                else:
-                    element, weight = field[2:3], field[3:-1]
-                weight = int(weight)
+                # Most of the time our species will be of the form
+                # element name + atomic weight (e.g. C12), but
+                # sometimes we make up descriptive names (e.g. ash)
+                if any(char.isdigit() for char in field):
+                    # We know this will either have one letter, or two.
+                    if field[3] in string.letters:
+                        element, weight = field[2:4], field[4:-1]
+                    else:
+                        element, weight = field[2:3], field[3:-1]
+                    weight = int(weight)
+
                 # Here we can, later, add number density.
             if field.startswith("omegadot("):
                 nice_name = field[9:-1]


https://bitbucket.org/yt_analysis/yt/commits/403fc41a9fb7/
Changeset:   403fc41a9fb7
Branch:      yt-3.0
User:        mzingale
Date:        2014-04-18 21:11:50
Summary:     merge
Affected #:  1 file

diff -r ceff32eb3b9ffea19fa635ae58e3b3fd1c01681e -r 403fc41a9fb7bec06f54c4ea27e2183eff048654 yt/frontends/boxlib/fields.py
--- a/yt/frontends/boxlib/fields.py
+++ b/yt/frontends/boxlib/fields.py
@@ -243,12 +243,17 @@
                 self.add_field(name = ("gas", "%s_density" % nice_name),
                                function = func,
                                units = "g/cm**3")
-                # We know this will either have one letter, or two.
-                if field[3] in string.letters:
-                    element, weight = field[2:4], field[4:-1]
-                else:
-                    element, weight = field[2:3], field[3:-1]
-                weight = int(weight)
+                # Most of the time our species will be of the form
+                # element name + atomic weight (e.g. C12), but
+                # sometimes we make up descriptive names (e.g. ash)
+                if any(char.isdigit() for char in field):
+                    # We know this will either have one letter, or two.
+                    if field[3] in string.letters:
+                        element, weight = field[2:4], field[4:-1]
+                    else:
+                        element, weight = field[2:3], field[3:-1]
+                    weight = int(weight)
+
                 # Here we can, later, add number density.
             if field.startswith("omegadot("):
                 nice_name = field[9:-1]

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