Skip to content

Commit 13121a5

Browse files
Merge pull request #862 from jarrodmillman/precommit-2-26
Update pre-commit repos
2 parents a7c3dc7 + 4dac5fa commit 13121a5

22 files changed

Lines changed: 10 additions & 59 deletions

File tree

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ d8966d848af75751823e825eb76c5bbff58f5c07
1010
1fd0ce6759be32be38bbfab32e83d157a82dfe25
1111
406488494019fb199474fea7f1694e9f0d0347bc
1212
968df447681ba7d33c9088d4446b8a92ec0a1389
13+
ed709e41bd10763dcb376a982dd1eb72b742ccc9

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
6+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: check-ast
@@ -19,27 +19,27 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/rbubley/mirrors-prettier
22-
rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3
22+
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
2323
hooks:
2424
- id: prettier
2525
files: \.(md|rst|yml|yaml)
2626
args: [--prose-wrap=preserve]
2727

2828
- repo: https://github.com/MarcoGorelli/cython-lint
29-
rev: 1ac5158c1b0f405350517c218f03d3a21bbb381c # frozen: v0.16.6
29+
rev: 7c6152f6c8f9087684ff2e09a9227941e233bafb # frozen: v0.19.0
3030
hooks:
3131
- id: cython-lint
3232
args: [--no-pycodestyle, --max-line-length=88]
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: e84319e627902e1b348574ecf3238dc511933dc7 # frozen: v0.11.7
35+
rev: 45ef068da5f21267bb2a7ec4a623092959f09ce5 # frozen: v0.14.14
3636
hooks:
3737
- id: ruff
3838
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
3939
- id: ruff-format
4040

4141
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: "f40886d54c729f533f864ed6ce584e920feb0af7" # frozen: v1.15.0
42+
rev: "a66e98df7b4aeeb3724184b332785976d062b92e" # frozen: v1.19.1
4343
hooks:
4444
- id: mypy
4545
additional_dependencies:

advanced/advanced_numpy/index.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ etc. for loading sound data...
330330
##### Casting
331331

332332
- Casting in arithmetic, in nutshell:
333-
334333
- only type (not value!) of operands matters
335334
- largest "safe" type able to represent both is picked
336335
- scalars can "lose" to arrays in some situations
@@ -1007,7 +1006,6 @@ x.strides, y.strides
10071006

10081007
- CPU pulls data from main memory to its cache in blocks
10091008
- If many array items consecutively operated on fit in a single block (small stride):
1010-
10111009
- $\Rightarrow$ fewer transfers needed
10121010
- $\Rightarrow$ faster
10131011

@@ -1671,13 +1669,11 @@ Get this tutorial: <https://www.euroscipy.org/talk/882>
16711669
### Reporting bugs
16721670

16731671
- Bug tracker (prefer **this**)
1674-
16751672
- <https://github.com/numpy/numpy/issues>
16761673
- <https://github.com/scipy/scipy/issues>
16771674
- Click the "Sign up" link to get an account
16781675

