<html><body>
<p>2 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/23470f8a59c8/">https://bitbucket.org/yt_analysis/yt/commits/23470f8a59c8/</a> Changeset:   23470f8a59c8 Branch:      yt User:        ngoldbaum Date:        2016-05-02 20:21:04+00:00 Summary:     Document that physical constants can be imported from yt.units. Closes #1082.</p>
<p>This deprecates importing physical constants from yt.utilities.physical_constants in user scripts. The deprecation is only in terms of documentation, imports in existing scripts should still work for the forseeable future, we should just now emphasize the simpler yt.units import in documentation. Affected #:  6 files</p>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/analyzing/analysis_modules/photon_simulator.rst --- a/doc/source/analyzing/analysis_modules/photon_simulator.rst +++ b/doc/source/analyzing/analysis_modules/photon_simulator.rst @@ -478,7 +478,8 @@</p>
<pre>import yt
import numpy as np</pre>
<ul><li><p>from yt.utilities.physical_constants import cm_per_kpc, K_per_keV, mp</p></li></ul>
<p>+   from yt.utilities.physical_ratios import cm_per_kpc, K_per_keV +   from yt.units import mp</p>
<pre>from yt.utilities.cosmology import Cosmology
from yt.analysis_modules.photon_simulator.api import *
import aplpy</pre>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/analyzing/units/1)_Symbolic_Units.ipynb --- a/doc/source/analyzing/units/1)_Symbolic_Units.ipynb +++ b/doc/source/analyzing/units/1)_Symbolic_Units.ipynb @@ -155,7 +155,7 @@</p>
<pre>"outputs": [],
"source": [
 "from yt.units.yt_array import YTQuantity\n",</pre>
<ul><li><p>“from yt.utilities.physical_constants import kboltz\n”,</p></li></ul>
<p>+    “from yt.units import kboltz\n”,</p>
<pre>"from numpy.random import random\n",
"import numpy as np\n",
"\n",</pre>
<p>@@ -446,7 +446,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import G, kboltz\n”,</p></li></ul>
<p>+    “from yt.units import G, kboltz\n”,</p>
<pre>"\n",
"print (\"Newton's constant: \", G)\n",
"print (\"Newton's constant in MKS: \", G.in_mks(), \"\\n\")\n",</pre>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb --- a/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb +++ b/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb @@ -467,7 +467,7 @@</p>
<pre>"metadata": {},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import kboltz\n”,</p></li></ul>
<p>+    “from yt.units import kboltz\n”,</p>
<pre>  "kb = kboltz.to_astropy()"
 ]
},</pre>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb --- a/doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb +++ b/doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb @@ -41,7 +41,7 @@</p>
<pre>"print (dd[\"temperature\"].to_equivalent(\"eV\", \"thermal\"))\n",
"\n",
"# Rest energy of the proton\n",</pre>
<ul><li><p>“from yt.utilities.physical_constants import mp\n”,</p></li></ul>
<p>+    “from yt.units import mp\n”,</p>
<pre> "E_p = mp.to_equivalent(\"GeV\", \"mass_energy\")\n",
 "print (E_p)"
]</pre>
<p>@@ -61,7 +61,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import clight\n”,</p></li></ul>
<p>+    “from yt.units import clight\n”,</p>
<pre>"v = 0.1*clight\n",
"g = v.to_equivalent(\"dimensionless\", \"lorentz\")\n",
"print (g)\n",</pre>
<p>@@ -166,7 +166,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import qp # the elementary charge in esu\n”,</p></li></ul>
<p>+    “from yt.units import qp # the elementary charge in esu\n”,</p>
<pre>"qp_SI = qp.to_equivalent(\"C\",\"SI\") # convert to Coulombs\n",
"print (qp)\n",
"print (qp_SI)"</pre>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/analyzing/units/7)_Unit_Systems.ipynb --- a/doc/source/analyzing/units/7)_Unit_Systems.ipynb +++ b/doc/source/analyzing/units/7)_Unit_Systems.ipynb @@ -324,7 +324,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import G\n”,</p></li></ul>
<p>+    “from yt.units import G\n”,</p>
<pre>  "print (G.in_base(\"mks\"))"
 ]
},</pre>
<p>diff -r 2d7b93e59428f2dc6d4cde5030cacc4b113c6ea4 -r 23470f8a59c828a72eafbc585f0b3df44f536515 doc/source/developing/creating_derived_fields.rst --- a/doc/source/developing/creating_derived_fields.rst +++ b/doc/source/developing/creating_derived_fields.rst @@ -71,9 +71,9 @@</p>
<pre>a dimensionless float or array.

