diff --git a/.codespell-ignore-words b/.codespell-ignore-words new file mode 100644 index 0000000000..25908b2add --- /dev/null +++ b/.codespell-ignore-words @@ -0,0 +1,15 @@ +blocs +bloc +inout +pres +bion +tye +delt +thi +daa +numer +clen +coul +dum +crate +vie diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..ec1149d406 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,*.ipynb,*.bib,*.ps,*~ +ignore-words = .codespell-ignore-words + + diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..9802bb4604 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 + diff --git a/CHANGES.md b/CHANGES.md index a63def63db..51776a8e1b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) @@ -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) @@ -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 @@ -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 diff --git a/EOS/helmholtz/actual_eos.H b/EOS/helmholtz/actual_eos.H index 6709e8ace2..997c373811 100644 --- a/EOS/helmholtz/actual_eos.H +++ b/EOS/helmholtz/actual_eos.H @@ -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; diff --git a/integration/VODE/actual_integrator.H b/integration/VODE/actual_integrator.H index 3eeaad46fd..34be9ba439 100644 --- a/integration/VODE/actual_integrator.H +++ b/integration/VODE/actual_integrator.H @@ -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 diff --git a/integration/VODE/vode_type.H b/integration/VODE/vode_type.H index b522ee35e9..ae9372c505 100644 --- a/integration/VODE/vode_type.H +++ b/integration/VODE/vode_type.H @@ -17,7 +17,7 @@ typedef ArrayUtil::MathArray2D<1, VODE_NEQS, 1, VODE_NEQS> RArray2D; const amrex::Real UROUND = std::numeric_limits::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; diff --git a/integration/integrator_rhs_strang.H b/integration/integrator_rhs_strang.H index 1996b230e2..6a1fd7136e 100644 --- a/integration/integrator_rhs_strang.H +++ b/integration/integrator_rhs_strang.H @@ -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); diff --git a/integration/nse_update_strang.H b/integration/nse_update_strang.H index 8b9ac60d95..ea3124ca7d 100644 --- a/integration/nse_update_strang.H +++ b/integration/nse_update_strang.H @@ -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); @@ -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); diff --git a/interfaces/burn_type.H b/interfaces/burn_type.H index 07a6bf4d3d..46c8803522 100644 --- a/interfaces/burn_type.H +++ b/interfaces/burn_type.H @@ -37,7 +37,7 @@ typedef amrex::Array1D 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 diff --git a/networks/aprox19/README.md b/networks/aprox19/README.md index 1829228ee3..272a3c0360 100644 --- a/networks/aprox19/README.md +++ b/networks/aprox19/README.md @@ -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 @@ -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 @@ -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 \ No newline at end of file +The inference is that it is a positive term that is subtracted from Ye diff --git a/networks/general_null/breakout.net b/networks/general_null/breakout.net index c22b6e6127..afb738a32f 100644 --- a/networks/general_null/breakout.net +++ b/networks/general_null/breakout.net @@ -4,6 +4,6 @@ # name short-name aion zion X X 1.0 1.0 -# auxillary variables +# auxiliary variables __aux_Ye __aux_invmu diff --git a/networks/general_null/gammalaw_aux.net b/networks/general_null/gammalaw_aux.net index ce80b63b01..429d88c5b2 100644 --- a/networks/general_null/gammalaw_aux.net +++ b/networks/general_null/gammalaw_aux.net @@ -4,5 +4,5 @@ # name short-name aion zion X X 1.0 1.0 -# auxillary variables +# auxiliary variables __aux_Ye diff --git a/networks/general_null/network_param_file.py b/networks/general_null/network_param_file.py index e484e8bd3a..8671c21ab1 100644 --- a/networks/general_null/network_param_file.py +++ b/networks/general_null/network_param_file.py @@ -1,4 +1,4 @@ -"""core functions for deailing with a network file""" +"""core functions for dealing with a network file""" import sys @@ -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: @@ -151,7 +151,7 @@ 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] @@ -159,7 +159,7 @@ def parse_network_object(fields, defines): 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] @@ -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] diff --git a/networks/rprox/README.md b/networks/rprox/README.md index 287cfd7743..47e76db174 100644 --- a/networks/rprox/README.md +++ b/networks/rprox/README.md @@ -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: diff --git a/neutrinos/sneut5.H b/neutrinos/sneut5.H index 926a73a565..6b066a2895 100644 --- a/neutrinos/sneut5.H +++ b/neutrinos/sneut5.H @@ -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; diff --git a/nse_solver/nse_check.H b/nse_solver/nse_check.H index fa3e480245..ccc26bc59a 100644 --- a/nse_solver/nse_check.H +++ b/nse_solver/nse_check.H @@ -653,7 +653,7 @@ void nse_union(const int nuc_ind_a, const int nuc_ind_b, amrex::Array1D& group_ind, const burn_t& stat merge_indices(2) = -1; fastest_t = std::numeric_limits::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){ @@ -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. @@ -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; diff --git a/screening/screen.H b/screening/screen.H index 4a2a434956..c577af72ed 100644 --- a/screening/screen.H +++ b/screening/screen.H @@ -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 diff --git a/sphinx_docs/source/integrators.rst b/sphinx_docs/source/integrators.rst index f2246d278a..23fcaa54bd 100644 --- a/sphinx_docs/source/integrators.rst +++ b/sphinx_docs/source/integrators.rst @@ -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 diff --git a/unit_test/burn_cell_primordial_chem/README.md b/unit_test/burn_cell_primordial_chem/README.md index fc6b9e7e83..ed6a65afff 100644 --- a/unit_test/burn_cell_primordial_chem/README.md +++ b/unit_test/burn_cell_primordial_chem/README.md @@ -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 diff --git a/unit_test/burn_cell_sdc/parse_integration_failure.py b/unit_test/burn_cell_sdc/parse_integration_failure.py index 44c81ae4c7..9ce9769b62 100644 --- a/unit_test/burn_cell_sdc/parse_integration_failure.py +++ b/unit_test/burn_cell_sdc/parse_integration_failure.py @@ -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 diff --git a/unit_test/test_ase/make_table/README.md b/unit_test/test_ase/make_table/README.md index 3d81d99fb9..5815caa44a 100644 --- a/unit_test/test_ase/make_table/README.md +++ b/unit_test/test_ase/make_table/README.md @@ -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 diff --git a/unit_test/test_conductivity/main.cpp b/unit_test/test_conductivity/main.cpp index f7d1faed50..9beba694a6 100644 --- a/unit_test/test_conductivity/main.cpp +++ b/unit_test/test_conductivity/main.cpp @@ -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 diff --git a/unit_test/test_eos/main.cpp b/unit_test/test_eos/main.cpp index f1258b72e7..429eb4ba97 100644 --- a/unit_test/test_eos/main.cpp +++ b/unit_test/test_eos/main.cpp @@ -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 diff --git a/unit_test/test_jac/main.cpp b/unit_test/test_jac/main.cpp index 9673448248..f43ff9e9a5 100644 --- a/unit_test/test_jac/main.cpp +++ b/unit_test/test_jac/main.cpp @@ -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 diff --git a/unit_test/test_react/main.cpp b/unit_test/test_react/main.cpp index 419dddc07c..d0041e8c80 100644 --- a/unit_test/test_react/main.cpp +++ b/unit_test/test_react/main.cpp @@ -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 @@ -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++) { diff --git a/unit_test/test_react/test_network_combinations.py b/unit_test/test_react/test_network_combinations.py index 3a0ee48b9d..be1f9b4dd5 100755 --- a/unit_test/test_react/test_network_combinations.py +++ b/unit_test/test_react/test_network_combinations.py @@ -135,7 +135,7 @@ def doit(): except: sys.exit("unable to create directory") - # copy the executable and suport files + # copy the executable and support files for f in link_files: try: diff --git a/unit_test/test_rhs/main.cpp b/unit_test/test_rhs/main.cpp index 256b7d7556..1b04270667 100644 --- a/unit_test/test_rhs/main.cpp +++ b/unit_test/test_rhs/main.cpp @@ -120,7 +120,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 diff --git a/unit_test/test_screening/main.cpp b/unit_test/test_screening/main.cpp index 70e3e2aad2..6ac6fa5552 100644 --- a/unit_test/test_screening/main.cpp +++ b/unit_test/test_screening/main.cpp @@ -110,7 +110,7 @@ void main_main () // time = starting time in the simulation Real time = 0.0_rt; - // How Boxes are distrubuted among MPI processes + // How Boxes are distributed among MPI processes DistributionMapping dm(ba); // we allocate our main multifabs diff --git a/unit_test/test_sdc/main.cpp b/unit_test/test_sdc/main.cpp index f01e25960e..459919f8bc 100644 --- a/unit_test/test_sdc/main.cpp +++ b/unit_test/test_sdc/main.cpp @@ -117,7 +117,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 @@ -161,7 +161,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++) { diff --git a/util/build_scripts/write_probin.py b/util/build_scripts/write_probin.py index d5176a3d69..c6942cc353 100755 --- a/util/build_scripts/write_probin.py +++ b/util/build_scripts/write_probin.py @@ -22,9 +22,10 @@ """ +import argparse import os import sys -import argparse + import runtime_parameters HEADER = """ @@ -33,7 +34,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. """ diff --git a/util/esum.H b/util/esum.H index ea37a83e03..de25957ade 100644 --- a/util/esum.H +++ b/util/esum.H @@ -11,7 +11,7 @@ // exactly to within double precision arithmetic. // Ported to C++. -// For perfomance reasons we implement a specialized +// For performance reasons we implement a specialized // version of esum for each possible value of N >= 3. // Also for performance reasons, we explicitly unroll diff --git a/util/esum_cxx.py b/util/esum_cxx.py index 80ec3748d7..f9475365f4 100644 --- a/util/esum_cxx.py +++ b/util/esum_cxx.py @@ -1,8 +1,6 @@ +import argparse import os import re -import argparse - - module_start = """ // NOTE: THIS FILE IS AUTOMATICALLY GENERATED @@ -17,7 +15,7 @@ // exactly to within double precision arithmetic. // Ported to C++. -// For perfomance reasons we implement a specialized +// For performance reasons we implement a specialized // version of esum for each possible value of N >= 3. // Also for performance reasons, we explicitly unroll diff --git a/util/skynet/README.md b/util/skynet/README.md index ce8805bcb8..01f5d444a1 100644 --- a/util/skynet/README.md +++ b/util/skynet/README.md @@ -12,7 +12,7 @@ NOTE: The "presure" option in the skydata class in compare.py can be Quick Start: 1. Make sure Skynet is installed and working. Be sure to set your SKYNET_HOME variable, and to prepend SKYNET_HOME to your - PYTHON_PATH. The above depend on importing buit in scripts from + PYTHON_PATH. The above depend on importing built-in scripts from Skynet, so we need to tell python where to find them. 2. Change desired problem parameters in burn.py as needed.