16791676
- Mailing lists (<https://numpy.org/community/>)
1680-
16811677
- If you're unsure
16821678
- No replies in a week or so? Just file a bug ticket.
16831679

@@ -1712,7 +1708,6 @@ I'm using NumPy 1.4.1, built from the official tarball, on Windows
17121708

17131709
0. What are you trying to do?
17141710
1. **Small code snippet reproducing the bug** (if possible)
1715-
17161711
- What actually happens
17171712
- What you'd expect
17181713

@@ -1736,17 +1731,14 @@ If unsure, try to remove existing NumPy installations, and reinstall...
17361731
### Contributing to documentation
17371732

17381733
1. Documentation editor
1739-
17401734
- <https://numpy.org/doc/stable/>
17411735

17421736
- Registration
1743-
17441737
- Register an account
17451738

17461739
- Subscribe to `scipy-dev` mailing list (subscribers-only)
17471740

17481741
- Problem with mailing lists: you get mail
1749-
17501742
- But: **you can turn mail delivery off**
17511743

17521744
- "change your subscription options", at the bottom of
@@ -1767,7 +1759,6 @@ If unsure, try to remove existing NumPy installations, and reinstall...
17671759
```
17681760
17691761
- Check the style guide:
1770-
17711762
- <https://numpy.org/doc/stable/>
17721763
- Don't be intimidated; to fix a small thing, just fix it
17731764
@@ -1784,21 +1775,16 @@ The contribution of features is documented on <https://numpy.org/doc/stable/dev/
17841775
### How to help, in general
17851776
17861777
- Bug fixes always welcome!
1787-
17881778
- What irks you most
17891779
- Browse the tracker
17901780
17911781
- Documentation work
1792-
17931782
- API docs: improvements to docstrings
1794-
17951783
- Know some SciPy module well?
17961784
17971785
- _User guide_
1798-
17991786
- <https://numpy.org/doc/stable/user/>
18001787
18011788
- Ask on communication channels:
1802-
18031789
- `numpy-discussion` list
18041790
- `scipy-dev` list

advanced/advanced_python/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,6 @@ the source of a program.
10281028
- <https://pypi.org/project/decorator>
10291029

10301030
- Bruce Eckel
1031-
10321031
- [Decorators I]: Introduction to Python Decorators
10331032
- [Python Decorators II]: Decorator Arguments
10341033
- [Python Decorators III]: A Decorator-Based Build System
@@ -1118,15 +1117,13 @@ used and it is most convenient to have the support built in. With each
11181117
release, Python provides support in more places:
11191118

11201119
- all file-like objects:
1121-
11221120
- `file` ➔ automatically closed
11231121
- `fileinput`, `tempfile`
11241122
- `bz2.BZ2File`, `gzip.GzipFile`,
11251123
`tarfile.TarFile`, `zipfile.ZipFile`
11261124
- `ftplib`, `nntplib` ➔ close connection
11271125

11281126
- locks
1129-
11301127
- `multiprocessing.RLock` ➔ lock and unlock
11311128
- `multiprocessing.Semaphore`
11321129
- `memoryview` ➔ automatically release
@@ -1140,7 +1137,6 @@ release, Python provides support in more places:
11401137
- `contextlib.closing` ➔ the same as the example above, call `close`
11411138

11421139
- parallel programming
1143-
11441140
- `concurrent.futures.ThreadPoolExecutor` ➔ invoke in parallel then kill thread pool
11451141
- `concurrent.futures.ProcessPoolExecutor` ➔ invoke in parallel then kill process pool
11461142
- `nogil` ➔ solve the GIL problem temporarily (cython only :( )

advanced/debugging/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ when you write it, how will you ever debug it?”_
4747
- Write your code with testing and debugging in mind.
4848

4949
- Keep It Simple, Stupid (KISS).
50-
5150
- What is the simplest thing that could possibly work?
5251

5352
- Don't Repeat Yourself (DRY).
54-
5553
- Every piece of knowledge must have a single, unambiguous,
5654
authoritative representation within a system.
5755
- Constants, algorithms, etc...
@@ -88,7 +86,6 @@ You can bind a key to run pyflakes in the current buffer.
8886

8987
- **In kate**
9088
Menu: 'settings -> configure kate
91-
9289
- In plugins enable 'external tools'
9390
- In external Tools', add `pyflakes`:
9491

@@ -143,9 +140,7 @@ You can bind a key to run pyflakes in the current buffer.
143140
#### A type-as-go spell-checker like integration
144141

145142
- **In vim**
146-
147143
- Use the pyflakes.vim plugin:
148-
149144
1. download the zip file from
150145
<https://www.vim.org/scripts/script.php?script_id=2441>
151146
2. extract the files in `~/.vim/ftplugin/python`
@@ -185,7 +180,6 @@ code, with short modify-run-fail cycles.**
185180

186181
2. Divide and Conquer. Once you have a failing test case, isolate the
187182
failing code.
188-
189183
- Which module.
190184
- Which function.
191185
- Which line of code.

advanced/interfacing_with_c/interfacing_with_c.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ interesting. If you have good ideas for exercises, please let us know!
854854
fragile and respond badly to input errors. Look for ways to crash the
855855
examples, figure what the problem is and devise a potential solution.
856856
Here are some ideas:
857-
858857
1. Numerical overflow.
859858
2. Input and output arrays that have different lengths.
860859
3. Multidimensional array.

advanced/mathematical_optimization/helper/compare_optimizers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def bencher(cost_name, ndim, method_name, x0):
6565

6666
# Bench with gradients
6767
def bencher_gradient(cost_name, ndim, method_name, x0):
68-
cost_function, cost_function_prime, hessian = mk_costs(ndim)[0][cost_name]
68+
cost_function, cost_function_prime, _hessian = mk_costs(ndim)[0][cost_name]
6969
method = methods[method_name]
7070
f_prime = CountingFunction(cost_function_prime)
7171
f = LoggingFunction(cost_function, counter=f_prime.counter)

advanced/mathematical_optimization/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ on which the search is performed.
9898
:doc: optimization_examples.md
9999
:::
100100
- - **A convex function**:
101-
102101
- $f$ is above all its tangents.
103102
- Equivalently, for two points $A, B$, $f(C)$ lies below the segment
104103
$[f(A), f(B])]$, if $A < C < B$.

advanced/optimizing/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def test():
1111
rng = np.random.default_rng()
1212
data = rng.random((5000, 100))
13-
u, s, v = sp.linalg.svd(data)
13+
u, _s, _v = sp.linalg.svd(data)
1414
pca = u[:, :10].T @ data
1515
results = fastica(pca.T, whiten=False)
1616

advanced/optimizing/demo_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def test():
1010
rng = np.random.default_rng()
1111
data = rng.random((5000, 100))
12-
u, s, v = sp.linalg.svd(data, full_matrices=False)
12+
u, _s, _v = sp.linalg.svd(data, full_matrices=False)
1313
pca = u[:, :10].T @ data
1414
results = fastica(pca.T, whiten=False)
1515

0 commit comments

Comments
 (0)