If your field definition includes physical constants rather than defining a</pre>
<p>-constant as a float, you can import it from ``yt.utilities.physical_constants`` +constant as a float, you can import it from ``yt.units``</p>
<pre>to get a predefined version of the constant with the correct units. If you know</pre>
<p>-the units your data is supposed to have ahead of time, you can import unit +the units your data is supposed to have ahead of time, you can also import unit</p>
<pre>symbols like ``g`` or ``cm`` from the ``yt.units`` namespace and multiply the
return value of your field function by the appropriate combination of unit
symbols for your field's units. You can also convert floats or NumPy arrays into</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/2f2c9e84c335/">https://bitbucket.org/yt_analysis/yt/commits/2f2c9e84c335/</a> Changeset:   2f2c9e84c335 Branch:      yt User:        atmyers Date:        2016-05-04 18:09:41+00:00 Summary:     Merged in ngoldbaum/yt (pull request #2155)</p>
<p>Document that physical constants can be imported from yt.units. Closes #1082. Affected #:  6 files</p>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/analyzing/analysis_modules/photon_simulator.rst --- a/doc/source/analyzing/analysis_modules/photon_simulator.rst +++ b/doc/source/analyzing/analysis_modules/photon_simulator.rst @@ -478,7 +478,8 @@</p>
<pre>import yt
import numpy as np</pre>
<ul><li><p>from yt.utilities.physical_constants import cm_per_kpc, K_per_keV, mp</p></li></ul>
<p>+   from yt.utilities.physical_ratios import cm_per_kpc, K_per_keV +   from yt.units import mp</p>
<pre>from yt.utilities.cosmology import Cosmology
from yt.analysis_modules.photon_simulator.api import *
import aplpy</pre>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/analyzing/units/1)_Symbolic_Units.ipynb --- a/doc/source/analyzing/units/1)_Symbolic_Units.ipynb +++ b/doc/source/analyzing/units/1)_Symbolic_Units.ipynb @@ -155,7 +155,7 @@</p>
<pre>"outputs": [],
"source": [
 "from yt.units.yt_array import YTQuantity\n",</pre>
<ul><li><p>“from yt.utilities.physical_constants import kboltz\n”,</p></li></ul>
<p>+    “from yt.units import kboltz\n”,</p>
<pre>"from numpy.random import random\n",
"import numpy as np\n",
"\n",</pre>
<p>@@ -446,7 +446,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import G, kboltz\n”,</p></li></ul>
<p>+    “from yt.units import G, kboltz\n”,</p>
<pre>"\n",
"print (\"Newton's constant: \", G)\n",
"print (\"Newton's constant in MKS: \", G.in_mks(), \"\\n\")\n",</pre>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb --- a/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb +++ b/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb @@ -467,7 +467,7 @@</p>
<pre>"metadata": {},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import kboltz\n”,</p></li></ul>
<p>+    “from yt.units import kboltz\n”,</p>
<pre>  "kb = kboltz.to_astropy()"
 ]
},</pre>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb --- a/doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb +++ b/doc/source/analyzing/units/6)_Unit_Equivalencies.ipynb @@ -41,7 +41,7 @@</p>
<pre>"print (dd[\"temperature\"].to_equivalent(\"eV\", \"thermal\"))\n",
"\n",
"# Rest energy of the proton\n",</pre>
<ul><li><p>“from yt.utilities.physical_constants import mp\n”,</p></li></ul>
<p>+    “from yt.units import mp\n”,</p>
<pre> "E_p = mp.to_equivalent(\"GeV\", \"mass_energy\")\n",
 "print (E_p)"
]</pre>
<p>@@ -61,7 +61,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import clight\n”,</p></li></ul>
<p>+    “from yt.units import clight\n”,</p>
<pre>"v = 0.1*clight\n",
"g = v.to_equivalent(\"dimensionless\", \"lorentz\")\n",
"print (g)\n",</pre>
<p>@@ -166,7 +166,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import qp # the elementary charge in esu\n”,</p></li></ul>
<p>+    “from yt.units import qp # the elementary charge in esu\n”,</p>
<pre>"qp_SI = qp.to_equivalent(\"C\",\"SI\") # convert to Coulombs\n",
"print (qp)\n",
"print (qp_SI)"</pre>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/analyzing/units/7)_Unit_Systems.ipynb --- a/doc/source/analyzing/units/7)_Unit_Systems.ipynb +++ b/doc/source/analyzing/units/7)_Unit_Systems.ipynb @@ -324,7 +324,7 @@</p>
<pre>},
"outputs": [],
"source": [</pre>
<ul><li><p>“from yt.utilities.physical_constants import G\n”,</p></li></ul>
<p>+    “from yt.units import G\n”,</p>
<pre>  "print (G.in_base(\"mks\"))"
 ]
},</pre>
<p>diff -r 02f769322a522e75ad581a23e907d4af0339a086 -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f doc/source/developing/creating_derived_fields.rst --- a/doc/source/developing/creating_derived_fields.rst +++ b/doc/source/developing/creating_derived_fields.rst @@ -71,9 +71,9 @@</p>
<pre>a dimensionless float or array.

If your field definition includes physical constants rather than defining a</pre>
<p>-constant as a float, you can import it from ``yt.utilities.physical_constants`` +constant as a float, you can import it from ``yt.units``</p>
<pre>to get a predefined version of the constant with the correct units. If you know</pre>
<p>-the units your data is supposed to have ahead of time, you can import unit +the units your data is supposed to have ahead of time, you can also import unit</p>
<pre>symbols like ``g`` or ``cm`` from the ``yt.units`` namespace and multiply the
return value of your field function by the appropriate combination of unit
symbols for your field's units. You can also convert floats or NumPy arrays into</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27DR-2F6jLkDveAtSj9Bl-2B00MdmLFbeYsHe1D2TA4Xr1sXRjwK-2FwCnCLIkMNFVayJjj9jWnfTMAV4pGJOKyKaWPJ0axXx5LGNyPjG4Bs9vmeAzaTLwhPTEj7Kn5rjNBd4LsYCLxbscA6QO8QKSyw8Y88ARQmzvrHyXCpa8XV87fu9xrpGnk-2FvQvICaAm2drGAwZkE-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>