From 6af63602779f58accbea1ea5b6178a746963371e Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Sun, 28 Jul 2024 16:59:25 -0400 Subject: [PATCH] Stop using backticks in Markdown cells of rendered docs Having [`astropy.units`](...) works fine in normal Markdown and on Google Colab, but the formatting gets messy when rendered by nbsphinx. --- .../notebooks/astropy-units-completed.ipynb | 675 ++++-------------- 1 file changed, 128 insertions(+), 547 deletions(-) diff --git a/docs/source/notebooks/astropy-units-completed.ipynb b/docs/source/notebooks/astropy-units-completed.ipynb index 9816da8..164a31f 100644 --- a/docs/source/notebooks/astropy-units-completed.ipynb +++ b/docs/source/notebooks/astropy-units-completed.ipynb @@ -15,9 +15,9 @@ "nbsphinx": "hidden" }, "source": [ - "[`astropy.units`]: https://docs.astropy.org/en/stable/units/index.html\n", + "[astropy.units]: https://docs.astropy.org/en/stable/units/index.html\n", "\n", - "This tutorial introduces us to [`astropy.units`], which is heavily used in PlasmaPy." + "This tutorial introduces us to [astropy.units], which is heavily used in PlasmaPy." ] }, { @@ -32,7 +32,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "33fe81d8-c1e6-4fe2-97a4-d62ce59b94b3", "metadata": {}, "outputs": [], @@ -70,18 +70,10 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "ee456b33", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "25.0\n" - ] - } - ], + "outputs": [], "source": [ "distance_in_miles = 50\n", "time_in_hours = 2\n", @@ -94,13 +86,13 @@ "id": "93658d4f", "metadata": {}, "source": [ - "[`astropy.units`]: https://docs.astropy.org/en/stable/units/index.html\n", - "[`plasmapy.particles`]: ../../particles/index.rst\n", - "[`plasmapy.formulary`]: ../../formulary/index.rst\n", + "[astropy.units]: https://docs.astropy.org/en/stable/units/index.html\n", + "[plasmapy.particles]: https://docs.plasmapy.org/en/latest/particles/index.html\n", + "[plasmapy.formulary]: https://docs.plasmapy.org/en/latest/formulary/index.html\n", "\n", "Representing a physical quantity as a number has risks. We might unknowingly perform operations with different units, like `time_in_seconds + time_in_hours`. We might even accidentally perform operations with physically incompatible units, like `length + time`, without catching our mistake. Unit conversion errors can be costly mistakes, such as the loss of spacecraft like the [Mars Climate Orbiter](https://science.nasa.gov/mission/mars-climate-orbiter).\n", "\n", - "We can avoid these problems by using a units package. This notebook introduces [`astropy.units`] with an emphasis on the functionality needed to work with [`plasmapy.particles`] and [`plasmapy.formulary`]. We typically import [`astropy.units`] subpackage as `u`." + "We can avoid these problems by using a units package. This notebook introduces [astropy.units] with an emphasis on the functionality needed to work with [plasmapy.particles] and [plasmapy.formulary]. We typically import [astropy.units] subpackage as `u`." ] }, { @@ -121,18 +113,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "8437650a", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "60.0 km\n" - ] - } - ], + "outputs": [], "source": [ "distance = 60 * u.km\n", "print(distance)" @@ -143,28 +127,17 @@ "id": "ccc6659f", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "This operation creates a [`Quantity`] object: a number, sequence, or array that has been assigned a physical unit." + "This operation creates a [Quantity] object: a number, sequence, or array that has been assigned a physical unit." ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "a6354b93", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "astropy.units.quantity.Quantity" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "type(distance)" ] @@ -174,14 +147,14 @@ "id": "744a9b01", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "We can create an object by using the [`Quantity`] class itself." + "We can create an object by using the [Quantity] class itself." ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "8d2bb681", "metadata": {}, "outputs": [], @@ -194,31 +167,17 @@ "id": "1bb28951", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "We can create [`Quantity`] objects with compound units." + "We can create [Quantity] objects with compound units." ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "4932159b", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$88 \\; \\mathrm{\\frac{mi}{h}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "88 * u.imperial.mile / u.hour" ] @@ -228,31 +187,17 @@ "id": "9cc9adba", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "We can even create [`Quantity`] objects that are explicitly dimensionless. " + "We can even create [Quantity] objects that are explicitly dimensionless. " ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "09e9752c", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$3 \\; \\mathrm{}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "3 * u.dimensionless_unscaled" ] @@ -262,55 +207,27 @@ "id": "4cffc8a0", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "We can also create a [`Quantity`] based off of a NumPy array or a list." + "We can also create a [Quantity] based off of a NumPy array or a list." ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "e3235d80", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$[2.5,~3.2,~1.1] \\; \\mathrm{kg}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.array([2.5, 3.2, 1.1]) * u.kg" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "a686fd93", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$[2,~3,~4] \\; \\mathrm{\\frac{m}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "[2, 3, 4] * u.m / u.s" ] @@ -322,31 +239,17 @@ "source": [ "## Unit operations\n", "\n", - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "Operations between [`Quantity`] objects handle unit conversions automatically. We can add [`Quantity`] objects together as long as their units have the same physical type." + "Operations between [Quantity] objects handle unit conversions automatically. We can add [Quantity] objects together as long as their units have the same physical type." ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "65e08284", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$1.25 \\; \\mathrm{m}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "1 * u.m + 25 * u.cm" ] @@ -361,18 +264,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "c36788db", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.5 km / min\n" - ] - } - ], + "outputs": [], "source": [ "velocity = distance / time\n", "print(velocity)" @@ -380,18 +275,10 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "04b48a57", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "3600.0 km2\n" - ] - } - ], + "outputs": [], "source": [ "area = distance**2\n", "print(area)" @@ -407,38 +294,14 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "0877feb6", "metadata": { "tags": [ "raises-exception" ] }, - "outputs": [ - { - "ename": "UnitConversionError", - "evalue": "Can only apply 'add' function to quantities with compatible dimensions", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mUnitConversionError\u001b[0m Traceback (most recent call last)", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity_helper/helpers.py:77\u001b[0m, in \u001b[0;36mget_converters_and_unit\u001b[0;34m(f, unit1, unit2)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 77\u001b[0m converters[changeable] \u001b[38;5;241m=\u001b[39m \u001b[43mget_converter\u001b[49m\u001b[43m(\u001b[49m\u001b[43munit2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43munit1\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 78\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m UnitsError:\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity_helper/helpers.py:42\u001b[0m, in \u001b[0;36mget_converter\u001b[0;34m(from_unit, to_unit)\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Like Unit._get_converter, except returns None if no scaling is needed,\u001b[39;00m\n\u001b[1;32m 40\u001b[0m \u001b[38;5;124;03mi.e., if the inferred scale is unity.\u001b[39;00m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m---> 42\u001b[0m converter \u001b[38;5;241m=\u001b[39m \u001b[43mfrom_unit\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_converter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mto_unit\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01mif\u001b[39;00m converter \u001b[38;5;129;01mis\u001b[39;00m unit_scale_converter \u001b[38;5;28;01melse\u001b[39;00m converter\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1125\u001b[0m, in \u001b[0;36mUnitBase._get_converter\u001b[0;34m(self, other, equivalencies)\u001b[0m\n\u001b[1;32m 1123\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m v: b(converter(v))\n\u001b[0;32m-> 1125\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1108\u001b[0m, in \u001b[0;36mUnitBase._get_converter\u001b[0;34m(self, other, equivalencies)\u001b[0m\n\u001b[1;32m 1107\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1108\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_apply_equivalencies\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1109\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mother\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_normalize_equivalencies\u001b[49m\u001b[43m(\u001b[49m\u001b[43mequivalencies\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1110\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m UnitsError \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 1112\u001b[0m \u001b[38;5;66;03m# Last hope: maybe other knows how to do it?\u001b[39;00m\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;66;03m# We assume the equivalencies have the unit itself as first item.\u001b[39;00m\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;66;03m# TODO: maybe better for other to have a `_back_converter` method?\u001b[39;00m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1086\u001b[0m, in \u001b[0;36mUnitBase._apply_equivalencies\u001b[0;34m(self, unit, other, equivalencies)\u001b[0m\n\u001b[1;32m 1084\u001b[0m other_str \u001b[38;5;241m=\u001b[39m get_err_str(other)\n\u001b[0;32m-> 1086\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m UnitConversionError(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00munit_str\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m and \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mother_str\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m are not convertible\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[0;31mUnitConversionError\u001b[0m: 's' (time) and 'm' (length) are not convertible", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[0;31mUnitConversionError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[13], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;241;43m3\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mu\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mm\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mu\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43ms\u001b[49m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity.py:696\u001b[0m, in \u001b[0;36mQuantity.__array_ufunc__\u001b[0;34m(self, function, method, *inputs, **kwargs)\u001b[0m\n\u001b[1;32m 694\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mNotImplemented\u001b[39m\n\u001b[1;32m 695\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 696\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity.py:641\u001b[0m, in \u001b[0;36mQuantity.__array_ufunc__\u001b[0;34m(self, function, method, *inputs, **kwargs)\u001b[0m\n\u001b[1;32m 636\u001b[0m \u001b[38;5;66;03m# Determine required conversion functions -- to bring the unit of the\u001b[39;00m\n\u001b[1;32m 637\u001b[0m \u001b[38;5;66;03m# input to that expected (e.g., radian for np.sin), or to get\u001b[39;00m\n\u001b[1;32m 638\u001b[0m \u001b[38;5;66;03m# consistent units between two inputs (e.g., in np.add) --\u001b[39;00m\n\u001b[1;32m 639\u001b[0m \u001b[38;5;66;03m# and the unit of the result (or tuple of units for nout > 1).\u001b[39;00m\n\u001b[1;32m 640\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 641\u001b[0m converters, unit \u001b[38;5;241m=\u001b[39m \u001b[43mconverters_and_unit\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfunction\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43minputs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 643\u001b[0m out \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mout\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m 644\u001b[0m \u001b[38;5;66;03m# Avoid loop back by turning any Quantity output into array views.\u001b[39;00m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity_helper/converters.py:181\u001b[0m, in \u001b[0;36mconverters_and_unit\u001b[0;34m(function, method, *args)\u001b[0m\n\u001b[1;32m 178\u001b[0m units \u001b[38;5;241m=\u001b[39m [\u001b[38;5;28mgetattr\u001b[39m(arg, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munit\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;28;01mfor\u001b[39;00m arg \u001b[38;5;129;01min\u001b[39;00m args]\n\u001b[1;32m 180\u001b[0m \u001b[38;5;66;03m# Determine possible conversion functions, and the result unit.\u001b[39;00m\n\u001b[0;32m--> 181\u001b[0m converters, result_unit \u001b[38;5;241m=\u001b[39m \u001b[43mufunc_helper\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfunction\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43munits\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28many\u001b[39m(converter \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m converter \u001b[38;5;129;01min\u001b[39;00m converters):\n\u001b[1;32m 184\u001b[0m \u001b[38;5;66;03m# for multi-argument ufuncs with a quantity and a non-quantity,\u001b[39;00m\n\u001b[1;32m 185\u001b[0m \u001b[38;5;66;03m# the quantity normally needs to be dimensionless, *except*\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 188\u001b[0m \u001b[38;5;66;03m# can just have the unit of the quantity\u001b[39;00m\n\u001b[1;32m 189\u001b[0m \u001b[38;5;66;03m# (this allows, e.g., `q > 0.` independent of unit)\u001b[39;00m\n\u001b[1;32m 190\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 191\u001b[0m \u001b[38;5;66;03m# Don't fold this loop in the test above: this rare case\u001b[39;00m\n\u001b[1;32m 192\u001b[0m \u001b[38;5;66;03m# should not make the common case slower.\u001b[39;00m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/quantity_helper/helpers.py:79\u001b[0m, in \u001b[0;36mget_converters_and_unit\u001b[0;34m(f, unit1, unit2)\u001b[0m\n\u001b[1;32m 77\u001b[0m converters[changeable] \u001b[38;5;241m=\u001b[39m get_converter(unit2, unit1)\n\u001b[1;32m 78\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m UnitsError:\n\u001b[0;32m---> 79\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m UnitConversionError(\n\u001b[1;32m 80\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCan only apply \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mf\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m function to quantities \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 81\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwith compatible dimensions\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 82\u001b[0m )\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m converters, unit1\n", - "\u001b[0;31mUnitConversionError\u001b[0m: Can only apply 'add' function to quantities with compatible dimensions" - ] - } - ], + "outputs": [], "source": [ "3 * u.m + 3 * u.s" ] @@ -448,26 +311,18 @@ "id": "4f0c461e", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", - "[`numpy.ndarray`]: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[numpy.ndarray]: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html\n", "\n", - "[`Quantity`] arrays behave very similarly to NumPy arrays. In fact, [`Quantity`] is a subclass of [`numpy.ndarray`]." + "[Quantity] arrays behave very similarly to NumPy arrays. In fact, [Quantity] is a subclass of [numpy.ndarray]." ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "59389429", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "656.0 nm\n" - ] - } - ], + "outputs": [], "source": [ "balmer_series = [656, 486, 434, 410] * u.nm\n", "Hα = balmer_series[0]\n", @@ -476,24 +331,10 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "a6545132", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$656 \\; \\mathrm{nm}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.max(balmer_series)" ] @@ -506,10 +347,10 @@ "[NumPy]: https://numpy.org/\n", "[SciPy]: https://scipy.org/\n", "\n", - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "[lose their units]: https://docs.astropy.org/en/stable/known_issues.html#quantities-lose-their-units-with-some-operations\n", "\n", - "⚠️ Most frequently encountered [NumPy] and [SciPy] functions can be used with [`Quantity`] objects. However, there are some functions that cause [`Quantity`] objects to [lose their units]!" + "⚠️ Most frequently encountered [NumPy] and [SciPy] functions can be used with [Quantity] objects. However, there are some functions that cause [Quantity] objects to [lose their units]!" ] }, { @@ -519,56 +360,28 @@ "source": [ "## Unit conversions\n", "\n", - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", - "[`to`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.to\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[.to]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.to\n", "\n", - "The [`to`] method allows us to convert a [`Quantity`] to different units of the same physical type. This method accepts strings that represent a unit (including compound units) or a unit object." + "The [.to] method allows us to convert a [Quantity] to different units of the same physical type. This method accepts strings that represent a unit (including compound units) or a unit object." ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "80f4f133", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$8.3333333 \\; \\mathrm{\\frac{m}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "velocity.to(\"m/s\")" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "21c46ef1", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$8.3333333 \\; \\mathrm{\\frac{m}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "velocity.to(u.m / u.s)" ] @@ -578,57 +391,29 @@ "id": "c1e742ca", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", - "[`si`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.si\n", - "[`cgs`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.cgs\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[si]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.si\n", + "[cgs]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.cgs\n", "\n", - "The [`si`] and [`cgs`] attributes convert the [`Quantity`] to SI or CGS units, respectively. " + "The [si] and [cgs] attributes convert the [Quantity] to SI or CGS units, respectively. " ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "02bda4d2", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$8.3333333 \\; \\mathrm{\\frac{m}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "velocity.si" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "560a0cfe", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$833.33333 \\; \\mathrm{\\frac{cm}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "velocity.cgs" ] @@ -648,21 +433,10 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "24e8403c", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "120.0" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "time.value" ] @@ -672,32 +446,18 @@ "id": "4c6c027b", "metadata": {}, "source": [ - "[`unit`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.unit\n", - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[unit]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity.unit\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "The [`unit`] attribute of a [`Quantity`] provides the unit without the value." + "The [unit] attribute of a [Quantity] provides the unit without the value." ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "2c41a2fa", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$\\mathrm{min}$" - ], - "text/plain": [ - "Unit(\"min\")" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "time.unit" ] @@ -723,30 +483,14 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "6b6fafd6", "metadata": { "tags": [ "raises-exception" ] }, - "outputs": [ - { - "ename": "UnitConversionError", - "evalue": "'eV' (energy/torque/work) and 'K' (temperature) are not convertible", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mUnitConversionError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[22], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mu\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43meV\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mK\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1196\u001b[0m, in \u001b[0;36mUnitBase.to\u001b[0;34m(self, other, value, equivalencies)\u001b[0m\n\u001b[1;32m 1194\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m UNITY\n\u001b[1;32m 1195\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1196\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_converter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mUnit\u001b[49m\u001b[43m(\u001b[49m\u001b[43mother\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mequivalencies\u001b[49m\u001b[43m)\u001b[49m(value)\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1125\u001b[0m, in \u001b[0;36mUnitBase._get_converter\u001b[0;34m(self, other, equivalencies)\u001b[0m\n\u001b[1;32m 1122\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1123\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m v: b(converter(v))\n\u001b[0;32m-> 1125\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1108\u001b[0m, in \u001b[0;36mUnitBase._get_converter\u001b[0;34m(self, other, equivalencies)\u001b[0m\n\u001b[1;32m 1106\u001b[0m \u001b[38;5;66;03m# if that doesn't work, maybe we can do it with equivalencies?\u001b[39;00m\n\u001b[1;32m 1107\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1108\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_apply_equivalencies\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1109\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mother\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_normalize_equivalencies\u001b[49m\u001b[43m(\u001b[49m\u001b[43mequivalencies\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1110\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m UnitsError \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 1112\u001b[0m \u001b[38;5;66;03m# Last hope: maybe other knows how to do it?\u001b[39;00m\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;66;03m# We assume the equivalencies have the unit itself as first item.\u001b[39;00m\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;66;03m# TODO: maybe better for other to have a `_back_converter` method?\u001b[39;00m\n\u001b[1;32m 1115\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(other, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mequivalencies\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/units/core.py:1086\u001b[0m, in \u001b[0;36mUnitBase._apply_equivalencies\u001b[0;34m(self, unit, other, equivalencies)\u001b[0m\n\u001b[1;32m 1083\u001b[0m unit_str \u001b[38;5;241m=\u001b[39m get_err_str(unit)\n\u001b[1;32m 1084\u001b[0m other_str \u001b[38;5;241m=\u001b[39m get_err_str(other)\n\u001b[0;32m-> 1086\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m UnitConversionError(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00munit_str\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m and \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mother_str\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m are not convertible\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[0;31mUnitConversionError\u001b[0m: 'eV' (energy/torque/work) and 'K' (temperature) are not convertible" - ] - } - ], + "outputs": [], "source": [ "u.eV.to(\"K\")" ] @@ -756,33 +500,19 @@ "id": "9299c8a1", "metadata": {}, "source": [ - "[`astropy.units`]: https://docs.astropy.org/en/stable/units/index.html\n", + "[astropy.units]: https://docs.astropy.org/en/stable/units/index.html\n", "[equivalencies]: https://docs.astropy.org/en/stable/units/equivalencies.html\n", - "[`temperature_energy()`]: https://docs.astropy.org/en/stable/units/equivalencies.html#temperature-energy-equivalency\n", + "[temperature_energy()]: https://docs.astropy.org/en/stable/units/equivalencies.html#temperature-energy-equivalency\n", "\n", - "To handle non-standard unit conversions, [`astropy.units`] allows the use of [equivalencies]. The conversion from eV to K can be done by using the [`temperature_energy()`] equivalency." + "To handle non-standard unit conversions, [astropy.units] allows the use of [equivalencies]. The conversion from eV to K can be done by using the [temperature_energy()] equivalency." ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "afac5b4a", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$11604.518 \\; \\mathrm{K}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "(1 * u.eV).to(\"K\", equivalencies=u.temperature_energy())" ] @@ -792,34 +522,19 @@ "id": "b4c492cc", "metadata": {}, "source": [ - "[`dimensionless_angles()`]: https://docs.astropy.org/en/stable/api/astropy.units.equivalencies.dimensionless_angles.html#dimensionless-angles\n", - "\n", + "[dimensionless_angles()]: https://docs.astropy.org/en/stable/api/astropy.units.equivalencies.dimensionless_angles.html#dimensionless-angles\n", "[frequency]: https://en.wikipedia.org/wiki/Frequency\n", "[angular frequency]: https://en.wikipedia.org/wiki/Angular_frequency\n", "\n", - "Radians are treated dimensionlessly when the [`dimensionless_angles()`] equivalency is in effect. Note that this equivalency does not account for the multiplicative factor of $2π$ that is used when converting between [frequency] and [angular frequency]." + "Radians are treated dimensionlessly when the [dimensionless_angles()] equivalency is in effect. Note that this equivalency does not account for the multiplicative factor of $2π$ that is used when converting between [frequency] and [angular frequency]." ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "9735710b", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$3.2 \\; \\mathrm{\\frac{1}{s}}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "(3.2 * u.rad / u.s).to(\"1 / s\", equivalencies=u.dimensionless_angles())" ] @@ -837,29 +552,17 @@ "id": "b714de6a", "metadata": {}, "source": [ - "[`astropy.constants`]: https://docs.astropy.org/en/stable/constants/index.html\n", + "[astropy.constants]: https://docs.astropy.org/en/stable/constants/index.html\n", "\n", - "few can use [`astropy.constants`] to access the most commonly needed physical constants." + "few can use [astropy.constants] to access the most commonly needed physical constants." ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "746a79a7", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " Name = Speed of light in vacuum\n", - " Value = 299792458.0\n", - " Uncertainty = 0.0\n", - " Unit = m / s\n", - " Reference = CODATA 2018\n" - ] - } - ], + "outputs": [], "source": [ "print(constants.c)" ] @@ -869,27 +572,19 @@ "id": "c3ee9feb", "metadata": {}, "source": [ - "[`Constant`]: https://docs.astropy.org/en/stable/api/astropy.constants.Constant.html#astropy.constants.Constant\n", - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", - "[`u.temperature_energy()`]: https://docs.astropy.org/en/stable/units/equivalencies.html#temperature-energy-equivalency\n", + "[Constant]: https://docs.astropy.org/en/stable/api/astropy.constants.Constant.html#astropy.constants.Constant\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[u.temperature_energy()]: https://docs.astropy.org/en/stable/units/equivalencies.html#temperature-energy-equivalency\n", "\n", - "A [`Constant`] behaves very similarly to a [`Quantity`]. For example, we can use the Boltzmann constant to mimic the behavior of [`u.temperature_energy()`]." + "A [Constant] behaves very similarly to a [Quantity]. For example, we can use the Boltzmann constant to mimic the behavior of [u.temperature_energy()]." ] }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "d2d59d08", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "6.962710872930049 MK\n" - ] - } - ], + "outputs": [], "source": [ "thermal_energy_per_particle = 0.6 * u.keV\n", "temperature = thermal_energy_per_particle / constants.k_B\n", @@ -906,51 +601,24 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "015de7fc", "metadata": { "tags": [ "raises-exception" ] }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "Constant 'e' does not have physically compatible units across all systems of units and cannot be combined with other values without specifying a system (eg. e.emu)", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[27], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;241;43m2\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mconstants\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43me\u001b[49m\n", - "File \u001b[0;32m/run/media/namurphy/d423d80e-c227-4a33-b50f-545b44160ce3/namurphy/Applications/miniconda3/envs/pldev/lib/python3.12/site-packages/astropy/constants/constant.py:49\u001b[0m, in \u001b[0;36mConstantMeta.__new__..wrap..wrapper\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msystem \u001b[38;5;129;01mand\u001b[39;00m name_lower \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_has_incompatible_units:\n\u001b[1;32m 48\u001b[0m systems \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(x \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m instances \u001b[38;5;28;01mif\u001b[39;00m x)\n\u001b[0;32m---> 49\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(\n\u001b[1;32m 50\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConstant \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mabbrev\u001b[38;5;132;01m!r}\u001b[39;00m\u001b[38;5;124m does not have physically compatible \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 51\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munits across all systems of units and cannot be \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 52\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcombined with other values without specifying a \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 53\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msystem (eg. \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mabbrev\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;132;01m{\u001b[39;00msystems[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 54\u001b[0m )\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m meth(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", - "\u001b[0;31mTypeError\u001b[0m: Constant 'e' does not have physically compatible units across all systems of units and cannot be combined with other values without specifying a system (eg. e.emu)" - ] - } - ], + "outputs": [], "source": [ "2 * constants.e" ] }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "1a90c979", "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$3.2043533 \\times 10^{-19} \\; \\mathrm{C}$" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "2 * constants.e.si" ] @@ -977,14 +645,14 @@ "id": "90ced3d3-aa0d-47b7-b526-359e466e5cb5", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "Astropy has built-in support for plotting [`Quantity`] objects. Let's plot the number density of electrons in the solar wind using an empirical formula given by [Kruparova et al. (2023)](https://iopscience.iop.org/article/10.3847/1538-4357/acf572), which has a range of validity from 13 to 50 solar radii." + "Astropy has built-in support for plotting [Quantity] objects. Let's plot the number density of electrons in the solar wind using an empirical formula given by [Kruparova et al. (2023)](https://iopscience.iop.org/article/10.3847/1538-4357/acf572), which has a range of validity from 13 to 50 solar radii." ] }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "2fce5587-16cf-40ea-baa5-dbd9023281c3", "metadata": {}, "outputs": [], @@ -1004,7 +672,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "id": "7a734940-a970-4991-9ada-f0844ae80567", "metadata": {}, "outputs": [], @@ -1012,41 +680,20 @@ "n_e = 343_466 * u.cm**-3 * (radii / constants.R_sun) ** -1.87" ] }, - { - "cell_type": "markdown", - "id": "1ed451a9-909f-40ae-bec7-c67d8767545c", - "metadata": {}, - "source": [ - "We can use the [`astropy.visualization.quantity_support`] to help with plotting `Quantity` objects against each other.\n", - "\n", - "Let's do some imports." - ] - }, { "cell_type": "markdown", "id": "07547260-da42-40b7-98de-693b60dbb788", "metadata": {}, "source": [ - "Will make use make use of [`astropy.visualization.quantity_support`](https://docs.astropy.org/en/stable/api/astropy.visualization.quantity_support.html). This is a [_context manager_](https://realpython.com/python-with-statement/), which means that we use the `with` statement." + "Will make use make use of [astropy.visualization.quantity_support](https://docs.astropy.org/en/stable/api/astropy.visualization.quantity_support.html). This is a [_context manager_](https://realpython.com/python-with-statement/), which means that we use the `with` statement." ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "id": "a4563556-64d3-4b7e-80f6-7df22ccf4488", "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkkAAAGyCAYAAADwPVBzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAABGmUlEQVR4nO3deXxU1f3/8fdkm6yTELJDCAn7riyFqKAIBRQXFK18tYJV8SsFW9RaqvXn0n790tpqXapYaxVbd/sVW3HByKoQFpEIBIgsgQDJJJCQmezb3N8fIVMiYQkJcyeT1/PxuA+SuSeTz/E+cN7cc+45FsMwDAEAAKAZP7MLAAAA8EaEJAAAgBYQkgAAAFpASAIAAGgBIQkAAKAFhCQAAIAWEJIAAABaEGB2AR2Vy+VSfn6+IiIiZLFYzC4HAACcBcMwVFZWpqSkJPn5nf5eESHpHOXn5ys5OdnsMgAAwDk4ePCgunfvfto2hKRzFBERIanxP7LNZjO5GgAAcDacTqeSk5Pdn+OnQ0g6R01DbDabjZAEAEAHczZTZZi4DQAA0AJCEgAAQAsISQAAAC0gJAEAALSAkAQAANACQhIAAEALCEkAAAAtICQBAAC0gJAEAADQAkISAABACwhJAAAALSAkAQAAtICQ5KUMwzC7BAAAOjVCkpf5R+Z+Xf7UKr26dr/ZpQAA0KkRkrxMZW2D9h2pUObeYrNLAQCgUyMkeZkxaV0lSRtzi9XgYsgNAACzEJK8zKAkmyKsAXJW12tngdPscgAA6LQISV4mwN9Po1KjJUnr9zHkBgCAWQhJXmhMGiEJAACzEZK8UHpajCRpQ24J85IAADAJIckLDTw+L6msul478p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yZTz/9VFdddZXy8/MVHx8vSXrppZe0YMECHTlyREFBQVqwYIE+/vhjbd++3f1zM2bMUGlpqT777LOzqs3pdCoyMlIOh0M2m61tHT1Hc97YrE+32/XzCX107w/7mlIDAAAdSWs+v73qTtL3ORyNd0iio6Obvf7mm28qJiZGgwcP1oMPPqjKykr3uczMTA0ZMsQdkCRp8uTJcjqdys7OdreZOHFis/ecPHmyMjMzT1lLTU2NnE5ns8NszEsCAOD8CTC7gFNxuVyaP3++Lr74Yg0ePNj9+s0336yUlBQlJSVp69atWrBggXJycvTBBx9Ikux2e7OAJMn9vd1uP20bp9OpqqoqhYSEnFTPwoUL9fjjj7drH9tqfL/GkLTtsENFzmrF2YJNrggAAN/htSFp7ty52r59u7766qtmr991113ur4cMGaLExERNmDBBe/fuVa9evc5bPQ8++KDuu+8+9/dOp1PJycnn7fedjdgIq4Z1j9S3hxxalXNEPxplbj0AAPgSrxxumzdvnpYuXaqVK1eqe/fup207evRoSdKePXskSQkJCSosLGzWpun7hISE07ax2Wwt3kWSJKvVKpvN1uzwBk1Dbst3FZ6hJQAAaA2vCkmGYWjevHlasmSJVqxYodTU1DP+TFZWliQpMTFRkpSenq5t27apqOg/83QyMjJks9k0cOBAd5vly5c3e5+MjAylp6e3U088Z0L/xmHDr3YfVU19g8nVAADgO7wqJM2dO1dvvPGG3nrrLUVERMhut8tut6uqqkqStHfvXv32t7/V5s2btX//fv373//WzJkzNW7cOA0dOlSSNGnSJA0cOFC33nqrvv32Wy1btkwPP/yw5s6dK6vVKkm6++67tW/fPv3yl7/Url279OKLL+q9997Tvffea1rfz9WgJJtiI6yqqG3QptxjZpcDAIDP8KqQtGjRIjkcDl122WVKTEx0H++++64kKSgoSF988YUmTZqk/v376/7779f06dP10Ucfud/D399fS5culb+/v9LT0/XjH/9YM2fO1G9+8xt3m9TUVH388cfKyMjQsGHD9NRTT+mVV17R5MmTPd7ntvLzs2h8v1hJDLkBANCevHqdJG/mDeskNflsu113v7FZPbuGatUD402tBQA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kgAAgFfw97MoJtyqmHCr2aVIkrxjZhQAAICXISQBAAC0gJAEAADQAkISAABACwhJAAAALSAkAQAAtICQBAAA0AJCEgAAQAsISQAAAC0gJAEAALSAkAQAANACQhIAAEALCEkAAAAtCDC7gI7KMAxJktPpNLkSAABwtpo+t5s+x0+HkHSOysrKJEnJyckmVwIAAFqrrKxMkZGRp21jMc4mSuEkLpdL+fn5ioiIkMViMbucVnE6nUpOTtbBgwdls9nMLscj6DN99lX0mT77ovPZX8MwVFZWpqSkJPn5nX7WEXeSzpGfn5+6d+9udhltYrPZOsVfthPR586BPncO9Nn3na/+nukOUhMmbgMAALSAkAQAANACQlInZLVa9eijj8pqtZpdisfQ586BPncO9Nn3eUt/mbgNAADQAu4kAQAAtICQBAAA0AJCEgAAQAsISQAAAC0gJPmwNWvW6Oqrr1ZSUpIsFos+/PDDZudvu+02WSyWZseUKVPMKbYdLFy4UKNGjVJERITi4uI0bdo05eTkNGtTXV2tuXPnqmvXrgoPD9f06dNVWFhoUsVtdzZ9vuyyy066znfffbdJFbfdokWLNHToUPcic+np6fr000/d533tGktn7rOvXeOW/O53v5PFYtH8+fPdr/nitW7SUn998To/9thjJ/Wpf//+7vNmX2NCkg+rqKjQsGHD9MILL5yyzZQpU1RQUOA+3n77bQ9W2L5Wr16tuXPnav369crIyFBdXZ0mTZqkiooKd5t7771XH330kd5//32tXr1a+fn5uv76602sum3Ops+SNHv27GbX+cknnzSp4rbr3r27fve732nz5s36+uuvdfnll+vaa69Vdna2JN+7xtKZ+yz51jX+vk2bNukvf/mLhg4d2ux1X7zW0qn7K/nmdR40aFCzPn311Vfuc6ZfYwOdgiRjyZIlzV6bNWuWce2115pSjycUFRUZkozVq1cbhmEYpaWlRmBgoPH++++72+zcudOQZGRmZppVZrv6fp8NwzAuvfRS4+c//7l5RXlAly5djFdeeaVTXOMmTX02DN++xmVlZUafPn2MjIyMZv301Wt9qv4ahm9e50cffdQYNmxYi+e84RpzJ6mTW7VqleLi4tSvXz/NmTN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h999135hYKwCMISQBwXEBAgObNm6cnn3xSwcHBKigokNQYnhYuXChJysnJUXJyspllAvAQi2EYhtlFAIA3euSRRxQVFaX77rtPkvTee+/pk08+0eLFi80tDIBHEJIA4BTq6+v18MMP69NPP5XFYtGoUaP0zDPPKCwszOzSAHgAIQkAAKAFzEkCAABoASEJAACgBYQkAACAFhCSAAAAWkBIAgAAaAEhCQAAoAWEJAAAgBYQkgAAAFpASAIAAGgBIQkAAKAF/x+wENi6jRw7JAAAAABJRU5ErkJggg==", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "with quantity_support():\n", " plt.figure()\n", @@ -1062,29 +709,20 @@ "## Optimizing unit operations (if time)\n", "\n", "[performance tips]: https://docs.astropy.org/en/stable/units/index.html#performance-tips\n", - "[`astropy.units`]: https://docs.astropy.org/en/stable/units/index.html\n", - "[`%timeit`]: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit\n", + "[astropy.units]: https://docs.astropy.org/en/stable/units/index.html\n", + "[%timeit]: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit\n", "\n", - "Astropy's documentation includes [performance tips] for using [`astropy.units`] in computationally intensive situations. We can test it with [`%timeit`], which runs a command repeatedly to see how long it takes.\n", + "Astropy's documentation includes [performance tips] for using [astropy.units] in computationally intensive situations. We can test it with [%timeit], which runs a command repeatedly to see how long it takes.\n", "\n", "Putting compound units in parentheses speeds things up by reducing the number of copies made by the operation." ] }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "e3bc2348", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "11.2 µs ± 836 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n", - "6.71 µs ± 231 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n" - ] - } - ], + "outputs": [], "source": [ "%timeit 1.6 * u.barn * u.Mpc\n", "%timeit 1.6 * (u.barn * u.Mpc)" @@ -1095,25 +733,17 @@ "id": "4ff6e798-91dd-460d-bf29-172a95bf34b7", "metadata": {}, "source": [ - "[`Quantity`]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", + "[Quantity]: https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity\n", "\n", - "We can assign a unit to a value using the [`Quantity`] class directly." + "We can assign a unit to a value using the [Quantity] class directly." ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "id": "868b008e-1560-4edd-96ee-7ec1c00aca16", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "5.45 µs ± 88.4 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n" - ] - } - ], + "outputs": [], "source": [ "%timeit u.Quantity(1.6, u.barn * u.Mpc)" ] @@ -1128,18 +758,10 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "id": "3ecb16da-9dc3-4a62-a03a-e3afb312ae84", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1.85 µs ± 19.1 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n" - ] - } - ], + "outputs": [], "source": [ "volume_unit = u.barn * u.Mpc # pre-define the unit\n", "%timeit u.Quantity(1.6, volume_unit)" @@ -1159,50 +781,28 @@ "metadata": {}, "source": [ "[physical type]: https://docs.astropy.org/en/stable/units/physical_types.html\n", - "[`physical_type`]: https://docs.astropy.org/en/stable/api/astropy.units.UnitBase.html#astropy.units.UnitBase.physical_type\n", - "[`get_physical_type()`]: https://docs.astropy.org/en/stable/api/astropy.units.get_physical_type.html#astropy.units.get_physical_type\n", + "[physical_type]: https://docs.astropy.org/en/stable/api/astropy.units.UnitBase.html#astropy.units.UnitBase.physical_type\n", + "[get_physical_type()]: https://docs.astropy.org/en/stable/api/astropy.units.get_physical_type.html#astropy.units.get_physical_type\n", "\n", - "A [physical type] corresponds to physical quantities with dimensionally compatible units. Astropy has functionality that represents different physical types. These physical type objects can be accessed using either the [`physical_type`] attribute of a unit or [`get_physical_type()`]." + "A [physical type] corresponds to physical quantities with dimensionally compatible units. Astropy has functionality that represents different physical types. These physical type objects can be accessed using either the [physical_type] attribute of a unit or [get_physical_type()]." ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "id": "da6c9c7d", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "PhysicalType({'diffusivity', 'kinematic viscosity'})" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "(u.m**2 / u.s).physical_type" ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "f0d49b03", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "PhysicalType('number density')" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "u.get_physical_type(\"number density\")" ] @@ -1217,18 +817,10 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "id": "d03b8eb0", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "energy flux/irradiance\n" - ] - } - ], + "outputs": [], "source": [ "energy_density = (u.J * u.m**-3).physical_type\n", "velocity = u.get_physical_type(\"velocity\")\n", @@ -1245,21 +837,10 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "id": "2371647f-f29d-41cb-b89d-226d4743ce26", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "PhysicalType('absement')" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "u.get_physical_type(u.m * u.s)" ] @@ -1282,7 +863,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.1" + "version": "3.12.4" } }, "nbformat": 4,