8000 Merge remote-tracking branch 'upstream/main' into doc-install-check · matplotlib/matplotlib@f5c3053 · GitHub
[go: up one dir, main page]

Skip to content

Commit f5c3053

Browse files
committed
Merge remote-tracking branch 'upstream/main' into doc-install-check
2 parents 646e4b1 + 868004b commit f5c3053

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ jobs:
313313
314314
- name: Filter C coverage
315315
run: |
316-
lcov --capture --directory . --output-file coverage.info
317-
lcov --output-file coverage.info \
316+
lcov --rc lcov_branch_coverage=1 --capture --directory . --output-file coverage.info
317+
lcov --rc lcov_branch_coverage=1 --output-file coverage.info \
318318
--extract coverage.info $PWD/src/'*' $PWD/lib/'*'
319-
lcov --list coverage.info
319+
lcov --rc lcov_branch_coverage=1 --list coverage.info
320320
find . -name '*.gc*' -delete
321321
if: ${{ runner.os != 'macOS' }}
322322
- name: Upload code coverage

doc/devel/dependencies.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ reference.
2525
* `packaging <https://pypi.org/project/packaging/>`_ (>= 20.0)
2626
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 8.0)
2727
* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)
28-
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
29-
* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)
3028
* `importlib-resources <https://pypi.org/project/importlib-resources/>`_
3129
(>= 3.2.0; only required on Python < 3.10)
3230

@@ -228,6 +226,9 @@ Setup dependencies
228226
- `certifi <https://pypi.org/project/certifi/>`_ (>= 2020.06.20). Used while
229227
downloading the freetype and QHull source during build. This is not a
230228
runtime dependency.
229+
- `PyBind11 <https://pypi.org/project/pybind11/>`_ (>= 2.6). Used to connect C/C++ code
230+
with Python.
231+
- `setuptools <https://pypi.org/project/setuptools/>`_ (>= 42).
231232
- `setuptools_scm <https://pypi.org/project/setuptools-scm/>`_ (>= 7). Used to
232233
update the reported ``mpl.__version__`` based on the current git commit.
233234
Also a runtime dependency for editable installs.

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ def test_pcolorargs():
14791479
ax.pcolormesh(x, y, Z[:-1, :-1], shading="gouraud")
14801480
with pytest.raises(TypeError):
14811481
ax.pcolormesh(X, Y, Z[:-1, :-1], shading="gouraud")
1482-
x[0] = np.NaN
1482+
x[0] = np.nan
14831483
with pytest.raises(ValueError):
14841484
ax.pcolormesh(x, y, Z[:-1, :-1])
14851485
with np.errstate(invalid='ignore'):
@@ -7411,7 +7411,7 @@ def test_limits_after_scroll_zoom():
74117411
def test_gettightbbox_ignore_nan():
74127412
fig, ax = plt.subplots()
74137413
remove_ticks_and_titles(fig)
7414-
ax.text(np.NaN, 1, 'Boo')
7414+
ax.text(np.nan, 1, 'Boo')
74157415
renderer = fig.canvas.get_renderer()
74167416
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 496)
74177417

@@ -8591,7 +8591,7 @@ def test_bar_leading_nan():
85918591
barheights = np.array([0.5, 1.5, 2.0])
85928592
barstarts = np.array([0.77]*3)
85938593

8594-
barx[0] = np.NaN
8594+
barx[0] = np.nan
85958595

85968596
fig, ax = plt.subplots()
85978597

lib/matplotlib/tests/test_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_BoundaryNorm():
339339

340340
# Masked arrays
341341
boundaries = [0, 1.1, 2.2]
342-
vals = np.ma.masked_invalid([-1., np.NaN, 0, 1.4, 9])
342+
vals = np.ma.masked_invalid([-1., np.nan, 0, 1.4, 9])
343343

344344
# Without interpolation
345345
ncolors = len(boundaries) - 1
@@ -353,9 +353,9 @@ def test_BoundaryNorm():
353353
assert_array_equal(bn(vals), expected)
354354

355355
# Non-trivial masked arrays
356-
vals = np.ma.masked_invalid([np.Inf, np.NaN])
356+
vals = np.m 6D4E a.masked_invalid([np.inf, np.nan])
357357
assert np.all(bn(vals).mask)
358-
vals = np.ma.masked_invalid([np.Inf])
358+
vals = np.ma.masked_invalid([np.inf])
359359
assert np.all(bn(vals).mask)
360360

361361
# Incompatible extend and clip

lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ def test_rgba_antialias():
13761376
aa[:, int(N/2):] = a[:, int(N/2):]
13771377

13781378
# set some over/unders and NaNs
1379-
aa[20:50, 20:50] = np.NaN
1379+
aa[20:50, 20:50] = np.nan
13801380
aa[70:90, 70:90] = 1e6
13811381
aa[70:90, 20:30] = -1e6
13821382
aa[70:90, 195:215] = 1e6

lib/matplotlib/text.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,19 @@ def _reset_visual_defaults(
193193

194194
def update(self, kwargs):
195195
# docstring inherited
196+
ret = []
196197
kwargs = cbook.normalize_kwargs(kwargs, Text)
197198
sentinel = object() # bbox can be None, so use another sentinel.
198199
# Update fontproperties first, as it has lowest priority.
199200
fontproperties = kwargs.pop("fontproperties", sentinel)
200201
if fontproperties is not sentinel:
201-
self.set_fontproperties(fontproperties)
202+
ret.append(self.set_fontproperties(fontproperties))
202203
# Update bbox last, as it depends on font properties.
203204
bbox = kwargs.pop("bbox", sentinel)
204-
super().update(kwargs)
205+
ret.extend(super().update(kwargs))
205206
if bbox is not sentinel:
206-
self.set_bbox(bbox)
207+
ret.append(self.set_bbox(bbox))
208+
return ret
207209

208210
def __getstate__(self):
209211
d = super().__getstate__()

lib/matplotlib/text.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Text(Artist):
4343
antialiased: bool | None = ...,
4444
**kwargs
4545
) -> None: ...
46-
def update(self, kwargs: dict[str, Any]) -> None: ...
46+
def update(self, kwargs: dict[str, Any]) -> list[Any]: ...
4747
def get_rotation(self) -> float: ...
4848
def get_transform_rotates_text(self) -> bool: ...
4949
def set_rotation_mode(self, m: None | Literal["default", "anchor"]) -> None: ...

0 commit comments

Comments
 (0)
0