Skip to content

Commit

Permalink
Merge pull request #5600 from MFraters/add_typos_tester
Browse files Browse the repository at this point in the history
Add typos spell checker.
  • Loading branch information
gassmoeller authored Mar 15, 2024
2 parents ef56a34 + aec05d5 commit 002c0bf
Show file tree
Hide file tree
Showing 29 changed files with 99 additions and 42 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Spell Check with Typos
on:
push:
branches:
- 'main'
pull_request:

concurrency:
group: ${{ github.actor }}-${{ github.ref }}-typos
cancel-in-progress: true

permissions: write-all

jobs:
typos-check:
name: Check for new typos
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the Checkout Actions Repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check spelling with typos
#uses: crate-ci/typos@master
env:
GH_TOKEN: "${{ github.token }}"
run: |
mkdir -p "${{ runner.temp }}/typos"
RELEASE_ASSET_URL="$(
gh api /repos/crate-ci/typos/releases/latest \
--jq '."assets"[] | select(."name" | test("^typos-.+-x86_64-unknown-linux-musl\\.tar\\.gz$")) | ."browser_download_url"'
)"
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
--quiet --output-document=- "${RELEASE_ASSET_URL}" \
| tar -xz -C "${{ runner.temp }}/typos" ./typos
"${{ runner.temp }}/typos/typos" --version
"${{ runner.temp }}/typos/typos" --config .typos.toml --format json >> ${{ runner.temp }}/typos.jsonl || true
python -c '
import sys, json
old = set()
clean = True
with open(sys.argv[1]) as file:
for line in file:
new = json.loads(line)
if new["type"] == "typo":
clean = False
print("::warning file={},line={},col={}::perhaps \"{}\" should be \"{}\".".format(
new["path"], new["line_num"], new["byte_offset"],
new["typo"], " or ".join(new["corrections"])))
sys.exit(1 if not clean else 0)' "${{ runner.temp }}/typos.jsonl"
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ extend-exclude = [
"*.vtu",
"contrib/catch/*",
"contrib/world_builder/*",
"tests/world_builder_declarations*",
"*.bib", # bib entries contain many arbitrary abbreviations
"parameters.*", # parameters should be corrected in the original source
"doc/sphinx/parameters/*", # parameters should be corrected in the original source
"tests/prmbackslash*", # this test purposefully breaks words on different lines
"contrib/python/env-py_aspect.yml", # this contains random strings which may trip up typos
]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ you can find it [here](https://sourceforge.net/projects/astyle/files/astyle/asty
An easy way to install it is through using the following command in Linux (do not do this in the aspect directory):
`mkdir astyle && cd astyle && wget 'https://sourceforge.net/projects/astyle/files/astyle/astyle 2.04/astyle_2.04_linux.tar.gz' && tar -zxvf astyle_2.04_linux.tar.gz && cd astyle/build/gcc && make && sudo make install`.
This will create a new directory called astyle, download, unpack, compile and install it.
When you add the bin direcoty to to your path, the indent command should find astyle.
When you add the bin directory to to your path, the indent command should find astyle.

### Changelog entries

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/buiter_et_al_2016_jsg/exp_1.prm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subsection Geometry model
end

# Mesh refinement specifications
# AMR is not used since model X,Y repititions are defined.
# AMR is not used since model X,Y repetitions are defined.
subsection Mesh refinement
set Initial adaptive refinement = 0
set Initial global refinement = 0
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/shear_bands/plot_hist_and_porosity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# 'band_angle_adaptive.csv' that contain the number of degrees of
# freedom for a given model, the standard deviation and the mean band
# angle, which can be used to plot the convergence of the band angle
# unsing the script 'plot_band_angle_dofs.py'.
# using the script 'plot_band_angle_dofs.py'.

import numpy as np
import numpy.fft as fft
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/grain_size_ridge/doc/grain_size_ridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Finally, we use a second Order Runge Kutta integrator to advect the particles.
We run the model for 200 million years. In the first few tens of millions of years
there are no large changes in the temperature structure, except that the
thermal boundary layer increases slightly in thickness. In addition, the grain
size evolves from its intially constant value, with the grain size being
size evolves from its initially constant value, with the grain size being
reduced due to deformation. This leads to a band of particularly low grain
size in the lowermost part of the oceanic plate. Grain size is also reduced
in the asthenesphere, but to a lesser degree.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subsection Material model
# The 'inner core material' model also contains a function that
# represents the resistance to melting/freezing at the inner core
# boundary.
# For P-->inifinity, the boundary is a free slip boundary, and for
# For P-->infinity, the boundary is a free slip boundary, and for
# P-->0, the boundary is an open boundary (with zero normal stress).
subsection Inner core
subsection Phase change resistance function
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/inner_core_convection/inner_core_traction.prm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ subsection Material model
# velocity and normal stress. The relation between the two scales
# with the phase change number P, which is given in the 'Function
# expression'.
# For P-->inifinity, the boundary is a free slip boundary, and for
# For P-->infinity, the boundary is a free slip boundary, and for
# P-->0, the boundary is an open boundary (with zero normal stress).

# For time dependence, the variable names have to have dim+1 entries,
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/steinberger/steinberger.prm
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ subsection Material model
set Minimum viscosity = 1e20

# We base our viscosity profile on the adiabat computed based on the
# material porperties used in the model rather than the laterally
# material properties used in the model rather than the laterally
# averaged temperature.
set Use lateral average temperature for viscosity = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ namespace aspect
prm.declare_entry ("Phase transition temperatures", "",
Patterns::List (Patterns::Double(0)),
"A list of temperatures where phase transitions occur. Higher or lower "
"temperatures lead to phase transition ocurring in smaller or greater "
"temperatures lead to phase transition occurring in smaller or greater "
"depths than given in Phase transition depths, depending on the "
"Clapeyron slope given in Phase transition Clapeyron slopes. "
"List must have the same number of entries as Phase transition depths. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace aspect
* fault boundaries and in continental regions at locations defined
* by the the compositional field 'faults' or 'cratons', respectively.
* The material model also allows the option to compute and use
* equilibirum grain size following paleowattmeter approximation
* equilibrium grain size following paleowattmeter approximation
* by Austin and Evans, (2007), Paleowattmeters: "A scaling relation for
* dynamically recrystallized grain size", Geology, 35, 343.
* Other material parameters are either based on (1) an input tomography
Expand Down Expand Up @@ -246,9 +246,9 @@ namespace aspect
std::vector<double> average_viscosity_profile;

/**
* Variable returned to determine if the evaluate () funciton is called and
* Variable returned to determine if the evaluate () function is called and
* viscosities are computed. Initially, it is set to false and then updated
* to true in the update () funciton.
* to true in the update () function.
*/
bool initialized;

Expand Down Expand Up @@ -477,7 +477,7 @@ namespace aspect
double lithosphere_thickness;

/**
* Parameter used to decribe the uppermost mantle based on Tutu (2018).
* Parameter used to describe the uppermost mantle based on Tutu (2018).
*/
double depth_to_base_of_uppermost_mantle;

Expand Down
2 changes: 1 addition & 1 deletion data/material-model/steinberger/visc.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
0.264E+23 0.9843
];

% values are for the middle of the inveral, so shift the x values
% values are for the middle of the interval, so shift the x values

len = size(mat,1);
for i=1:size(mat,1)-1
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/changes/20230718_lhy11009
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Improved: The iteration scheme in the diffusion dislocation material model now uses the derivative of the logarithm of the strain rate to the logarithm of the stress. This improves efficiency and stablility of the iterative scheme. The parameter "Strain rate residual tolerance" now corresponds to the residual for the logarithm of the strain rate (which close to the solution corresponds to the relative residual).
Improved: The iteration scheme in the diffusion dislocation material model now uses the derivative of the logarithm of the strain rate to the logarithm of the stress. This improves efficiency and stability of the iterative scheme. The parameter "Strain rate residual tolerance" now corresponds to the residual for the logarithm of the strain rate (which close to the solution corresponds to the relative residual).
<br>
(Haoyuan Li and Bob Myhill, 2023/07/18)
2 changes: 1 addition & 1 deletion doc/modules/to-2.5.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
* (Elodie Kendall and Anne Glerum, 2022/07/29)
*
* <li> Changed: Models that use a strain-dependent rheology
* can now use an interative Advection scheme, which was
* can now use an interactive Advection scheme, which was
* confirmed not to cause unrealistic accumulation of
* strain in compositional fields during nonlinear iterations.
* <br>
Expand Down
2 changes: 1 addition & 1 deletion include/aspect/material_model/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace aspect

private:
/**
* The StucturedDataLookup object that stores the material data.
* The StructuredDataLookup object that stores the material data.
*/
std::unique_ptr<Utilities::StructuredDataLookup<2>> material_lookup;
};
Expand Down
4 changes: 2 additions & 2 deletions include/aspect/mesh_deformation/fastscape.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ namespace aspect

