Skip to content

Commit

Permalink
add codespell (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Oct 3, 2023
1 parent f7c4c36 commit 52bedf2
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 2,083 deletions.
18 changes: 18 additions & 0 deletions .codespell-ignore-words
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blocs
bloc
inout
pres
bion
tye
delt
thi
daa
numer
clen
coul
dum
crate
vie
fromm
nd
hsi
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,*.ipynb,*.bib,*.ps,*~,periodic_table.list,track-enucdot-profile
ignore-words = .codespell-ignore-words


39 changes: 39 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: codespell

on:
push:
branches:
- development
- main
pull_request:
branches:
- development

jobs:
codespell:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Cache pip
uses: actions/cache@v3
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install codespell

- name: Run codespell
run: |
codespell
4 changes: 2 additions & 2 deletions CITATION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MAESTROeX derives from MAESTRO. When citing the code, please cite the
two primary alrogithm papers below as well as any of the MAESTRO papers appropriate
to the discussion.
two primary algorithm papers below as well as any of the MAESTRO
papers appropriate to the discussion.

@ARTICLE{2019ApJ...887..212F,
author = {{Fan}, Duoming and {Nonaka}, Andrew and {Almgren}, Ann S. and
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/README
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flame/

sub_chandra/

Surpise! We're modelling convection. This time in 3D spherical
Surprise! We're modelling convection. This time in 3D spherical
in the helium shell on the surface of a sub-Chandrasekhar mass
carbon/oxygen white dwarf. Such systems can potentially yield
a variety of explosive outcomes. This setup is the basis for
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/code_comp/MaestroBaseState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void Maestro::InitBaseState(BaseState<Real>& rho0, BaseState<Real>& rhoh0,

// do HSE using RK2

// out intergration starts at y - h
// out integration starts at y - h
Real h = r == 0 ? base_geom.dr(n) * 0.5 : base_geom.dr(n);

auto k = dUdy(y - h, U_old);
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/rotating_star/ModelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void ModelParser::ReadFile(const std::string& model_file_name) {
varnames_stored[i] = maestro::trim(line.substr(ipos));
}

// alocate storage for the model data
// allocate storage for the model data
model_state.resize(npts_model);
for (auto i = 0; i < npts_model; ++i) {
model_state[i].resize(nvars_model);
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/urca/analysis/fad_excess.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ program fad_excess

plot_name(1) = "adiabatic excess"

! parse the arguements
! parse the arguments
narg = command_argument_count()

farg = 1
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/urca/analysis/fconv_radial.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ program fconv_radial
component_names(2) = "adiabatic gradient"
component_names(3) = "ledoux gradient"

! parse the arguements
! parse the arguments
narg = command_argument_count()

farg = 1
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/urca/analysis/fneutrinos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ program fneutrinos
dx = plotfile_get_dx(pf, 1)

! get the index bounds for the finest level.
! Note, lo and hi are ZERO-based indicies
! Note, lo and hi are ZERO-based indices
flo = lwb(plotfile_get_pd_box(pf, pf%flevel))
fhi = upb(plotfile_get_pd_box(pf, pf%flevel))

Expand Down
2 changes: 1 addition & 1 deletion Exec/science/urca/analysis/probin.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
! This file is automatically generated by write_probin.py at
! compile-time.
!
! To add a runtime parameter, do so by editting the appropriate _parameters
! To add a runtime parameter, do so by editing the appropriate _parameters
! file.

! This module stores the runtime parameters. The probin_init() routine is
Expand Down
7 changes: 4 additions & 3 deletions Exec/science/urca/analysis/scripts/slice-convgrad
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python
import argparse

import numpy as np
import yt
from yt import derived_field
import numpy as np
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str, help='Name of input plotfile.')
Expand All @@ -15,7 +16,7 @@ parser.add_argument('-sign', '--sign', action='store_true', help='If supplied, p
parser.add_argument('-fmin', '--field_min', type=float, help='Minimum scale for colorbar.')
parser.add_argument('-fmax', '--field_max', type=float, help='Maximum scale for colorbar.')
parser.add_argument('-log', '--logscale', action='store_true', help='If supplied, use a log scale for the field.')
parser.add_argument('-symlog', '--symlog', action='store_true', help='If supplied, use symlog scaling, which is linear near zero, to accomodate positive and negative values.')
parser.add_argument('-symlog', '--symlog', action='store_true', help='If supplied, use symlog scaling, which is linear near zero, to accommodate positive and negative values.')
parser.add_argument('-linthresh', '--linthresh', type=float, help='Linear threshold for symlog scaling. (Default is 0.1)')
parser.add_argument('-dc', '--drawcells', action='store_true', help='If supplied, draw the cell edges.')
parser.add_argument('-dg', '--drawgrids', action='store_true', help='If supplied, draw the grids.')
Expand Down
7 changes: 4 additions & 3 deletions Exec/science/urca/analysis/scripts/slice-enucdot
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env python
import argparse

import numpy as np
import yt
from yt import derived_field
import numpy as np
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str, help='Name of input plotfile.')
parser.add_argument('-w', '--width', type=float,
help='Width of slice (cm). Default is domain width.')
parser.add_argument('-axis', '--axis', type=str, default='x', help='Axis along which to slice. Should be "x", "y", or "z".')
parser.add_argument('-symlog', '--symlog', action='store_true', help='If supplied, use symlog scaling, which is linear near zero, to accomodate positive and negative values of Hnuc.')
parser.add_argument('-symlog', '--symlog', action='store_true', help='If supplied, use symlog scaling, which is linear near zero, to accommodate positive and negative values of Hnuc.')
parser.add_argument('-logmax', '--logmax', type=float,
help='Log of the +/- maximum Hnuc value.')
parser.add_argument('-rho', '--rhocontours', type=float, nargs='+', help='Draws contours for the densities provided (g/cm^3).')
Expand Down
9 changes: 5 additions & 4 deletions Exec/science/urca/analysis/scripts/slice-field
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Use yt to slice a boxlib plotfile supplied through the domain center.
Donald E. Willcox
"""
import yt
from yt import derived_field
import numpy as np
import argparse

import numpy as np
import yt
from UrcaAnalysis.yt_extensions import UrcaShellFields
from yt import derived_field

parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str, help='Name of input plotfile.')
Expand All @@ -19,7 +20,7 @@ parser.add_argument('-axis', '--axis', type=str, default='x',
parser.add_argument('-w', '--width', type=float,
help='Width of slice (cm). Default is domain width.')
parser.add_argument('-log', '--logscale', action='store_true', help='If supplied, use a log scale for the field.')
parser.add_argument('-symlog', '--symlog', type=float, help='If supplied, use symlog scaling, which is linear near zero, to accomodate positive and negative values of the field. Pass the value of the field at which to linearize the colorbar.')
parser.add_argument('-symlog', '--symlog', type=float, help='If supplied, use symlog scaling, which is linear near zero, to accommodate positive and negative values of the field. Pass the value of the field at which to linearize the colorbar.')
parser.add_argument('-rho', '--rhocontours', type=float, nargs='+', help='Draws contours for the densities provided (g/cm^3).')
parser.add_argument('-rhocolors', '--rhocolors', type=str, nargs='+', default='cyan', help='Color(s) of density contours.')
parser.add_argument('-ctr', '--center', type=float, nargs='+', help='Centers the plot on the coordinates provided (x, y, z).')
Expand Down
11 changes: 5 additions & 6 deletions Exec/science/urca/analysis/scripts/streamlines
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env python
import yt
import numpy as np
import matplotlib.pylab as pl

from yt.visualization.api import Streamlines
from yt.units import cm
import numpy as np
import yt
from mpl_toolkits.mplot3d import Axes3D
from yt.units import cm
from yt.visualization.api import Streamlines

# Load the dataset
ds = yt.load('wd_512_rhoc4-5_plt64636')
Expand All @@ -24,7 +23,7 @@ pos = pos_dx
streamlines = Streamlines(ds, pos, ('boxlib', 'x_vel'), ('boxlib', 'y_vel'), ('boxlib', 'z_vel'), get_magnitude=True, volume=ds.all_data())
streamlines.integrate_through_volume()

# Create a 3D plot, trace the streamlines throught the 3D volume of the plot
# Create a 3D plot, trace the streamlines through the 3D volume of the plot
fig=pl.figure()
ax = Axes3D(fig)
for stream in streamlines.streamlines:
Expand Down
2 changes: 1 addition & 1 deletion Exec/test_problems/double_bubble/MaestroInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using namespace amrex;
using namespace problem_rp;

// prototype for pertubation function to be called on the
// prototype for perturbation function to be called on the
// device (if USE_CUDA=TRUE)
AMREX_GPU_DEVICE
void Perturb(const Real p0, const Real* s0, Real* perturbations,
Expand Down
2 changes: 1 addition & 1 deletion Exec/test_problems/reacting_bubble/MaestroInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using namespace amrex;
using namespace problem_rp;

// prototype for pertubation function to be called on the
// prototype for perturbation function to be called on the
// device (if USE_CUDA=TRUE)
AMREX_GPU_DEVICE
void Perturb(const Real p0_init, const Real* s0, Real* perturbations,
Expand Down
2 changes: 1 addition & 1 deletion Exec/test_problems/rt/MaestroInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using namespace amrex;
using namespace problem_rp;

// prototype for pertubation function to be called on the
// prototype for perturbation function to be called on the
// device (if USE_CUDA=TRUE)
AMREX_GPU_DEVICE
void Perturb(const Real p0, const Real* s0, Real* scal_pert, Real* vel_pert,
Expand Down
2 changes: 1 addition & 1 deletion Exec/unit_tests/test_basestate/README
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ plane-parallel test problem:
------------------------------------------------------------------------------
analytical CNO cycle test problem:

make sure to change the nework in GNUmakefile to H_core_null
make sure to change the network in GNUmakefile to H_core_null


------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Exec/unit_tests/test_diffusion/MaestroInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void Maestro::MakeNewLevelFromScratch(int lev, Real time, const BoxArray& ba,
const auto x = prob_lo[0] + (Real(i) + 0.5) * dx[0] - center_p[0];
const auto y = prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1];

// apply the guassian enthalpy pulse at constant density
// apply the Gaussian enthalpy pulse at constant density
const auto dist2 = x * x + y * y;

const auto h_zone =
Expand Down
4 changes: 2 additions & 2 deletions Exec/unit_tests/test_react/scripts/fsnapshot.f90
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ subroutine fplotfile_get_comps(pltfile, comps_sz, comps)
!characters.

!Perhaps there is a more elegant solution, but I've just resized the array to
!accomodate all of the characters and it works as a rudimentary work-around if
!accommodate all of the characters and it works as a rudimentary work-around if
!one is really determined to have a string returned.

!f2py intent(in) :: pltfile
Expand Down Expand Up @@ -340,7 +340,7 @@ subroutine fplotfile_get_data_3d(pltfile, component, mydata, nx, ny, nz, ierr)


! get the index bounds and dx for the coarse level. Note, lo and
! hi are ZERO based indicies
! hi are ZERO based indices
lo = lwb(plotfile_get_pd_box(pf, 1))
hi = upb(plotfile_get_pd_box(pf, 1))

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ http://amrex-astro.github.io/MAESTROeX/
required, as is Python (>= 3.6) and standard tools available in any
Unix-like environments (e.g., Perl and `sed`).

For GPU computing, CUDA 10 or later is requred.
For GPU computing, CUDA 10 or later is required.

- To stay up-to-date with MAESTROeX, you will want to periodically
pull changes from the repository by typing `git pull`.
Expand All @@ -43,7 +43,7 @@ http://amrex-astro.github.io/MAESTROeX/
git clone --recursive https://github.com/AMReX-Astro/MAESTROeX.git
```

To add the submodules to an exisiting clone, from the top-level
To add the submodules to an existing clone, from the top-level
MAESTROeX directory, do:

```
Expand Down
2 changes: 1 addition & 1 deletion Source/MaestroMakew0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ void Maestro::Tridiag(const BaseStateArray<Real>& a,
auto gam = gam_s.array();

if (b(0) == 0) {
Abort("tridiag: CANT HAVE B(0) = 0.0");
Abort("tridiag: CAN NOT HAVE B(0) = 0.0");
}

Real bet = b(0);
Expand Down
4 changes: 2 additions & 2 deletions Source/MaestroNodalProj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void Maestro::NodalProj(int proj_type, Vector<MultiFab>& rhcc,
} else if (proj_type == pressure_iters_comp) {
// Vproj = Vproj - sig*grad(phi)
// we do this manually instead of using mlndlap.updateVelocity() because
// for alt_energy_fix we neet beta0*grad(phi)
// for alt_energy_fix we need beta0*grad(phi)
for (int lev = 0; lev <= finest_level; ++lev) {
for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
MultiFab::Multiply(gphi[lev], sig[lev], 0, dir, 1, 0);
Expand All @@ -404,7 +404,7 @@ void Maestro::NodalProj(int proj_type, Vector<MultiFab>& rhcc,
} else if (proj_type == regular_timestep_comp) {
// Vproj = Vproj - sig*grad(phi)
// we do this manually instead of using mlndlap.updateVelocity() because
// for alt_energy_fix we neet beta0*grad(phi)
// for alt_energy_fix we need beta0*grad(phi)
for (int lev = 0; lev <= finest_level; ++lev) {
for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
MultiFab::Multiply(gphi[lev], sig[lev], 0, dir, 1, 0);
Expand Down
6 changes: 3 additions & 3 deletions Util/diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ be output:
Additional arguments depend on the problem:

- **1d**: no additional arguments are required
- **2d cylindrical**: extra arguents `--xctr x` and `--yctr y` giving the coordinates
- **2d cylindrical**: extra arguments `--xctr x` and `--yctr y` giving the coordinates
of the domain center (x,y) can be provided (both default to 0.0)
- **2d spherical**: the argument `--sphr` *must* be provided to indicate a spherical
problem, and the `--yctr y` argument can be provided to give the y coordinate of
the domain center (defaults to 0.0)
- **3d cylindrical**: extra arguents `--xctr x` and `--yctr y` giving the coordinates
- **3d cylindrical**: extra arguments `--xctr x` and `--yctr y` giving the coordinates
of the domain center (x,y) can be provided (both default to 0.0)
- **3d spherical**: the argument `--sphr` *must* be provided to indicate a spherical
problem, and extra arguents `--xctr x`, `--yctr y` and `--zctr z` giving the coordinates
problem, and extra arguments `--xctr x`, `--yctr y` and `--zctr z` giving the coordinates
of the domain center (x,y,z) can be provided (all default to 0.0)
4 changes: 2 additions & 2 deletions Util/model_parser/ModelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void ModelParser::ReadFile(const std::string& model_file_name) {
varnames_stored[i] = maestro::trim(line.substr(ipos));
}

// alocate storage for the model data
// allocate storage for the model data
model_state.resize(npts_model);
for (auto i = 0; i < npts_model; ++i) {
model_state[i].resize(nvars_model);
Expand Down Expand Up @@ -204,4 +204,4 @@ Real ModelParser::Interpolate(const Real r, const int ivar,
}

return interpolate;
}
}
2 changes: 1 addition & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ of density and pressure stratification.
The code leverages the new AMReX software framework [@AMReX] for block-structured
adaptive mesh refinement (AMR) applications, allowing for scalability
to large fractions of leadership-class machines.
Our approach to parallization uses a hybrid MPI/OpenMP approach, with increasing GPU support.
Our approach to parallelization uses a hybrid MPI/OpenMP approach, with increasing GPU support.
Microphysics are provided by the Starkiller-Astro libraries [@starkiller].
The code contains documentation through sphinx, a large suite of test problems, and
nightly regression tests on a number of architectures.
Expand Down
2 changes: 1 addition & 1 deletion sphinx_docs/source/Godunov.rst
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ Then upwind based on :math:`v_{\ib-\half\eb_y}^{1D}`:
u_{R,\ib-\half\eb_y}^{y|z}, & v_{\ib-\half\eb_y}^{1D} < 0.
\end{cases}
We use an analogous procedure to compute five more intemediate states,
We use an analogous procedure to compute five more intermediate states,
:math:`u_{\ib-\half\eb_z}^{z|y}, v_{\ib-\half\eb_x}^{x|z},
v_{\ib-\half\eb_z}^{z|x}, w_{\ib-\half\eb_x}^{x|y}`, and
:math:`w_{\ib-\half\eb_y}^{y|x}`. Then we do a full-dimensional
Expand Down
Loading

0 comments on commit 52bedf2

Please sign in to comment.