Skip to content

Commit c3249ad

Browse files
authored
Nick/link check (#359)
* Internal: Try new link checker * Internal: Add codespell and fix typos. * Internal: See if codespell precommit finds config. * Internal: Found config. Now enable reading it Closes #358
1 parent 589239b commit c3249ad

31 files changed

+114
-64
lines changed

.github/workflows/markdown-check.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
markdown-link-check:
10+
check-links:
11+
name: runner / linkspector
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v4
14-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
14+
- uses: actions/checkout@v4
15+
- name: Run linkspector
16+
uses: umbrelladocs/action-linkspector@v1
17+
with:
18+
github_token: ${{ secrets.github_token }}
19+
reporter: github-pr-review
20+
fail_on_error: true

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ repos:
1313
--extra-keys=metadata.language_info metadata.vscode metadata.kernelspec cell.metadata.vscode,
1414
--drop-empty-cells
1515
]
16+
- repo: https://github.com/codespell-project/codespell
17+
rev: v2.3.0
18+
hooks:
19+
- id: codespell
20+
args: [ --toml, "pyproject.toml"]
21+
additional_dependencies:
22+
- tomli

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- Aligning comparison operator output for data classes (https://github.com/sandialabs/pyttb/pull/331)
1313
- Improved:
1414
- Getting starting documentation (https://github.com/sandialabs/pyttb/pull/324)
15-
- Development enviroment (https://github.com/sandialabs/pyttb/pull/329, https://github.com/sandialabs/pyttb/pull/330)
15+
- Development environment (https://github.com/sandialabs/pyttb/pull/329, https://github.com/sandialabs/pyttb/pull/330)
1616
- Documentation (https://github.com/sandialabs/pyttb/pull/328, https://github.com/sandialabs/pyttb/pull/334)
1717

1818
# v1.8.0 (2024-10-23)
@@ -93,7 +93,7 @@
9393
- Addresses ambiguity of -0 by using `exclude_dims` (`numpy.ndarray`) parameter
9494
- `ktensor.ttv`, `sptensor.ttv`, `tensor.ttv`, `ttensor.ttv`
9595
- Use `exlude_dims` parameter instead of `-dims`
96-
- Explicit nameing of dimensions to exclude
96+
- Explicit naming of dimensions to exclude
9797
- `tensor.ttsv`
9898
- Use `skip_dim` (`int`) parameter instead of `-dims`
9999
- Exclude all dimensions up to and including `skip_dim`

CONTRIBUTING.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,25 @@ current or filing a new [issue](https://github.com/sandialabs/pyttb/issues).
3535
```
3636
git checkout -b my-new-feature-branch
3737
```
38-
1. Formatters and linting
38+
1. Formatters and linting (These are checked in the full test suite as well)
3939
1. Run autoformatters and linting from root of project (they will change your code)
40-
```commandline
41-
ruff check . --fix
42-
ruff format
43-
```
40+
```commandline
41+
ruff check . --fix
42+
ruff format
43+
```
4444
1. Ruff's `--fix` won't necessarily address everything and may point out issues that need manual attention
4545
1. [We](./.pre-commit-config.yaml) optionally support [pre-commit hooks](https://pre-commit.com/) for this
4646
1. Alternatively, you can run `pre-commit run --all-files` from the command line if you don't want to install the hooks.
4747
1. Check typing
4848
```commandline
4949
mypy pyttb/
5050
```
51+
1. Not included in our pre-commit hooks because of slow runtime.
52+
1. Check spelling
53+
```commandline
54+
codespell
55+
```
56+
1. This is also included in the optional pre-commit hooks.
5157
5258
1. Run tests (at desired fidelity)
5359
1. Just doctests (enabled by default)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ low-rank tensor decompositions:
3232
[`cp_apr`](https://pyttb.readthedocs.io/en/stable/cpapr.html "CP decomposition via Alternating Poisson Regression"),
3333
[`gcp_opt`](https://pyttb.readthedocs.io/en/stable/gcpopt.html "Generalized CP decomposition"),
3434
[`hosvd`](https://pyttb.readthedocs.io/en/stable/hosvd.html "Tucker decomposition via Higher Order Singular Value Decomposition"),
35-
[`tucker_als`](https://pyttb.readthedocs.io/en/stable/tuckerals.html "Tucker decompostion via Alternating Least Squares")
35+
[`tucker_als`](https://pyttb.readthedocs.io/en/stable/tuckerals.html "Tucker decomposition via Alternating Least Squares")
3636

3737
## Quick Start
3838

docs/source/tutorial/algorithm_cp_als.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"cell_type": "markdown",
123123
"metadata": {},
124124
"source": [
125-
"## Increase the maximium number of iterations\n",
125+
"## Increase the maximum number of iterations\n",
126126
"Note that the previous run kicked out at only 10 iterations, before reaching the specified convegence tolerance. Let's increase the maximum number of iterations and try again, using the same initial guess."
127127
]
128128
},
@@ -337,7 +337,7 @@
337337
"source": [
338338
"## Recommendations\n",
339339
"* Run multiple times with different guesses and select the solution with the best fit.\n",
340-
"* Try different ranks and choose the solution that is the best descriptor for your data based on the combination of the fit and the interpretaton of the factors, e.g., by visualizing the results."
340+
"* Try different ranks and choose the solution that is the best descriptor for your data based on the combination of the fit and the interpretation of the factors, e.g., by visualizing the results."
341341
]
342342
}
343343
],

docs/source/tutorial/algorithm_gcp_opt.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"tags": []
2020
},
2121
"source": [
22-
"This document outlines usage and examples for the generalized CP (GCP) tensor decomposition implmented in `pyttb.gcp_opt`. GCP allows alternate objective functions besides sum of squared errors, which is the standard for CP. The code support both dense and sparse input tensors, but the sparse input tensors require randomized optimization methods.\n",
22+
"This document outlines usage and examples for the generalized CP (GCP) tensor decomposition implemented in `pyttb.gcp_opt`. GCP allows alternate objective functions besides sum of squared errors, which is the standard for CP. The code support both dense and sparse input tensors, but the sparse input tensors require randomized optimization methods.\n",
2323
"\n",
2424
"GCP is described in greater detail in the manuscripts:\n",
2525
"* D. Hong, T. G. Kolda, J. A. Duersch, Generalized Canonical Polyadic Tensor Decomposition, SIAM Review, 62:133-163, 2020, https://doi.org/10.1137/18M1203626\n",

docs/source/tutorial/algorithm_hosvd.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"metadata": {},
9595
"source": [
9696
"## Generate a core with different accuracies for different shapes\n",
97-
"We will create a core `tensor` that has is nearly block diagonal. The blocks are expontentially decreasing in norm, with the idea that we can pick off one block at a time as we increate the prescribed accuracy of the HOSVD. To do this, we define and use a function `tenrandblk()`."
97+
"We will create a core `tensor` that has is nearly block diagonal. The blocks are expontentially decreasing in norm, with the idea that we can pick off one block at a time as we increase the prescribed accuracy of the HOSVD. To do this, we define and use a function `tenrandblk()`."
9898
]
9999
},
100100
{

docs/source/tutorial/class_sptensor.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"metadata": {},
1818
"source": [
1919
"## Creating a `sptensor`\n",
20-
"The `sptensor` class stores the data in coordinate format. A sparse `sptensor` can be created by passing in a list of subscripts and values. For example, here we pass in three subscripts and a scalar value. The resuling sparse `sptensor` has three nonzero entries, and the `shape` is the size of the largest subscript in each dimension."
20+
"The `sptensor` class stores the data in coordinate format. A sparse `sptensor` can be created by passing in a list of subscripts and values. For example, here we pass in three subscripts and a scalar value. The resulting sparse `sptensor` has three nonzero entries, and the `shape` is the size of the largest subscript in each dimension."
2121
]
2222
},
2323
{

docs/source/tutorial/class_sumtensor.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"metadata": {},
5555
"source": [
5656
"## Creating sumtensors\n",
57-
"A sumtensor `T` can only be delared as a sum of same-shaped tensors T1, T2,...,TN. The summand tensors are stored internally, which define the \"parts\" of the `sumtensor`. The parts of a `sumtensor` can be (dense) tensors (`tensor`), sparse tensors (` sptensor`), Kruskal tensors (`ktensor`), or Tucker tensors (`ttensor`). An example of the use of the sumtensor constructor follows."
57+
"A sumtensor `T` can only be declared as a sum of same-shaped tensors T1, T2,...,TN. The summand tensors are stored internally, which define the \"parts\" of the `sumtensor`. The parts of a `sumtensor` can be (dense) tensors (`tensor`), sparse tensors (` sptensor`), Kruskal tensors (`ktensor`), or Tucker tensors (`ttensor`). An example of the use of the sumtensor constructor follows."
5858
]
5959
},
6060
{

0 commit comments

Comments
 (0)