/**
* Flag for having FastScape advect/uplift the surface. If the free surface is used
* in conjuction with FastScape, this can be set to false, then FastScape will only
* in conjunction with FastScape, this can be set to false, then FastScape will only
* apply erosion/deposition to the surface and not advect or uplift it.
*/
bool fastscape_advection_uplift;
Expand Down Expand Up @@ -374,7 +374,7 @@ namespace aspect
unsigned int left;

/**
* Paramters that set the fastscape boundaries periodic even though the ghost nodes are set 'fixed'
* Parameters that set the fastscape boundaries periodic even though the ghost nodes are set 'fixed'
*/
bool topbottom_ghost_nodes_periodic;
bool leftright_ghost_nodes_periodic;
Expand Down
2 changes: 1 addition & 1 deletion include/aspect/postprocess/crystal_preferred_orientation.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace aspect
std::pair<std::string,std::string> execute (TableHandler &statistics) override;

/**
* This funcion ensures that the particle postprocessor is run before
* This function ensures that the particle postprocessor is run before
* this postprocessor.
*/
std::list<std::string>
Expand Down
6 changes: 3 additions & 3 deletions include/aspect/simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ namespace aspect
* Assemble and solve the temperature equation.
* This function returns the residual after solving.
*
* If the `redidual` argument is not a `nullptr`, the function computes
* If the `residual` argument is not a `nullptr`, the function computes
* the residual and puts it into this variable. The function returns
* the current residual divided by the initial residual given as the
* first argument. The two arguments may point to the same variable,
Expand All @@ -770,7 +770,7 @@ namespace aspect
* (fields or particles). This function returns the residuals for
* all fields after solving.
*
* If the `redidual` argument is not a `nullptr`, the function computes
* If the `residual` argument is not a `nullptr`, the function computes
* the residual and puts it into this variable. The function returns
* the current residual divided by the initial residual given as the
* first argument. The two arguments may point to the same variable,
Expand All @@ -787,7 +787,7 @@ namespace aspect
* Assemble and solve the Stokes equation.
* This function returns the nonlinear residual after solving.
*
* If the `redidual` argument is not a `nullptr`, the function computes
* If the `residual` argument is not a `nullptr`, the function computes
* the residual and puts it into this variable. The function returns
* the current residual divided by the initial residual given as the
* first argument. The two arguments may point to the same variable,
Expand Down
8 changes: 4 additions & 4 deletions source/mesh_deformation/fastscape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1516,10 +1516,10 @@ namespace aspect
// Now load the last output at time of restart.
// this allows us to correctly track when to call
// FastScape to make new VTK files.
std::ifstream in_last_ouput_time(restart_filename_time);
AssertThrow (in_last_ouput_time, ExcIO());
std::ifstream in_last_output_time(restart_filename_time);
AssertThrow (in_last_output_time, ExcIO());
{
in_last_ouput_time >> last_output_time;
in_last_output_time >> last_output_time;
}
}

