Skip to content

Commit

Permalink
add codespell CI (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Apr 29, 2023
1 parent 5cd303a commit cb0a9fc
Show file tree
Hide file tree
Showing 34 changed files with 112 additions and 51 deletions.
15 changes: 15 additions & 0 deletions .codespell-ignore-words
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
blocs
bloc
inout
pres
bion
tye
delt
thi
daa
numer
clen
coul
dum
crate
vie
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,*~
ignore-words = .codespell-ignore-words


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

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

jobs:
codespell:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- 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
8 changes: 4 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

# 22.11

* use of the auxillary state to define composition is now enabled
* use of the auxiliary state to define composition is now enabled
via USE_AUX_THERMO and the preprocessor variable AUX_THERMO
(#1003)

Expand Down Expand Up @@ -175,7 +175,7 @@
breakout reactions (#751)

* Some fixes to the NSE bailout in aprox19 (#739, #753, #755) and
the relaxation check on the NSE critera (#754)
the relaxation check on the NSE criteria (#754)

* Added a new unit test for single-zone SDC (burn_cell_sdc) (#744)

Expand Down Expand Up @@ -560,7 +560,7 @@
corresponding inverse from the work of Deboer et al. 2017
(https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.89.035007).
To use the new rate, user must set `use_c12ag_deboer17` to `true`.
This rate is only useable in the `aprox13`, `aprox19`, `aprox21`,
This rate is only usable in the `aprox13`, `aprox19`, `aprox21`,
and `iso7` reaction rate networks. Closes issue #44.

* a routine util/cj_detonation was added to compute the
Expand All @@ -582,7 +582,7 @@

* we now disable some composition derivatives in the EOS
by default, for performance and memory reasons. They can
be reenabled by defining the preprocessor variable
be re-enabled by defining the preprocessor variable
EXTRA_THERMO (PR #59)

# 17.10
Expand Down
2 changes: 1 addition & 1 deletion EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void apply_coulomb_corrections (T& state)

// uniform background corrections only
// from yakovlev & shalybkov 1989
// lami is the average ion seperation
// lami is the average ion separation
// plasg is the plasma coupling parameter

Real ytot1 = 1.0e0_rt / state.abar;
Expand Down
2 changes: 1 addition & 1 deletion integration/VODE/actual_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void actual_integrator (burn_t& state, Real dt)
// this in case we failed in our burn here because we entered NSE

#ifdef AUX_THERMO
// need to sync the auxilary data up with the new mass fractions
// need to sync the auxiliary data up with the new mass fractions
set_aux_comp_from_X(state);
#endif

Expand Down
2 changes: 1 addition & 1 deletion integration/VODE/vode_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef ArrayUtil::MathArray2D<1, VODE_NEQS, 1, VODE_NEQS> RArray2D;

const amrex::Real UROUND = std::numeric_limits<amrex::Real>::epsilon();

// CCMXJ = Threshhold on DRC for updating the Jacobian
// CCMXJ = Threshold on DRC for updating the Jacobian
const amrex::Real CCMXJ = 0.2e0_rt;

const amrex::Real HMIN = 0.0_rt;
Expand Down
2 changes: 1 addition & 1 deletion integration/integrator_rhs_strang.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void rhs (const Real time, burn_t& state, T& int_state, RArray1D& ydot, [[maybe_
// network

// Fix the state as necessary -- this ensures that the mass
// fractions that enter are valud (and optionally normalized)
// fractions that enter are valid (and optionally normalized)

clean_state(int_state);

Expand Down
4 changes: 2 additions & 2 deletions integration/nse_update_strang.H
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void nse_burn(burn_t& state, const Real dt) {

// call the NSE table using the * state to get the t^{n+1}
// source estimates. The thermodynamnics here is specified
// in terms of the auxillary composition, Ye, abar, and B/A
// in terms of the auxiliary composition, Ye, abar, and B/A

nse_interp(T_in, state.rho, state.aux[iye],
abar_out, dq_out, dyedt, X);
Expand All @@ -61,7 +61,7 @@ void nse_burn(burn_t& state, const Real dt) {

state.aux[iye] += dt * dyedt;

// now get the composition from the table using the upated Ye
// now get the composition from the table using the updated Ye

nse_interp(T_in, state.rho, state.aux[iye],
abar_out, dq_out, dyedt, X);
Expand Down
2 changes: 1 addition & 1 deletion interfaces/burn_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef amrex::Array1D<Real, 1, neqs> YdotNetArray1D;

#if defined(SDC_EVOLVE_ENERGY)

// these indicies represent the order that the conserved state comes
// these indices represent the order that the conserved state comes
// into the ODE integration from the hydro code.
//
// they also represent the order of the advective sources
Expand Down
6 changes: 3 additions & 3 deletions networks/aprox19/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ from Stan:
> Probably all the code needs for hydrodynamics and energy generation
> is abar and Ye (given rho and T) so to follow explosions you can use
> the smaller table. It also gives crude measures of nucleosyntheis in
> n+p+helium, si-ca, fe group. Probaly good enough for NSE
> n+p+helium, si-ca, fe group. Probably good enough for NSE
>
> If you are following bufk nucleosynthesis you can use the larger table
> which gives 125 isotopes packaged into 19 (CASTRO used to use the 19
Expand All @@ -48,7 +48,7 @@ The mapping of the nuclei from the large network to the 19 we carry is:
* 13: 44Ti
* 14: 48Cr
* 15: 52Fe
* 16: all oher iron group except 56Ni
* 16: all other iron group except 56Ni
* 17: 56Ni
* 18: neutrons
* 19: protons
Expand Down Expand Up @@ -158,4 +158,4 @@ similar rate for beta decay and positron capture
So if electron capture dominates wrate is positive
The inference is that it is a positive term that is subtracted from Ye
The inference is that it is a positive term that is subtracted from Ye
2 changes: 1 addition & 1 deletion networks/general_null/breakout.net
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# name short-name aion zion
X X 1.0 1.0

# auxillary variables
# auxiliary variables
__aux_Ye
__aux_invmu
2 changes: 1 addition & 1 deletion networks/general_null/gammalaw_aux.net
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# name short-name aion zion
X X 1.0 1.0

# auxillary variables
# auxiliary variables
__aux_Ye
12 changes: 6 additions & 6 deletions networks/general_null/network_param_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""core functions for deailing with a network file"""
"""core functions for dealing with a network file"""

import sys

Expand All @@ -17,13 +17,13 @@ def __str__(self):


class AuxVar:
"""convenience class for an auxilliary variable"""
"""convenience class for an auxiliary variable"""
def __init__(self):
self.name = ""
self.preprocessor = None

def __str__(self):
return f"auxillary variable {self.name}"
return f"auxiliary variable {self.name}"


class UnusedVar:
Expand Down Expand Up @@ -151,15 +151,15 @@ def parse_network_object(fields, defines):
ret = AuxVar()
ret.name = fields[0][6:]
# we can put a preprocessor variable after the aux name to
# require that it be set in order to define the auxillary
# require that it be set in order to define the auxiliary
# variable
try:
ret.preprocessor = fields[1]
except IndexError:
ret.preprocessor = None

# we can put a preprocessor variable after the aux name to
# require that it be set in order to define the auxillary
# require that it be set in order to define the auxiliary
# variable
try:
ret.preprocessor = fields[1]
Expand All @@ -173,7 +173,7 @@ def parse_network_object(fields, defines):
ret = UnusedVar()

# we can put a preprocessor variable after the aux name to
# require that it be set in order to define the auxillary
# require that it be set in order to define the auxiliary
# variable
try:
ret.preprocessor = fields[1]
Expand Down
2 changes: 1 addition & 1 deletion networks/rprox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ essentially the network described in Appendix C of Wallace & Woosley,
ApJS 45, 389 (1981) but with updated reaction rates from ReacLib.

The default setup is for burning in a neutron star atmosphere. If you
want a setup at lower density, you need to change the Lweak paramter
want a setup at lower density, you need to change the Lweak parameter
in actual_rhs.f90.

This network was used in:
Expand Down
2 changes: 1 addition & 1 deletion neutrinos/sneut5.H
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void sneut5(const Real temp, const Real den,
// theta is sin**2(theta_weinberg) = 0.2319 plus/minus 0.00005 (1996)
// xnufam is the number of neutrino flavors = 3.02 plus/minus 0.005 (1998)
// change theta and xnufam if need be, and the changes will automatically
// propagate through the routine. cv and ca are the vektor and axial currents.
// propagate through the routine. cv and ca are the vector and axial currents.

constexpr Real theta = 0.2319e0_rt;
constexpr Real xnufam = 3.0e0_rt;
Expand Down
8 changes: 4 additions & 4 deletions nse_solver/nse_check.H
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void nse_union(const int nuc_ind_a, const int nuc_ind_b, amrex::Array1D<int, 1,
AMREX_GPU_HOST_DEVICE AMREX_INLINE
int get_pair_rate_index(const int& rate_index){

// This funciton finds the pair rate index given a rate.
// This function finds the pair rate index given a rate.
// For example given forward rate index, return reverse rate index, vice versa

int pair_rate_index = -1;
Expand Down Expand Up @@ -949,7 +949,7 @@ void nse_grouping(amrex::Array1D<int, 1, NumSpec>& group_ind, const burn_t& stat
merge_indices(2) = -1;
fastest_t = std::numeric_limits<amrex::Real>::max();

// Find the fastest time scale of the avaliable reaction
// Find the fastest time scale of the available reaction

for (int n = 1; n <= Rates::NumRates; ++n){

Expand Down Expand Up @@ -1002,7 +1002,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) {
}

// We can do a further approximation where we use the NSE mass fractions
// instead of the current mass fractions. This makes the check soley dependent on
// instead of the current mass fractions. This makes the check solely dependent on
// the thermodynamic condition.
// Note we only do this after the first check, which should tell us whether
// our current mass fractions are in the ballpark of NSE mass fractions.
Expand Down Expand Up @@ -1067,7 +1067,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) {
ydot(NumSpec + 1) = enuc - sneut;

// Now we look through the network and see if there are fast reaction cycles
// Need to separate forward and reverse rate and detemine each step is fast enough.
// Need to separate forward and reverse rate and determine each step is fast enough.
// use vectors for now

bool found_fast_reaction_cycle = false;
Expand Down
2 changes: 1 addition & 1 deletion screening/screen.H
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void chabrier1998 (const plasma_state_t& state,
}

// Now we add quantum correction terms discussed in Alastuey 1978.
// Notice in Alastuey 1978, they have a differnt classical term,
// Notice in Alastuey 1978, they have a different classical term,
// which is implemented in the strong screening limit of our screen5 routine.

// See Wallace1982, Eq. A13
Expand Down
2 changes: 1 addition & 1 deletion sphinx_docs/source/integrators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ This involves an EOS call and is the default behavior of the integration.

If desired, the EOS call can be skipped and the temperature kept
frozen over the entire time interval of the integration. This is done
bu setting ``integrator.call_eos_in_rhs = 0``.
by setting ``integrator.call_eos_in_rhs = 0``.

Note also that for the Jacobian, we need the specific heat, :math:`c_v`, since we
usually calculate derivatives with respect to temperature (as this is the form
Expand Down
2 changes: 1 addition & 1 deletion unit_test/burn_cell_primordial_chem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
because our equations are very stiff (stiffness ratios are as high as 1e31)
because y/ydot (natural timescale for a species abundance to vary) can be
very different (by factors ~ 1e30) for different species.
However, state.rho still conatins the density in g/cm^3, and state.e
However, state.rho still contains the density in g/cm^3, and state.e
still contains the specific internal energy in erg/g/K.

# continuous integration
Expand Down
3 changes: 2 additions & 1 deletion unit_test/burn_cell_sdc/parse_integration_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@

import sys


def doit(string):
"""break down the SDC VODE integration failure message"""

# figure out if it is the VODE failre or burn_t that was provided
# figure out if it is the VODE failure or burn_t that was provided

is_vode = False
rhoe = None
Expand Down
2 changes: 1 addition & 1 deletion unit_test/test_ase/make_table/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NSE check tables

This test is used to have a table that has a variety of differen rho,
This test is used to have a table that has a variety of different rho,
T, and Y_e, to test the valitidy of the function `in_nse`.

We solve for the NSE state for variety of different conditions, and update
Expand Down
2 changes: 1 addition & 1 deletion unit_test/test_conductivity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void main_main ()
// time = starting time in the simulation
Real time = 0.0;

// How Boxes are distrubuted among MPI processes
// How Boxes are distributed among MPI processes
DistributionMapping dm(ba);

// we allocate our main multifabs
Expand Down
2 changes: 1 addition & 1 deletion unit_test/test_eos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void main_main ()
// time = starting time in the simulation
Real time = 0.0;

// How Boxes are distrubuted among MPI processes
// How Boxes are distributed among MPI processes
DistributionMapping dm(ba);

// we allocate our main multifabs
Expand Down
2 changes: 1 addition & 1 deletion unit_test/test_jac/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void main_main ()
// time = starting time in the simulation
Real time = 0.0;

// How Boxes are distrubuted among MPI processes
// How Boxes are distributed among MPI processes
DistributionMapping dm(ba);

// we allocate our main multifabs
Expand Down
4 changes: 2 additions & 2 deletions unit_test/test_react/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void main_main ()
// time = starting time in the simulation
Real time = 0.0;

// How Boxes are distrubuted among MPI processes
// How Boxes are distributed among MPI processes
DistributionMapping dm(ba);

// we allocate our main multifabs
Expand Down Expand Up @@ -165,7 +165,7 @@ void main_main ()
amrex::max(xn[n], 1.e-10_rt);
}

// initialize the auxillary state (in particular, for NSE)
// initialize the auxiliary state (in particular, for NSE)
#ifdef AUX_THERMO
eos_t eos_state;
for (int n = 0; n < NumSpec; n++) {
Expand Down
Loading

0 comments on commit cb0a9fc

Please sign in to comment.