<html><body>
<p>1 new commit in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/068a53069cdf/">https://bitbucket.org/yt_analysis/yt/commits/068a53069cdf/</a> Changeset: 068a53069cdf Branch: yt User: ngoldbaum Date: 2016-04-06 18:06:06+00:00 Summary: Merged in chummels/yt (pull request #2105)</p>
<p>Adding neutral species aliases as described in YTEP 0003 Affected #: 2 files</p>
<p>diff -r 179a73a7e7f479572d0b9039feee73f75360fd3d -r 068a53069cdff7da3ad9597a7bb868fcafabecb2 yt/fields/species_fields.py --- a/yt/fields/species_fields.py +++ b/yt/fields/species_fields.py @@ -114,6 +114,24 @@</p>
<pre> particle_type = particle_type,
units = unit_system["number_density"])
</pre>
<p>+def add_species_aliases(registry, ftype, alias_species, species): + """ + This takes a field registry, a fluid type, and two species names. + The first species name is one you wish to alias to an existing species + name. For instance you might alias all “H_p0” fields to “H_” fields + to indicate that “H_” fields are really just neutral hydrogen fields. + This function registers field aliases for the density, number_density, + mass, and fraction fields between the two species given in the arguments. + """ + registry.alias((ftype, “%s_density” % alias_species), + (ftype, “%s_density” % species)) + registry.alias((ftype, “%s_fraction” % alias_species), + (ftype, “%s_fraction” % species)) + registry.alias((ftype, “%s_number_density” % alias_species), + (ftype, “%s_number_density” % species)) + registry.alias((ftype, “%s_mass” % alias_species), + (ftype, “%s_mass” % species)) +</p>
<pre>def add_nuclei_density_fields(registry, ftype,
particle_type = False):
unit_system = registry.ds.unit_system</pre>
<p>@@ -181,4 +199,10 @@</p>
<pre># Skip it
continue
func(registry, ftype, species, particle_type)</pre>
<p>+ # Adds aliases for all neutral species from their raw “MM_” + # species to “MM_p0_” species to be explicit. + # See YTEP-0003 for more details. + if (ChemicalFormula(species).charge == 0): + alias_species = “%s_p0” % species.split('_')[0] + add_species_aliases(registry, “gas”, alias_species, species)</p>
<pre>add_nuclei_density_fields(registry, ftype, particle_type=particle_type)</pre>
<p>diff -r 179a73a7e7f479572d0b9039feee73f75360fd3d -r 068a53069cdff7da3ad9597a7bb868fcafabecb2 yt/utilities/chemical_formulas.py --- a/yt/utilities/chemical_formulas.py +++ b/yt/utilities/chemical_formulas.py @@ -29,6 +29,9 @@</p>
<pre> charge = -int(ionization[1:])
else:
raise NotImplementedError</pre>
<p>+ elif self.formula_string.startswith('El'): + molecule = self.formula_string + charge = -1</p>
<pre> else:
molecule = self.formula_string
charge = 0</pre>
<p>Repository URL: <a href="https://bitbucket.org/yt_analysis/yt/">https://bitbucket.org/yt_analysis/yt/</a></p>
<p>—</p>
<p>This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.</p>
<img src="http://link.bitbucket.org/wf/open?upn=ll4ctv0L-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27B7So1O6qguFyM8PA2zAKduwsL-2FVfhe0laQzmlr6xAX6XbJYey13AekBHPLI0-2BQH-2Bj93sqbfA7b2lglBkNpAAVqZPL1FttcGqYJ10IfSr09pZ8AAOV-2FzP3jsED0k4S9cWxwdakhnXQR4ICvrIM4byGsvoh5gNrnKMS13WCdvp-2F0XYHmGKKUPpIsGcQClY9rp1M-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>