Expand Down Expand Up @@ -1698,7 +1698,7 @@ namespace aspect
"Deposition coefficient for bedrock.");
prm.declare_entry("Sediment deposition coefficient", "-1",
Patterns::Double(),
"Deposition coefficient for sediment, -1 sets this to teh same as the bedrock deposition coefficient.");
"Deposition coefficient for sediment, -1 sets this to the same as the bedrock deposition coefficient.");
prm.declare_entry("Bedrock river incision rate", "1e-5",
Patterns::Double(),
"River incision rate for bedrock in the Stream Power Law. Units: $\\{m^(1-2*drainage_area_exponent)/yr}$");
Expand Down
14 changes: 7 additions & 7 deletions source/postprocess/crystal_preferred_orientation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ namespace aspect
prm.declare_entry ("Random number seed", "1",
Patterns::Integer (0),
"The seed used to generate random numbers. This will make sure that "
"results are reproducable as long as the problem is run with the "
"results are reproducible as long as the problem is run with the "
"same amount of MPI processes. It is implemented as final seed = "
"random number seed + MPI Rank. ");

Expand Down Expand Up @@ -623,7 +623,7 @@ namespace aspect
"over the rotation matrix since they only require to write 3 values instead "
"of 9. If the list is empty, this file will not be written."
"Furthermore, the entries will be written out in the order given, "
"and if entries are entered muliple times, they will be written "
"and if entries are entered multiple times, they will be written "
"out multiple times.");

