Skip to content

Commit

Permalink
Enable typos CI, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 23, 2024
1 parent 8f1959d commit d8d01ed
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
pipx install ruff
ruff check
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

pylint:
name: Pylint
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions contrib/maxima/maxwellrectcav3d.mac
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ psi_cand:E_0*sin(k_x*x)*sin(k_y*y);



wave_eqn(f, gam_s):=nabla_t_squared(f) + mu*epsilon*gam_s*f;
gam_s : gamma^2;
wave_eqn(f, gamma_s):=nabla_t_squared(f) + mu*epsilon*gamma_s*f;
gamma_s : gamma^2;

/* The _t indicates transverse components (i.e. x and y components only) */
/*
E_t(psi):=(-k_z/gam_s)*sin(k_z * z)* nabla_t(psi);
H_t(psi):=crossprod((%i * omega /gam_s)*cos(k_z * z)* [0,0,1], nabla_t(psi));
E_t(psi):=(-k_z/gamma_s)*sin(k_z * z)* nabla_t(psi);
H_t(psi):=crossprod((%i * omega /gamma_s)*cos(k_z * z)* [0,0,1], nabla_t(psi));
*/
E_t(psi):=(-k_z/gam_s)*sin(k_z * z)* nabla_t(psi);
H_t(psi):=crossprod((%i * omega * epsilon/gam_s)*cos(k_z * z)* [0,0,1], nabla_t(psi));
E_t(psi):=(-k_z/gamma_s)*sin(k_z * z)* nabla_t(psi);
H_t(psi):=crossprod((%i * omega * epsilon/gamma_s)*cos(k_z * z)* [0,0,1], nabla_t(psi));


/* These are used as the analytic solution for a rectangular cavity resonator
/* These are used as the analytic solution for a rectangular cavity resonator
with travsverse magnetic waves */

