Skip to content

Commit

Permalink
Spellcheck (#399)
Browse files Browse the repository at this point in the history
* update spellings and rebind.
  • Loading branch information
lukeolson committed Dec 23, 2023
1 parent 0431f82 commit 13b126a
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 55 deletions.
13 changes: 13 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[default.extend-words]
preconditioner = "preconditioner"
MIS = "MIS"
Cleary = "Cleary"
ser = "ser"
[default.extend-identifiers]
[default]
extend-ignore-identifiers-re = [
"sort_2nd",
".*_fiter",
]
[type.cpp]
extend-glob = ["*.h"]
2 changes: 1 addition & 1 deletion docs/paper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def set_figure(fontsize=9, width=251.0, heightratio=None, height=None):
alternatively, '\message{Column width: \the\columnwidth}' will print to the log
\linewidth should be used in place of \columnwidth if the figure is used
within special enviroments (e.g. minipage)
within special environments (e.g. minipage)
https://matplotlib.org/stable/tutorials/introductory/customizing.html
https://scipy-cookbook.readthedocs.io/items/Matplotlib_LaTeX_Examples.html
Expand Down
2 changes: 1 addition & 1 deletion pyamg/aggregation/tests/test_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def test_prefilter(self):
assert_equal(ml_nofilter.levels[0].P.nnz
> ml_filter.levels[0].P.nnz, True)

# class TestSatisfyConstaints(TestCase):
# class TestSatisfyConstraints(TestCase):
# def test_scalar(self):
#
# U = bsr_matrix([[1,2],[2,1]], blocksize=(1,1))
Expand Down
4 changes: 2 additions & 2 deletions pyamg/amg_core/air.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void approx_ideal_restriction_pass1( I Rp[], const int Rp_size,
I nnz = 0;
Rp[0] = 0;

// Deterimine number of nonzeros in each row of R.
// Determine number of nonzeros in each row of R.
for (I row=0; row<Cpts_size; row++) {
I cpoint = Cpts[row];

Expand Down Expand Up @@ -288,7 +288,7 @@ void approx_ideal_restriction_pass2(const I Rp[], const int Rp_size,
std::vector<T> b0(size_N, 0);
for (I i=Rp[row]; i<ind; i++) {
// Search for indice in row of A. If indice not found, b0 has been
// intitialized to zero.
// initialized to zero.
for (I k=Ap[cpoint]; k<Ap[cpoint+1]; k++) {
if (Rj[i] == Aj[k]) {
b0[temp_b] = -Ax[k];
Expand Down
3 changes: 1 addition & 2 deletions pyamg/amg_core/air_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ PYBIND11_MODULE(air, m) {
Methods
-------
one_point_interpolation
sort_2nd
approx_ideal_restriction_pass1
approx_ideal_restriction_pass2
block_approx_ideal_restriction_pass2
Expand Down Expand Up @@ -322,7 +321,7 @@ Rx[] must be passed in initialized to zero.)pbdoc");
py::arg("Rp").noconvert(), py::arg("Rj").noconvert(), py::arg("Rx").noconvert(), py::arg("Ap").noconvert(), py::arg("Aj").noconvert(), py::arg("Ax").noconvert(), py::arg("Cp").noconvert(), py::arg("Cj").noconvert(), py::arg("Cx").noconvert(), py::arg("Cpts").noconvert(), py::arg("splitting").noconvert(), py::arg("blocksize"), py::arg("distance"), py::arg("use_gmres"), py::arg("maxiter"), py::arg("precondition"),
R"pbdoc(
Build column indices and data array for approximate ideal restriction
in CSR format.
in BSR format.
Parameters
----------
Expand Down
10 changes: 5 additions & 5 deletions pyamg/amg_core/evolution_strength.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ void apply_absolute_distance_filter(const I n_row,
* >>> indices = array([0,1,2,0,1,2,0,1,2])
* >>> data = array([1.,2.,3.,4.,1.,2.,3.,9.,1.])
* >>> S = csr_matrix( (data,indices,indptr), shape=(3,3) )
* >>> print "Matrix BEfore Applying Filter\n" + str(S.todense())
* >>> print "Matrix before Applying Filter\n" + str(S.todense())
* >>> apply_distance_filter(3, 1.9, S.indptr, S.indices, S.data)
* >>> print "Matrix AFter Applying Filter\n" + str(S.todense())
* >>> print "Matrix after Applying Filter\n" + str(S.todense())
*/
template<class I, class T>
void apply_distance_filter(const I n_row,
Expand Down Expand Up @@ -207,10 +207,10 @@ void apply_distance_filter(const I n_row,
* >>> data = round(10*rand(6,2,2), decimals=1)
* >>> S = bsr_matrix( (data,col,row), shape=(6,6) )
* >>> T = zeros(data.shape[0])
* >>> print "Matrix BEfore\n" + str(S.todense())
* >>> print "Matrix before\n" + str(S.todense())
* >>> min_blocks(6, 4, ravel(S.data), T)
* >>> S2 = csr_matrix((T, S.indices, S.indptr), shape=(3,3))
* >>> print "Matrix AFter\n" + str(S2.todense())
* >>> print "Matrix after\n" + str(S2.todense())
*/
template<class I, class T>
void min_blocks(const I n_blocks,
Expand Down Expand Up @@ -541,7 +541,7 @@ void evolution_strength_helper( T Sx[], const int Sx_size,


/* For use in incomplete_mat_mult_csr(...)
* Calcuate <A_{row,:}, B_{:, col}>
* Calculate <A_{row,:}, B_{:, col}>
*
* Parameters
* ----------
Expand Down
8 changes: 4 additions & 4 deletions pyamg/amg_core/evolution_strength_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ Examples
>>> indices = array([0,1,2,0,1,2,0,1,2])
>>> data = array([1.,2.,3.,4.,1.,2.,3.,9.,1.])
>>> S = csr_matrix( (data,indices,indptr), shape=(3,3) )
>>> print "Matrix BEfore Applying Filter\n" + str(S.todense())
>>> print "Matrix before Applying Filter\n" + str(S.todense())
>>> apply_distance_filter(3, 1.9, S.indptr, S.indices, S.data)
>>> print "Matrix AFter Applying Filter\n" + str(S.todense()))pbdoc");
>>> print "Matrix after Applying Filter\n" + str(S.todense()))pbdoc");

m.def("min_blocks", &_min_blocks<int, float>,
py::arg("n_blocks"), py::arg("blocksize"), py::arg("Sx").noconvert(), py::arg("Tx").noconvert());
Expand Down Expand Up @@ -333,10 +333,10 @@ Examples
>>> data = round(10*rand(6,2,2), decimals=1)
>>> S = bsr_matrix( (data,col,row), shape=(6,6) )
>>> T = zeros(data.shape[0])
>>> print "Matrix BEfore\n" + str(S.todense())
>>> print "Matrix before\n" + str(S.todense())
>>> min_blocks(6, 4, ravel(S.data), T)
>>> S2 = csr_matrix((T, S.indices, S.indptr), shape=(3,3))
>>> print "Matrix AFter\n" + str(S2.todense()))pbdoc");
>>> print "Matrix after\n" + str(S2.todense()))pbdoc");

m.def("evolution_strength_helper", &_evolution_strength_helper<int, float, float>,
py::arg("Sx").noconvert(), py::arg("Sp").noconvert(), py::arg("Sj").noconvert(), py::arg("nrows"), py::arg("x").noconvert(), py::arg("y").noconvert(), py::arg("b").noconvert(), py::arg("BDBCols"), py::arg("NullDim"), py::arg("tol"));
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/graph-todo.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
check for non-negative weigths in A
check for non-negative weights in A

tests:
- 6 node undirected, unit length
Expand Down
8 changes: 4 additions & 4 deletions pyamg/amg_core/linalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ void csc_scale_rows(const I n_row,
* num_rows : int
* number of rows in A
* theta : float
* stength of connection tolerance
* strength of connection tolerance
* Ap : array
* CSR row pointer
* Aj : array
Expand Down Expand Up @@ -1176,7 +1176,7 @@ std::vector<T> QR(T A[],
const I &n,
const I is_col_major)
{
// Funciton pointer for row or column major matrices
// Function pointer for row or column major matrices
I (*get_ind)(const I, const I, const I);
const I *C;
if (is_col_major) {
Expand Down Expand Up @@ -1429,7 +1429,7 @@ void lower_tri_solve(const T L[],
* Returns
* -------
* x : vector<double>
* Solution to constrained least sqaures problem.
* Solution to constrained least squares problem.
*
* Notes
* -----
Expand Down Expand Up @@ -1458,7 +1458,7 @@ void least_squares(T A[],
// Take QR of A
std::vector<T> Q = QR(A,m,n,is_col_major);

// Multiply right hand side, b:= Q^T*b. Have to make new vetor, rhs.
// Multiply right hand side, b:= Q^T*b. Have to make new vector, rhs.
std::vector<T> rhs(m,0);
for (I i=0; i<m; i++) {
for (I k=0; k<m; k++) {
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/linalg_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Parameters
num_rows : int
number of rows in A
theta : float
stength of connection tolerance
strength of connection tolerance
Ap : array
CSR row pointer
Aj : array
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/relaxation.h
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ void gauss_seidel_nr(const I Ap[], const int Ap_size,
* omega : float
* damping parameter
* blocksize int
* dimension of sqare blocks in BSR matrix A
* dimension of square blocks in BSR matrix A
*/
template<class I, class T, class F>
void block_jacobi(const I Ap[], const int Ap_size,
Expand Down
4 changes: 2 additions & 2 deletions pyamg/amg_core/relaxation_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ x is modified inplace in an additive, not overwriting fashion
Notes
-----
Primary calling routine is gass_seidel_ne in relaxation.py)pbdoc");
Primary calling routine is gauss_seidel_ne in relaxation.py)pbdoc");

m.def("gauss_seidel_nr", &_gauss_seidel_nr<int, float, float>,
py::arg("Ap").noconvert(), py::arg("Aj").noconvert(), py::arg("Ax").noconvert(), py::arg("x").noconvert(), py::arg("z").noconvert(), py::arg("col_start"), py::arg("col_stop"), py::arg("col_step"), py::arg("Tx").noconvert(), py::arg("omega"));
Expand Down Expand Up @@ -1132,7 +1132,7 @@ row_step : int
omega : float
damping parameter
blocksize int
dimension of sqare blocks in BSR matrix A)pbdoc");
dimension of square blocks in BSR matrix A)pbdoc");

m.def("block_jacobi_indexed", &_block_jacobi_indexed<int, float, float>,
py::arg("Ap").noconvert(), py::arg("Aj").noconvert(), py::arg("Ax").noconvert(), py::arg("x").noconvert(), py::arg("b").noconvert(), py::arg("Tx").noconvert(), py::arg("indices").noconvert(), py::arg("omega").noconvert(), py::arg("blocksize"));
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/ruge_stuben.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* num_rows : int
* number of rows in A
* theta : float
* stength of connection tolerance
* strength of connection tolerance
* Ap : array
* CSR row pointer
* Aj : array
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/ruge_stuben_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Parameters
num_rows : int
number of rows in A
theta : float
stength of connection tolerance
strength of connection tolerance
Ap : array
CSR row pointer
Aj : array
Expand Down
4 changes: 2 additions & 2 deletions pyamg/amg_core/smoothed_aggregation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* num_rows : int
* number of rows in A
* theta : float
* stength of connection tolerance
* strength of connection tolerance
* Ap : array
* CSR row pointer
* Aj : array
Expand Down Expand Up @@ -1034,7 +1034,7 @@ void incomplete_mat_mult_bsr(const I Ap[], const int Ap_size,

/* Swap x[i] and x[j], and
* y[i] and y[j]
* Use in the qsort_twoarrays funcion
* Use in the qsort_twoarrays function
*/
template<class I, class T>
inline void swap(T x[], I y[], I i, I j )
Expand Down
2 changes: 1 addition & 1 deletion pyamg/amg_core/smoothed_aggregation_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Parameters
num_rows : int
number of rows in A
theta : float
stength of connection tolerance
strength of connection tolerance
Ap : array
CSR row pointer
Aj : array
Expand Down
2 changes: 1 addition & 1 deletion pyamg/blackbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def make_csr(A):


def solver_configuration(A, B=None, verb=True):
"""Generate a dictionary of SA parameters for an arbitray matrix A.
"""Generate a dictionary of SA parameters for an arbitrary matrix A.
Parameters
----------
Expand Down
10 changes: 5 additions & 5 deletions pyamg/gallery/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def generate_quadratic(V, E, return_edges=False):
ne2 x 6 list of vertices
Edges : ndarray
ned x 2 list of edges where the midpoint is generated
nedge x 2 list of edges where the midpoint is generated
Notes
-----
- midpoints are introduced and globally numbered at the end of the vertex list
- the element list includes the new list beteen v0-v1, v1-v2, and v2-v0
- the element list includes the new list between v0-v1, v1-v2, and v2-v0
Examples
--------
Expand Down Expand Up @@ -277,7 +277,7 @@ def refine2dtri(V, E, marked_elements=None):


def l2norm(u, mesh):
"""Calculate the L2 norm of a funciton on mesh (V,E).
"""Calculate the L2 norm of a function on mesh (V,E).
Parameters
----------
Expand Down Expand Up @@ -393,7 +393,7 @@ class Mesh:
"""Simple mesh object that holds vertices and mesh functions."""

# pylint: disable=too-many-instance-attributes
# This is reasonble for this class
# This is reasonable for this class

def __init__(self, V, E, degree=1):
"""Initialize mesh.
Expand Down Expand Up @@ -897,7 +897,7 @@ def applybc(A, b, mesh, bc):
c['var'] = 0

# now extend the BC
# for each new id, are the orignal neighboring ids in a bc?
# for each new id, are the original neighboring ids in a bc?
for c in bc:
if c['degree'] == 2:
idx = c['id']
Expand Down
2 changes: 1 addition & 1 deletion pyamg/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def pseudo_peripheral_node(A):
Returns
-------
x : int
Locaiton of the node
Location of the node
order : array
BFS ordering
level : array
Expand Down
2 changes: 1 addition & 1 deletion pyamg/krylov/_gmres_householder.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def gmres_householder(A, b, x0=None, tol=1e-5,
update = np.zeros(x.shape, dtype=x.dtype)
# for j in range(inner,-1,-1):
# update[j] += y[j]
# # Apply j-th reflector, (I - 2.0*w_j*w_j.T)*upadate
# # Apply j-th reflector, (I - 2.0*w_j*w_j.T)*update
# update -= 2.0*dot(conjugate(W[j,:]), update)*W[j,:]
amg_core.householder_hornerscheme(update, np.ravel(W), np.ravel(y),
n, inner, -1, -1)
Expand Down
6 changes: 3 additions & 3 deletions pyamg/multilevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class level(Level): # noqa: N801
def __init__(self):
"""Raise deprecation warning on use, not import."""
super().__init__()
warn('level() is deprectated. use Level()',
warn('level() is deprecated. use Level()',
category=DeprecationWarning, stacklevel=2)

def __init__(self, levels, coarse_solver='pinv'):
Expand Down Expand Up @@ -444,7 +444,7 @@ def solve(self, b, x0=None, tol=1e-5, maxiter=100, cycle='V', accel=None,
'detected, due to presmoother/postsmoother combination. '
'CG requires SPD preconditioner, not just SPD matrix.')

# Check for AMLI compatability
# Check for AMLI compatibility
if (accel != 'fgmres') and (cycle == 'AMLI'):
raise ValueError('AMLI cycles require acceleration (accel) '
'to be fgmres, or no acceleration')
Expand Down Expand Up @@ -792,5 +792,5 @@ class multilevel_solver(MultilevelSolver): # noqa: N801
def __init__(self, *args, **kwargs):
"""Raise deprecation warning on use, not import."""
super().__init__(*args, **kwargs)
warn('multilevel_solver is deprectated. use MultilevelSolver()',
warn('multilevel_solver is deprecated. use MultilevelSolver()',
category=DeprecationWarning, stacklevel=2)
2 changes: 1 addition & 1 deletion pyamg/relaxation/smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def matrix_asformat(lvl, name, format, blocksize=None):
setattr(lvl, desired_matrix, M)
elif M.format == format and format == 'bsr':
# convert to bsr with the right blocksize
# tobsr() will not do anything extra if this is uneeded
# tobsr() will not do anything extra if this is unneeded
setattr(lvl, desired_matrix, M.tobsr(blocksize=blocksize))
else:
# convert
Expand Down
2 changes: 1 addition & 1 deletion pyamg/relaxation/tests/test_relaxation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ def gold(A, x, b, blocksize, sweep):
assert_almost_equal(x, gold(A, x_copy, b, blocksize, 'symmetric'),
decimal=4)

# check for aggreement between gauss_seidel and block gauss-seidel
# check for agreement between gauss_seidel and block gauss-seidel
# with blocksize=1
A = poisson((4, 5), format='csr')
b = np.random.rand(A.shape[0])
Expand Down
Loading

0 comments on commit 13b126a

Please sign in to comment.