Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 6, 2025
1 parent 7384484 commit aef8e3f
Show file tree
Hide file tree
Showing 8 changed files with 722 additions and 744 deletions.
4 changes: 2 additions & 2 deletions docs/source/notebooks/astropy-units-completed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"\n",
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install astropy matplotlib numpy\n",
"\n",
"import astropy.units as u\n",
Expand Down
23 changes: 10 additions & 13 deletions docs/source/notebooks/particles-formulary-completed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"source": [
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install plasmapy==2024.7.0\n",
"\n",
"import astropy.units as u\n",
Expand Down Expand Up @@ -983,7 +983,7 @@
"outputs": [],
"source": [
"B_corona = 50 * u.G\n",
"n_corona = 1e9 * u.cm ** -3\n",
"n_corona = 1e9 * u.cm**-3\n",
"T_corona = 1 * u.MK"
]
},
Expand Down Expand Up @@ -1030,7 +1030,7 @@
"source": [
"T_photosphere = 5800 * u.K\n",
"B_photosphere = 400 * u.G\n",
"n_photosphere = 1e17 * u.cm ** -3"
"n_photosphere = 1e17 * u.cm**-3"
]
},
{
Expand Down Expand Up @@ -1117,7 +1117,7 @@
"metadata": {},
"outputs": [],
"source": [
"n = 1 * u.cm ** -3\n",
"n = 1 * u.cm**-3\n",
"B = 5 * u.nT\n",
"T = 30000 * u.K"
]
Expand Down Expand Up @@ -1432,12 +1432,11 @@
"outputs": [],
"source": [
"def return_function():\n",
"\n",
" print(\"Defining inner_function...\")\n",
" \n",
" def inner_function(): \n",
"\n",
" def inner_function():\n",
" print(\"Calling inner_function!\")\n",
" \n",
"\n",
" return inner_function"
]
},
Expand Down Expand Up @@ -1530,9 +1529,7 @@
"outputs": [],
"source": [
"def decorator(function: Callable):\n",
" \n",
" def decorated_function() -> None:\n",
"\n",
" print(\"Before calling the function.\")\n",
" result = function()\n",
" print(\"After calling the function.\")\n",
Expand Down Expand Up @@ -2273,7 +2270,7 @@
"@validate_quantities\n",
"def alfven_speed(\n",
" B: u.Quantity[u.T],\n",
" n: u.Quantity[u.m**-3], \n",
" n: u.Quantity[u.m**-3],\n",
" ion: ParticleLike,\n",
") -> u.Quantity[u.m / u.s]:\n",
" \"\"\"Return the Alfvén speed.\"\"\"\n",
Expand All @@ -2293,7 +2290,7 @@
},
"outputs": [],
"source": [
"alfven_speed(B = 0.02 * u.T, n = 1e15 * u.m**-3, ion=\"p+\")"
"alfven_speed(B=0.02 * u.T, n=1e15 * u.m**-3, ion=\"p+\")"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions notebooks/astropy-units-completed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"\n",
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install astropy matplotlib numpy\n",
"\n",
"import astropy.units as u\n",
Expand Down
12 changes: 3 additions & 9 deletions notebooks/astropy-units.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@
"\n",
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
" !pip install astropy matplotlib numpy\n",
"\n",
"import astropy.units as u\n",
"from astropy.visualization import quantity_support\n",
"from astropy import constants\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np"
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install astropy matplotlib numpy"
]
},
{
Expand Down
1,367 changes: 683 additions & 684 deletions notebooks/dispersion_solver_complete.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions notebooks/new.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"source": [
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install plasmapy==2024.7.0 matplotlib numpy astropy\n",
"\n",
"from plasmapy.particles import *\n",
Expand Down
23 changes: 10 additions & 13 deletions notebooks/particles-formulary-completed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"source": [
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install plasmapy==2024.7.0\n",
"\n",
"import astropy.units as u\n",
Expand Down Expand Up @@ -984,7 +984,7 @@
"outputs": [],
"source": [
"B_corona = 50 * u.G\n",
"n_corona = 1e9 * u.cm ** -3\n",
"n_corona = 1e9 * u.cm**-3\n",
"T_corona = 1 * u.MK"
]
},
Expand Down Expand Up @@ -1031,7 +1031,7 @@
"source": [
"T_photosphere = 5800 * u.K\n",
"B_photosphere = 400 * u.G\n",
"n_photosphere = 1e17 * u.cm ** -3"
"n_photosphere = 1e17 * u.cm**-3"
]
},
{
Expand Down Expand Up @@ -1118,7 +1118,7 @@
"metadata": {},
"outputs": [],
"source": [
"n = 1 * u.cm ** -3\n",
"n = 1 * u.cm**-3\n",
"B = 5 * u.nT\n",
"T = 30000 * u.K"
]
Expand Down Expand Up @@ -1432,12 +1432,11 @@
"outputs": [],
"source": [
"def return_function():\n",
"\n",
" print(\"Defining inner_function...\")\n",
" \n",
" def inner_function(): \n",
"\n",
" def inner_function():\n",
" print(\"Calling inner_function!\")\n",
" \n",
"\n",
" return inner_function"
]
},
Expand Down Expand Up @@ -1530,9 +1529,7 @@
"outputs": [],
"source": [
"def decorator(function: Callable):\n",
" \n",
" def decorated_function() -> None:\n",
"\n",
" print(\"Before calling the function.\")\n",
" result = function()\n",
" print(\"After calling the function.\")\n",
Expand Down Expand Up @@ -2272,7 +2269,7 @@
"@validate_quantities\n",
"def alfven_speed(\n",
" B: u.Quantity[u.T],\n",
" n: u.Quantity[u.m**-3], \n",
" n: u.Quantity[u.m**-3],\n",
" ion: ParticleLike,\n",
") -> u.Quantity[u.m / u.s]:\n",
" \"\"\"Return the Alfvén speed.\"\"\"\n",
Expand All @@ -2292,7 +2289,7 @@
},
"outputs": [],
"source": [
"alfven_speed(B = 0.02 * u.T, n = 1e15 * u.m**-3, ion=\"p+\")"
"alfven_speed(B=0.02 * u.T, n=1e15 * u.m**-3, ion=\"p+\")"
]
}
],
Expand Down
29 changes: 10 additions & 19 deletions notebooks/particles-formulary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@
"source": [
"import sys\n",
"\n",
"if 'google.colab' in str(get_ipython()):\n",
" if 'plasmapy' not in sys.modules:\n",
"if \"google.colab\" in str(get_ipython()):\n",
" if \"plasmapy\" not in sys.modules:\n",
" !pip install plasmapy==2024.7.0\n",
"\n",
"import astropy.units as u\n",
"import numpy as np\n",
"from plasmapy.particles import *\n",
"from plasmapy.particles.particle_class import valid_categories\n",
"from plasmapy.formulary import *\n",
"from plasmapy.utils.decorators import validate_quantities"
"from plasmapy.formulary import *"
]
},
{
Expand Down Expand Up @@ -890,7 +887,7 @@
"outputs": [],
"source": [
"B_corona = 50 * u.G\n",
"n_corona = 1e9 * u.cm ** -3\n",
"n_corona = 1e9 * u.cm**-3\n",
"T_corona = 1 * u.MK"
]
},
Expand Down Expand Up @@ -935,7 +932,7 @@
"source": [
"T_photosphere = 5800 * u.K\n",
"B_photosphere = 400 * u.G\n",
"n_photosphere = 1e17 * u.cm ** -3"
"n_photosphere = 1e17 * u.cm**-3"
]
},
{
Expand Down Expand Up @@ -1020,7 +1017,7 @@
"metadata": {},
"outputs": [],
"source": [
"n = 1 * u.cm ** -3\n",
"n = 1 * u.cm**-3\n",
"B = 5 * u.nT\n",
"T = 30000 * u.K"
]
Expand Down Expand Up @@ -1307,12 +1304,11 @@
"outputs": [],
"source": [
"def return_function():\n",
"\n",
" print(\"Defining inner_function...\")\n",
" \n",
" def inner_function(): \n",
"\n",
" def inner_function():\n",
" print(\"Calling inner_function!\")\n",
" \n",
"\n",
" return inner_function"
]
},
Expand Down Expand Up @@ -1394,9 +1390,7 @@
"outputs": [],
"source": [
"def decorator(function: Callable):\n",
" \n",
" def decorated_function() -> None:\n",
"\n",
" print(\"Before calling the function.\")\n",
" result = function()\n",
" print(\"After calling the function.\")\n",
Expand Down Expand Up @@ -1588,10 +1582,7 @@
"metadata": {},
"outputs": [],
"source": [
"import astropy.units as u\n",
"from astropy import constants\n",
"from plasmapy.utils.decorators import check_relativistic\n",
"from plasmapy.particles import particle_input"
"import astropy.units as u"
]
},
{
Expand Down

0 comments on commit aef8e3f

Please sign in to comment.