E : E_t(psi_cand) + [0,0,psi_cand * cos(k_z * z)];
Expand Down
2 changes: 1 addition & 1 deletion contrib/maxima/myhelpers.mac
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ hypdiagonalize(A):=block([evA, V, invV,D],
/* ------------------------------------------------------------------------- */
/* compute upwind flux for a given operator with eigenvalues evs, sorted
* in ascending order.
* Sign assumptions for all variables occuring in evs must be in place.
* Sign assumptions for all variables occurring in evs must be in place.
*/
/* ------------------------------------------------------------------------- */
hyp_upwind_flux(evs, D):=block([evvars, Dp, Dm, n, midstates, states, unknowns],
Expand Down
4 changes: 2 additions & 2 deletions contrib/maxima/wave.mac
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ wave_known_dirbdrywp:vstack([-n.wave_vm/2 + um/2 + ubc],

assert(norm_2_squared(fullhypsimp(wave_known_dirbdrywp - wave_dirbdrywp))=0);

print("Hom-dirichlet in characteristic:");
print("Homogeneous-dirichlet in characteristic:");
print(fullhypsimp(wave_invV.vstack(
-columnvector(first(wave_wmins)),
rest(wave_wmins))
));

print("Hom-Neumann in characteristic:");
print("Homogeneous-Neumann in characteristic:");
print(fullhypsimp(wave_invV.vstack(
columnvector(first(wave_wmins)),
-rest(wave_wmins))
Expand Down
4 changes: 2 additions & 2 deletions contrib/notes/dumka3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void dumka3(double& t, const double& tend, const double& h0,const double& atol,
stepOK = false;
f.isStepAccepted = false;
//long _size=y.size();
/* code for paraller exceution via OpemMP - you may want to use it
/* code for paraller execution via OpenMP - you may want to use it
#pragma parallel shared(y,z0,z2,z3) local(j)
#pragma pfor
*/
Expand All @@ -257,7 +257,7 @@ void dumka3(double& t, const double& tend, const double& h0,const double& atol,
//delete [] z;
};

/* norm1 - function isStepAccepted can use different norms, but we implemente "max=max|u_i|, i= 1..n" norm
/* norm1 - function isStepAccepted can use different norms, but we implemented "max=max|u_i|, i= 1..n" norm
* one can optimized this function by replacing qrt(z[i]*z[i]) to abs(z[i]), but you must define
* function abs for Element of the Vector
*/
Expand Down
6 changes: 3 additions & 3 deletions contrib/notes/hedge-notes.tm
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
<with|math-font-series|bold|N+Z+1>, \<ldots\>, n>> as anisotropic
(directionally-biased) unknowns with explicit connections to the
<math|<with|math-font-series|bold|s><rsup|\<asterisk\>(i)>> given by the
auxilliary equations
auxiliary equations

<\equation>
<tabular|<tformat|<table|<row|<cell|(D\<b-s\>)<rsup|*\<ast\>(i)> =
Expand Down Expand Up @@ -861,7 +861,7 @@
\;

You make the comment above that ``We simply regard
<math|(D\<b-s\>)<rsup|\<ast\>(k)>> as another unkown of the system, which,
<math|(D\<b-s\>)<rsup|\<ast\>(k)>> as another unknown of the system, which,
in addition to <math|{\<b-s\><rsup|*\<ast\>(i)>}<rsub|1><rsup|n-1>>, brings
us to <math|n> unknowns.''

Expand Down Expand Up @@ -1100,7 +1100,7 @@
</equation*>

where the unknowns are <math|\<nu\><rsub|1>> and <math|\<nu\><rsub|3>>.
Note that we *need* this equation to be satisifed independent of the
Note that we *need* this equation to be satisfied independent of the
unknowns <math|\<mu\><rsub|1><rsup|+>> and <math|\<mu\><rsub|3><rsup|->>,
which are dependent on the incoming waves
<math|<with|math-font-series|bold|u><rsup|\<pm\>>>, over which we have no
Expand Down
4 changes: 2 additions & 2 deletions doc/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Discontinuous Galerkin operators
.. automodule:: grudge.trace_pair


Transfering data between discretizations
========================================
Transferring data between discretizations
=========================================

.. automodule:: grudge.projection

Expand Down
4 changes: 2 additions & 2 deletions examples/wave/var-propagation-speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def norm(u):
u = fields[0]
v = fields[1:]
vis.write_vtk_file(
f"fld-var-propogation-speed-{step:04d}.vtu",
f"fld-var-propagation-speed-{step:04d}.vtu",
[
("u", u),
("v", v),
Expand All @@ -146,7 +146,7 @@ def norm(u):
actx.to_numpy(norm(event.state_component[0])))
if visualize:
vis.write_vtk_file(
f"fld-var-propogation-speed-{step:04d}.vtu",
f"fld-var-propagation-speed-{step:04d}.vtu",
[
("u", event.state_component[0]),
("v", event.state_component[1:]),
Expand Down
4 changes: 2 additions & 2 deletions grudge/dof_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
.. data:: DD_VOLUME_ALL
.. data:: DD_VOLUME_ALL_MODAL
Internal things that are visble due to type annotations
-------------------------------------------------------
Internal things that are visible due to type annotations
--------------------------------------------------------
.. class:: _DiscretizationTag
.. class:: ConvertibleToDOFDesc
Expand Down
2 changes: 1 addition & 1 deletion grudge/geometry/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def forward_metric_nth_derivative(
*, _use_geoderiv_connection=False) -> DOFArray:
r"""Pointwise metric derivatives representing repeated derivatives of the
physical coordinate enumerated by *xyz_axis*: :math:`x_{\mathrm{xyz\_axis}}`
with respect to the coordiantes on the reference element :math:`\xi_i`:
with respect to the coordinates on the reference element :math:`\xi_i`:
.. math::
Expand Down
2 changes: 1 addition & 1 deletion grudge/models/em.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def flux(self, wtpair):
epsilon = self.epsilon
mu = self.mu
else:
raise NotImplementedError("only fixed material spported for now")
raise NotImplementedError("only fixed material supported for now")

Z_int = (mu/epsilon)**0.5 # noqa: N806
Y_int = 1/Z_int # noqa: N806
Expand Down
2 changes: 1 addition & 1 deletion grudge/models/wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __init__(self, dcoll, c, source_f=None,
radiation_tag=BTAG_NONE):
"""
:arg c: a frozen :class:`~meshmode.dof_array.DOFArray`
representing the propogation speed of the wave.
representing the propagation speed of the wave.
"""
from arraycontext import get_container_context_recursively
assert get_container_context_recursively(c) is None
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,19 @@ lines-after-imports = 2
[tool.mypy]
python_version = "3.10"
warn_unused_ignores = true

[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
]

[tool.typos.default.extend-words]
# like n-dimensional
nd = "nd"

# like 'theorem'
thm = "thm"

[tool.typos.files]
extend-exclude = [
]

0 comments on commit d8d01ed

Please sign in to comment.