Skip to content

Commit 1247126

Browse files
authored
Merge pull request matplotlib#26978 from matplotlib/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents c8f0c06 + dc8fed7 commit 1247126

File tree

11 files changed

+38
-41
lines changed

11 files changed

+38
-41
lines changed

.github/workflows/cibuildwheel.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
# these wheels are also used for nightlies and NumPy 2.0 transition
100100
# requires using the NumPy 2.0 nightlies for compatibility.
101101
# If using all `--pre` releases creates issues, the NumPy wheel can be
102-
# istalled more targeted.
102+
# installed more targeted.
103103
CIBW_BUILD_FRONTEND: >-
104104
${{ (((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
105105
(github.event_name == 'pull_request' && github.base_ref == 'main')) &&

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude: |
1313
)
1414
repos:
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.4.0
16+
rev: v4.5.0
1717
hooks:
1818
- id: check-added-large-files
1919
- id: check-docstring-first
@@ -27,7 +27,7 @@ repos:
2727
- id: trailing-whitespace
2828
exclude_types: [svg]
2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.1.1
30+
rev: v1.8.0
3131
hooks:
3232
- id: mypy
3333
additional_dependencies: [
@@ -44,13 +44,13 @@ repos:
4444
files: lib/matplotlib #only run when files in lib/matplotlib are changed
4545
pass_filenames: false
4646
- repo: https://github.com/pycqa/flake8
47-
rev: 6.0.0
47+
rev: 6.1.0
4848
hooks:
4949
- id: flake8
5050
additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0, flake8-force]
5151
args: ["--docstring-convention=all"]
5252
- repo: https://github.com/codespell-project/codespell
53-
rev: v2.2.5
53+
rev: v2.2.6
5454
hooks:
5555
- id: codespell
5656
files: ^.*\.(py|c|cpp|h|m|md|rst|yml)$
@@ -61,7 +61,7 @@ repos:
6161
"doc/users/project/credits.rst"
6262
]
6363
- repo: https://github.com/pycqa/isort
64-
rev: 5.12.0
64+
rev: 5.13.2
6565
hooks:
6666
- id: isort
6767
name: isort (python)

ci/codespell-ignore-words.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
aas
2-
ans
32
axises
4-
ba
5-
cannotation
6-
ccompiler
73
coo
84
curvelinear
9-
dedented
10-
falsy
5+
filll
116
flate
127
fpt
138
hax
14-
hist
159
inh
1610
inout
1711
ment
1812
nd
13+
oint
1914
oly
20-
resizeable
2115
te
2216
thisy
2317
whis

lib/matplotlib/_mathtext.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -2672,25 +2672,27 @@ def _genset(self, s: str, loc: int, toks: ParseResults) -> T.Any:
26722672
thickness = self.get_state().get_current_underline_thickness()
26732673

26742674
annotation.shrink()
2675-
cannotation = HCentered([annotation])
2676-
cbody = HCentered([body])
2677-
width = max(cannotation.width, cbody.width)
2678-
cannotation.hpack(width, 'exactly')
2679-
cbody.hpack(width, 'exactly')
2675+
centered_annotation = HCentered([annotation])
2676+
centered_body = HCentered([body])
2677+
width = max(centered_annotation.width, centered_body.width)
2678+
centered_annotation.hpack(width, 'exactly')
2679+
centered_body.hpack(width, 'exactly')
26802680

26812681
vgap = thickness * 3
26822682
if s[loc + 1] == "u": # \underset
2683-
vlist = Vlist([cbody, # body
2684-
Vbox(0, vgap), # space
2685-
cannotation # annotation
2686-
])
2683+
vlist = Vlist([
2684+
centered_body, # body
2685+
Vbox(0, vgap), # space
2686+
centered_annotation # annotation
2687+
])
26872688
# Shift so the body sits in the same vertical position
2688-
vlist.shift_amount = cbody.depth + cannotation.height + vgap
2689+
vlist.shift_amount = centered_body.depth + centered_annotation.height + vgap
26892690
else: # \overset
2690-
vlist = Vlist([cannotation, # annotation
2691-
Vbox(0, vgap), # space
2692-
cbody # body
2693-
])
2691+
vlist = Vlist([
2692+
centered_annotation, # annotation
2693+
Vbox(0, vgap), # space
2694+
centered_body # body
2695+
])
26942696

26952697
# To add horizontal gap between symbols: wrap the Vlist into
26962698
# an Hlist and extend it with an Hbox(0, horizontal_gap)

lib/matplotlib/animation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ def func(current_frame: int, total_frames: int) -> Any
10321032
# Convert interval in ms to frames per second
10331033
fps = 1000. / self._interval
10341034

1035-
# Re-use the savefig DPI for ours if none is given
1035+
# Reuse the savefig DPI for ours if none is given.
10361036
dpi = mpl._val_or_rc(dpi, 'savefig.dpi')
10371037
if dpi == 'figure':
10381038
dpi = self._fig.dpi

lib/matplotlib/artist.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,8 @@ def axes(self):
299299
def axes(self, new_axes):
300300
if (new_axes is not None and self._axes is not None
301301
and new_axes != self._axes):
302-
raise ValueError("Can not reset the Axes. You are probably "
303-
"trying to re-use an artist in more than one "
304-
"Axes which is not supported")
302+
raise ValueError("Can not reset the Axes. You are probably trying to reuse "
303+
"an artist in more than one Axes which is not supported")
305304
self._axes = new_axes
306305
if new_axes is not None and new_axes is not self:
307306
self.stale_callback = _stale_axes_callback

lib/matplotlib/axes/_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6183,7 +6183,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
61836183
and *Y* should be the same as those of *C* (if not, a ValueError
61846184
will be raised). For ``'nearest'`` the color ``C[i, j]`` is
61856185
centered on ``(X[i, j], Y[i, j])``. For ``'gouraud'``, a smooth
6186-
interpolation is caried out between the quadrilateral corners.
6186+
interpolation is carried out between the quadrilateral corners.
61876187
61886188
If *X* and/or *Y* are 1-D arrays or column vectors they will be
61896189
expanded as needed into the appropriate 2D arrays, making a

lib/matplotlib/axes/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4632,7 +4632,7 @@ def _draw_rasterized(figure, artists, renderer):
46324632
shim class to be compatible with that decorator and then uses it to
46334633
rasterize the list of artists.
46344634
4635-
This is maybe too-clever, but allows us to re-use the same code that is
4635+
This is maybe too-clever, but allows us to reuse the same code that is
46364636
used on normal artists to participate in the "are we rasterizing"
46374637
accounting.
46384638

lib/matplotlib/pyplot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ def subplot(*args, **kwargs) -> Axes:
14391439
key = SubplotSpec._from_subplot_args(fig, args)
14401440

14411441
for ax in fig.axes:
1442-
# If we found an Axes at the position, we can re-use it if the user passed no
1442+
# If we found an Axes at the position, we can reuse it if the user passed no
14431443
# kwargs or if the Axes class and kwargs are identical.
14441444
if (ax.get_subplotspec() == key
14451445
and (kwargs == {}

lib/matplotlib/scale.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, axis):
5454
5555
Notes
5656
-----
57-
The following note is for scale implementors.
57+
The following note is for scale implementers.
5858
5959
For back-compatibility reasons, scales take an `~matplotlib.axis.Axis`
6060
object as first argument. However, this argument should not

lib/matplotlib/tests/test_tightlayout.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ def test_outward_ticks():
173173
plt.tight_layout()
174174
# These values were obtained after visual checking that they correspond
175175
# to a tight layouting that did take the ticks into account.
176-
ans = [[[0.091, 0.607], [0.433, 0.933]],
177-
[[0.579, 0.607], [0.922, 0.933]],
178-
[[0.091, 0.140], [0.433, 0.466]],
179-
[[0.579, 0.140], [0.922, 0.466]]]
176+
expected = [
177+
[[0.091, 0.607], [0.433, 0.933]],
178+
[[0.579, 0.607], [0.922, 0.933]],
179+
[[0.091, 0.140], [0.433, 0.466]],
180+
[[0.579, 0.140], [0.922, 0.466]],
181+
]
180182
for nn, ax in enumerate(fig.axes):
181183
assert_array_equal(np.round(ax.get_position().get_points(), 3),
182-
ans[nn])
184+
expected[nn])
183185

184186

185187
def add_offsetboxes(ax, size=10, margin=.1, color='black'):

0 commit comments

Comments
 (0)