prm.declare_entry ("Write out draw volume weighted cpo data",
Expand All @@ -642,11 +642,11 @@ namespace aspect
"over the rotation matrix since they only require to write 3 values instead "
"of 9. If the list is empty, this file will not be written. "
"Furthermore, the entries will be written out in the order given, "
"and if entries are entered muliple times, they will be written "
"and if entries are entered multiple times, they will be written "
"out multiple times.");
prm.declare_entry ("Compress cpo data files", "true",
Patterns::Bool(),
"Wether to compress the raw and weighted cpo data output files with zlib.");
"Whether to compress the raw and weighted cpo data output files with zlib.");
}
prm.leave_subsection ();
}
Expand Down Expand Up @@ -721,7 +721,7 @@ namespace aspect

AssertThrow(split_raw_cpo_instructions.size() == 2,
ExcMessage("Value \""+ write_raw_cpo_list[i] +"\", set in \"Write out raw cpo data\", is not a correct option "
+ "because it should contain a mineral identification and a output specifier seprated by a colon (:). This entry "
+ "because it should contain a mineral identification and a output specifier separated by a colon (:). This entry "
+ "does not follow those rules."));

// get mineral number
Expand Down Expand Up @@ -764,7 +764,7 @@ namespace aspect

AssertThrow(split_draw_volume_weighted_cpo_instructions.size() == 2,
ExcMessage("Value \""+ write_draw_volume_weighted_cpo_list[i] +"\", set in \"Write out draw volume weighted cpo data\", is not a correct option "
+ "because it should contain a mineral identification and a output specifier seprated by a colon (:). This entry "
+ "because it should contain a mineral identification and a output specifier separated by a colon (:). This entry "
+ "does not follow those rules."));

// get mineral number
Expand Down Expand Up @@ -832,7 +832,7 @@ namespace aspect
"is recommended for plotting against real data. For both representations"
"the specific output fields and their order can be set."
"The work of this postprocessor should better be done by the main particles "
"postprocessor, however we need to be able to process the data before outputing it, "
"postprocessor, however we need to be able to process the data before outputting it, "
"which does not work with that postprocessor. If this is added to the other "
"postprocessor in the future this one becomes obsolete.")
}
Expand Down
2 changes: 1 addition & 1 deletion tests/box_simple_log_viscosity_depth_average.prm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set Pressure normalization = surface
set Surface pressure = 0

# Geometry of the domain. In order to test the depth averaging,
# we use the X and Y repititions such that four equal depth
# we use the X and Y repetitions such that four equal depth
# layers of visocisty are created in the depth-dependent material
# model.
subsection Geometry model
Expand Down
2 changes: 1 addition & 1 deletion tests/drucker_prager_derivatives_2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
/**
* We can't take to small strain-rates, because then the difference in the
* visocisty will be too small for the double accuracy which stores
* the visocity solutions and the finite diference solution.
* the visocity solutions and the finite difference solution.
*/
in_base.strain_rate[0] = SymmetricTensor<2,dim>();
in_base.strain_rate[0][0][0] = 1e-12;
Expand Down
2 changes: 1 addition & 1 deletion tests/drucker_prager_derivatives_3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
/**
* We can't take to small strain-rates, because then the difference in the
* visocisty will be too small for the double accuracy which stores
* the visocity solutions and the finite diference solution.
* the visocity solutions and the finite difference solution.
*/
in_base.strain_rate[0] = SymmetricTensor<2,dim>();
in_base.strain_rate[0][0][0] = 1e-12;
Expand Down
2 changes: 1 addition & 1 deletion tests/entropy_initial_lookup_wb.wb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"features": [
{
"model": "oceanic plate",
"name": "Overiding plate",
"name": "Overriding plate",
"max depth": 150000.0,
"min depth": -100000.0,
"coordinates": [
Expand Down
Loading

0 comments on commit 002c0bf

Please sign in to comment.