From 719ef93d341c2981d0d4b0220e8f7d7a82c46f69 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 11 Feb 2026 08:10:19 -0500 Subject: [PATCH 1/2] more fixes --- .codespell-ignore-words | 21 +++++++++++++++ .codespellrc | 5 ++++ .github/workflows/codespell.yml | 32 +++++++++++++++++++++++ basic_numerics/FFT/fft_simple_examples.py | 2 +- burgers/burgers.py | 2 +- compressible/MOL/Fortran/riemann.f90 | 6 ++--- compressible/MOL/python/riemann.py | 6 ++--- compressible/euler-generaleos.ipynb | 12 ++++----- 8 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 .codespell-ignore-words create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespell-ignore-words b/.codespell-ignore-words new file mode 100644 index 0000000..abb854f --- /dev/null +++ b/.codespell-ignore-words @@ -0,0 +1,21 @@ +blocs +bloc +inout +als +truns +pres +dum +fom +fromm +thi +nd +ue +bion +aas +checkin +indx +ans +precesses +fpr +bu +delt diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..0bd1461 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,*.bib,*.ps,*.pdf +ignore-words = .codespell-ignore-words + + diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..ed87408 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,32 @@ +name: codespell + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + codespell: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: '3.14' + + - name: Install codespell + run: pip install codespell jupyter nbconvert + + - name: Preprocess notebooks + run: for i in $(find . -name "*.ipynb"); do jupyter nbconvert --clear-output --inplace $i; done + + - name: Run codespell + run: | + codespell content + diff --git a/basic_numerics/FFT/fft_simple_examples.py b/basic_numerics/FFT/fft_simple_examples.py index 833b324..4b3a096 100644 --- a/basic_numerics/FFT/fft_simple_examples.py +++ b/basic_numerics/FFT/fft_simple_examples.py @@ -82,7 +82,7 @@ def plot_FFT(xx, xmax, f, outfile): fk_r = fk.real fk_i = fk.imag - # the fftfreq returns the postive and negative (and 0) frequencies + # the fftfreq returns the positive and negative (and 0) frequencies # the newer versions of numpy (>=1.8) have an rfftfreq() function # that really does what we want -- we'll use that here. k = np.fft.rfftfreq(npts) diff --git a/burgers/burgers.py b/burgers/burgers.py index 79fca5c..a5a583e 100644 --- a/burgers/burgers.py +++ b/burgers/burgers.py @@ -29,7 +29,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0, bc="outflow"): self.bc=bc - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 diff --git a/compressible/MOL/Fortran/riemann.f90 b/compressible/MOL/Fortran/riemann.f90 index 841915e..c2c7e0c 100644 --- a/compressible/MOL/Fortran/riemann.f90 +++ b/compressible/MOL/Fortran/riemann.f90 @@ -33,7 +33,7 @@ ! Fry: Fryxell et al. 2000, ApJS, 131, 273. ! ! Toro: Toro 1999, ``Riemann Solvers and Numerical Methods for Fluid -! Dynamcs: A Practical Introduction, 2nd Ed.'', Springer-Verlag +! Dynamics: A Practical Introduction, 2nd Ed.'', Springer-Verlag ! module riemann_module @@ -139,7 +139,7 @@ subroutine riemann(gamma, & ! begin the secant iteration -- see CG Eq. 17 for details. We will - ! continue to interate for convergence until the error falls below + ! continue to iterate for convergence until the error falls below ! tol (in which case, things are good), or we hit nriem iterations ! (in which case we have a problem, and we spit out an error). has_converged = .false. @@ -222,7 +222,7 @@ subroutine riemann(gamma, & ustar_sgn = sign(1.d0, ustar) - ! decide which state is located at the zone iterface based on + ! decide which state is located at the zone interface based on ! the values of the wave speeds. This is just saying that if ! ustar > 0, then the state is U_L. if ustar < 0, then the ! state on the axis is U_R. diff --git a/compressible/MOL/python/riemann.py b/compressible/MOL/python/riemann.py index 22635ab..fcbc2fa 100644 --- a/compressible/MOL/python/riemann.py +++ b/compressible/MOL/python/riemann.py @@ -34,7 +34,7 @@ Fry: Fryxell et al. 2000, ApJS, 131, 273. Toro: Toro 1999, ``Riemann Solvers and Numerical Methods for Fluid - Dynamcs: A Practical Introduction, 2nd Ed.'', Springer-Verlag + Dynamcis: A Practical Introduction, 2nd Ed.'', Springer-Verlag """ import numpy as np @@ -107,7 +107,7 @@ def riemann(q_l, q_r, gamma): pstar2 = max(smallp, pstar2) # begin the secant iteration -- see CG Eq. 17 for details. We will - # continue to interate for convergence until the error falls below + # continue to iterate for convergence until the error falls below # tol (in which case, things are good), or we hit nriem iterations # (in which case we have a problem, and we spit out an error). has_converged = False @@ -188,7 +188,7 @@ def riemann(q_l, q_r, gamma): else: ustar_sgn = 1.0 - # decide which state is located at the zone iterface based on + # decide which state is located at the zone interface based on # the values of the wave speeds. This is just saying that if # ustar > 0, then the state is U_L. if ustar < 0, then the # state on the axis is U_R. diff --git a/compressible/euler-generaleos.ipynb b/compressible/euler-generaleos.ipynb index f5378c0..6ed25f4 100644 --- a/compressible/euler-generaleos.ipynb +++ b/compressible/euler-generaleos.ipynb @@ -288,7 +288,7 @@ }, "outputs": [], "source": [ - "# we use the helper rountines above to find the orthogonal left and right eigenvectors\n", + "# we use the helper routines above to find the orthogonal left and right eigenvectors\n", "eigen = eigensystem(A)" ] }, @@ -488,7 +488,7 @@ "source": [ "## $\\beta$'s and final update\n", "\n", - "The final interface state is writen by projecting the jump in primitive variables, $\\Delta q$, into characteristic variables (as $l \\cdot \\Delta q$), and then adding up all the jumps that reach the interface.\n", + "The final interface state is written by projecting the jump in primitive variables, $\\Delta q$, into characteristic variables (as $l \\cdot \\Delta q$), and then adding up all the jumps that reach the interface.\n", "\n", "The convention is to write $\\beta^\\nu = l^\\nu \\cdot \\Delta q$, where the superscript identifies which eigenvalue (and corresponding eigenvectors) we are considering. Note, that often a reference state is used, and the jump, $\\Delta q$, will be the difference with respect to this reference state. For PPM, the $\\Delta q$ will take the form of the integral under the parabola over the range that each wave can reach.\n", "\n", @@ -877,7 +877,7 @@ }, "outputs": [], "source": [ - "# we use the helper rountines above to find the orthogonal left and right eigenvectors\n", + "# we use the helper routines above to find the orthogonal left and right eigenvectors\n", "eigen = eigensystem(A)" ] }, @@ -1544,7 +1544,7 @@ }, "outputs": [], "source": [ - "# we use the helper rountines above to find the orthogonal left and right eigenvectors\n", + "# we use the helper routines above to find the orthogonal left and right eigenvectors\n", "eigen = eigensystem(A, suba=cg, subb=sqrt(cc))" ] }, @@ -2092,7 +2092,7 @@ "source": [ "# Gray FLD Radiation Euler Equations with $(\\gamma_e)$\n", "\n", - "We now look at the same system with a different auxillary thermodynamic variable (as we did with pure hydro), using $q = (\\tau, u, p, {\\gamma_e}_g, E_r)^\\intercal$:\n", + "We now look at the same system with a different auxiliary thermodynamic variable (as we did with pure hydro), using $q = (\\tau, u, p, {\\gamma_e}_g, E_r)^\\intercal$:\n", "\\begin{align}\n", "\\frac{\\partial \\tau}{\\partial t} &= -u\\frac{\\partial \\tau}{\\partial x} + \\tau \\frac{\\partial u}{\\partial x} \\\\\n", "\\frac{\\partial u}{\\partial t} &= -u \\frac{\\partial u}{\\partial x} - \\tau \\frac{\\partial p}{\\partial x}\n", @@ -2295,7 +2295,7 @@ }, "outputs": [], "source": [ - "# we use the helper rountines above to find the orthogonal left and right eigenvectors\n", + "# we use the helper routines above to find the orthogonal left and right eigenvectors\n", "eigen = eigensystem(A, suba=cg, subb=sqrt(cc))" ] }, From 8956e5a5e25176a3d22070d6f924430166e67b2c Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 11 Feb 2026 08:12:09 -0500 Subject: [PATCH 2/2] add codespell --- advection/advection.py | 4 ++-- advection/fdadvect.py | 2 +- advection/fv_mol.py | 2 +- compressible/MOL/python/euler_mol.py | 2 +- compressible/weno_euler.py | 2 +- finite-volume/conservative-interpolation-cyl.ipynb | 2 +- finite-volume/conservative-interpolation.ipynb | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/advection/advection.py b/advection/advection.py index 53a251f..c87519d 100644 --- a/advection/advection.py +++ b/advection/advection.py @@ -56,7 +56,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0): self.xmin = xmin self.xmax = xmax - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 @@ -182,7 +182,7 @@ def states(self, dt): # loop over all the interfaces. Here, i refers to the left - # interface of the zone. Note that thre are 1 more interfaces + # interface of the zone. Note that there are 1 more interfaces # than zones al = g.scratch_array() ar = g.scratch_array() diff --git a/advection/fdadvect.py b/advection/fdadvect.py index 2c01774..8404041 100644 --- a/advection/fdadvect.py +++ b/advection/fdadvect.py @@ -24,7 +24,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0): self.ng = ng self.nx = nx - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 diff --git a/advection/fv_mol.py b/advection/fv_mol.py index a13b5a5..8a42d60 100644 --- a/advection/fv_mol.py +++ b/advection/fv_mol.py @@ -10,7 +10,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0): self.ng = ng self.nx = nx - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 diff --git a/compressible/MOL/python/euler_mol.py b/compressible/MOL/python/euler_mol.py index ce8a5eb..ef0c840 100644 --- a/compressible/MOL/python/euler_mol.py +++ b/compressible/MOL/python/euler_mol.py @@ -24,7 +24,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0, bcs="outflow"): self.bcs = bcs - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 diff --git a/compressible/weno_euler.py b/compressible/weno_euler.py index fd7575d..4282a75 100644 --- a/compressible/weno_euler.py +++ b/compressible/weno_euler.py @@ -16,7 +16,7 @@ def __init__(self, nx, ng, xmin=0.0, xmax=1.0, bc="outflow"): self.bc = bc - # python is zero-based. Make easy intergers to know where the + # python is zero-based. Make easy integers to know where the # real data lives self.ilo = ng self.ihi = ng+nx-1 diff --git a/finite-volume/conservative-interpolation-cyl.ipynb b/finite-volume/conservative-interpolation-cyl.ipynb index 2f03d59..bbf662f 100644 --- a/finite-volume/conservative-interpolation-cyl.ipynb +++ b/finite-volume/conservative-interpolation-cyl.ipynb @@ -41,7 +41,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We want to construct a linear polynomal through that points $r_i$, $r_{i+1}$ that gives the correct averages,\n", + "We want to construct a linear polynomial through that points $r_i$, $r_{i+1}$ that gives the correct averages,\n", "$r_i$, and $r_{i+1}$ when integrated over the volume, e.g.\n", "\n", "$$\\frac{1}{r_i \\Delta r} \\int_{r_{i-1/2}}^{r_{i+1/2}} f(r) r dr = f_i$$\n", diff --git a/finite-volume/conservative-interpolation.ipynb b/finite-volume/conservative-interpolation.ipynb index 0ff7de7..42bbf05 100644 --- a/finite-volume/conservative-interpolation.ipynb +++ b/finite-volume/conservative-interpolation.ipynb @@ -39,7 +39,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We want to construct a quadratic polynomal through that points $x_{i-1}$, $x_i$, $x_{i+1}$ that gives the correct averages,\n", + "We want to construct a quadratic polynomial through that points $x_{i-1}$, $x_i$, $x_{i+1}$ that gives the correct averages,\n", "$f_{i-1}$, $f_i$, and $f_{i-1}$ when integrated over the volume, e.g.\n", "\n", "$$\\frac{1}{\\Delta x} \\int_{x_{i-1/2}}^{x_{i+1/2}} f(x) dx = f_i$$\n", @@ -308,7 +308,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We want to construct a cubic polynomal through that points $x_{i-2}$, $x_{i-1}$, $x_i$, $x_{i+1}$ that gives the correct averages,\n", + "We want to construct a cubic polynomial through that points $x_{i-2}$, $x_{i-1}$, $x_i$, $x_{i+1}$ that gives the correct averages,\n", "$f_{i-2}$, $f_{i-1}$, $f_i$, and $f_{i-1}$ when integrated over the volume of each zone" ] },