commit
67c71e25e2
@ -0,0 +1,2 @@
|
||||
e69d8798c1580d7ca02715f11532efd1f163f987 SOURCES/matplotlib-3.9.4.tar.gz
|
||||
b34c3b5e5cc9163d1420a44d64407ff79643ec15 SOURCES/matplotlib-3.9.3-with-freetype-2.13.1.tar.gz
|
@ -0,0 +1,2 @@
|
||||
SOURCES/matplotlib-3.9.4.tar.gz
|
||||
SOURCES/matplotlib-3.9.3-with-freetype-2.13.1.tar.gz
|
@ -0,0 +1,43 @@
|
||||
From fde31cca645d54c6f019d4882b6fe4e71a6dc946 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Wed, 27 Sep 2017 19:35:59 -0400
|
||||
Subject: [PATCH 1/5] matplotlibrc path search fix
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/__init__.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
|
||||
index ad4676b11a..b925a4a703 100644
|
||||
--- a/lib/matplotlib/__init__.py
|
||||
+++ b/lib/matplotlib/__init__.py
|
||||
@@ -589,7 +589,8 @@ def get_cachedir():
|
||||
@_logged_cached('matplotlib data path: %s')
|
||||
def get_data_path():
|
||||
"""Return the path to Matplotlib data."""
|
||||
- return str(Path(__file__).with_name("mpl-data"))
|
||||
+ return str(Path(__file__).parent.parent.parent.parent.parent /
|
||||
+ 'share/matplotlib/mpl-data')
|
||||
|
||||
|
||||
def matplotlib_fname():
|
||||
@@ -609,6 +610,7 @@ def matplotlib_fname():
|
||||
is not defined)
|
||||
- On other platforms,
|
||||
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
|
||||
+ - ``/etc/matplotlibrc``
|
||||
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
|
||||
exist.
|
||||
"""
|
||||
@@ -627,6 +629,7 @@ def matplotlib_fname():
|
||||
yield matplotlibrc
|
||||
yield os.path.join(matplotlibrc, 'matplotlibrc')
|
||||
yield os.path.join(get_configdir(), 'matplotlibrc')
|
||||
+ yield '/etc/matplotlibrc'
|
||||
yield os.path.join(get_data_path(), 'matplotlibrc')
|
||||
|
||||
for fname in gen_candidates():
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 9421754530479435e21a98d2f549330899ed8d85 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 11 Aug 2023 02:36:06 -0400
|
||||
Subject: [PATCH 2/5] Unpin NumPy build requirement
|
||||
|
||||
This is so high simply to take advantage of the new
|
||||
backwards-compatibility guarantee in NumPy 1.25, but Fedora will never
|
||||
run against a version different from the one it was built against.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
pyproject.toml | 13 +------------
|
||||
1 file changed, 1 insertion(+), 12 deletions(-)
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index aa6aa23506..1894bbf3cd 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -76,18 +76,7 @@ requires = [
|
||||
"meson-python>=0.13.1,<0.17.0",
|
||||
"pybind11>=2.6,!=2.13.3",
|
||||
"setuptools_scm>=7",
|
||||
-
|
||||
- # Comments on numpy build requirement range:
|
||||
- #
|
||||
- # 1. >=2.0.x is the numpy requirement for wheel builds for distribution
|
||||
- # on PyPI - building against 2.x yields wheels that are also
|
||||
- # ABI-compatible with numpy 1.x at runtime.
|
||||
- # 2. Note that building against numpy 1.x works fine too - users and
|
||||
- # redistributors can do this by installing the numpy version they like
|
||||
- # and disabling build isolation.
|
||||
- # 3. The <2.3 upper bound is for matching the numpy deprecation policy,
|
||||
- # it should not be loosened.
|
||||
- "numpy>=2.0.0rc1,<2.3",
|
||||
+ "numpy",
|
||||
]
|
||||
|
||||
[tool.meson-python.args]
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,171 @@
|
||||
From 283c5005dbbbea1147e539075032d6ec43c88166 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 06:05:42 -0500
|
||||
Subject: [PATCH 3/5] Set FreeType version to 2.13.1 and update tolerances
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
extern/meson.build | 2 +-
|
||||
lib/matplotlib/__init__.py | 2 +-
|
||||
lib/matplotlib/tests/test_axes.py | 4 ++--
|
||||
lib/matplotlib/tests/test_backend_pgf.py | 2 +-
|
||||
lib/matplotlib/tests/test_constrainedlayout.py | 10 +++++-----
|
||||
lib/matplotlib/tests/test_legend.py | 4 ++--
|
||||
lib/matplotlib/tests/test_polar.py | 2 +-
|
||||
lib/matplotlib/tests/test_tightlayout.py | 10 +++++-----
|
||||
8 files changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/extern/meson.build b/extern/meson.build
|
||||
index 662feb7872..df42b908af 100644
|
||||
--- a/extern/meson.build
|
||||
+++ b/extern/meson.build
|
||||
@@ -14,7 +14,7 @@ else
|
||||
# must match the value in `lib/matplotlib.__init__.py`. Also update the docs
|
||||
# in `docs/devel/dependencies.rst`. Bump the cache key in
|
||||
# `.circleci/config.yml` when changing requirements.
|
||||
- LOCAL_FREETYPE_VERSION = '2.6.1'
|
||||
+ LOCAL_FREETYPE_VERSION = '2.13.1'
|
||||
|
||||
freetype_proj = subproject(
|
||||
f'freetype-@LOCAL_FREETYPE_VERSION@',
|
||||
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
|
||||
index b925a4a703..ec68e4932b 100644
|
||||
--- a/lib/matplotlib/__init__.py
|
||||
+++ b/lib/matplotlib/__init__.py
|
||||
@@ -1316,7 +1316,7 @@ def _val_or_rc(val, rc_name):
|
||||
def _init_tests():
|
||||
# The version of FreeType to install locally for running the tests. This must match
|
||||
# the value in `meson.build`.
|
||||
- LOCAL_FREETYPE_VERSION = '2.6.1'
|
||||
+ LOCAL_FREETYPE_VERSION = '2.13.1'
|
||||
|
||||
from matplotlib import ft2font
|
||||
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
|
||||
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
|
||||
index e99ef129eb..2355c82f62 100644
|
||||
--- a/lib/matplotlib/tests/test_axes.py
|
||||
+++ b/lib/matplotlib/tests/test_axes.py
|
||||
@@ -7765,7 +7765,7 @@ def test_normal_axes():
|
||||
]
|
||||
for nn, b in enumerate(bbaxis):
|
||||
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
|
||||
- assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2)
|
||||
+ assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=0)
|
||||
|
||||
target = [
|
||||
[150.0, 119.999, 930.0, 11.111],
|
||||
@@ -7783,7 +7783,7 @@ def test_normal_axes():
|
||||
|
||||
target = [85.5138, 75.88888, 1021.11, 1017.11]
|
||||
targetbb = mtransforms.Bbox.from_bounds(*target)
|
||||
- assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
|
||||
+ assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=0)
|
||||
|
||||
# test that get_position roundtrips to get_window_extent
|
||||
axbb = ax.get_position().transformed(fig.transFigure).bounds
|
||||
diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py
|
||||
index 8a83515f16..26bc9d6c48 100644
|
||||
--- a/lib/matplotlib/tests/test_backend_pgf.py
|
||||
+++ b/lib/matplotlib/tests/test_backend_pgf.py
|
||||
@@ -165,7 +165,7 @@ def test_pathclip():
|
||||
# test mixed mode rendering
|
||||
@needs_pgf_xelatex
|
||||
@pytest.mark.backend('pgf')
|
||||
-@image_comparison(['pgf_mixedmode.pdf'], style='default')
|
||||
+@image_comparison(['pgf_mixedmode.pdf'], style='default', tol=0.87)
|
||||
def test_mixedmode():
|
||||
mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False})
|
||||
Y, X = np.ogrid[-1:1:40j, -1:1:40j]
|
||||
diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
|
||||
index 4dc4d9501e..47a4e80bb5 100644
|
||||
--- a/lib/matplotlib/tests/test_constrainedlayout.py
|
||||
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
|
||||
@@ -435,7 +435,7 @@ def test_hidden_axes():
|
||||
extents1 = np.copy(axs[0, 0].get_position().extents)
|
||||
|
||||
np.testing.assert_allclose(
|
||||
- extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-5)
|
||||
+ extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-2)
|
||||
|
||||
|
||||
def test_colorbar_align():
|
||||
@@ -641,9 +641,9 @@ def test_compressed1():
|
||||
fig.draw_without_rendering()
|
||||
|
||||
pos = axs[0, 0].get_position()
|
||||
- np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-3)
|
||||
+ np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-2)
|
||||
pos = axs[0, 1].get_position()
|
||||
- np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-3)
|
||||
+ np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-2)
|
||||
|
||||
# wider than tall
|
||||
fig, axs = plt.subplots(2, 3, layout='compressed',
|
||||
@@ -656,10 +656,10 @@ def test_compressed1():
|
||||
|
||||
pos = axs[0, 0].get_position()
|
||||
np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
|
||||
- np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-3)
|
||||
+ np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-2)
|
||||
pos = axs[1, 2].get_position()
|
||||
np.testing.assert_allclose(pos.x1, 0.8618, atol=1e-3)
|
||||
- np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-3)
|
||||
+ np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-2)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('arg, state', [
|
||||
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
|
||||
index 3c2af27564..2b8709f934 100644
|
||||
--- a/lib/matplotlib/tests/test_legend.py
|
||||
+++ b/lib/matplotlib/tests/test_legend.py
|
||||
@@ -520,9 +520,9 @@ def test_figure_legend_outside():
|
||||
fig.draw_without_rendering()
|
||||
|
||||
assert_allclose(axs.get_window_extent().extents,
|
||||
- axbb[nn])
|
||||
+ axbb[nn], rtol=1)
|
||||
assert_allclose(leg.get_window_extent().extents,
|
||||
- legbb[nn])
|
||||
+ legbb[nn], rtol=1)
|
||||
|
||||
|
||||
@image_comparison(['legend_stackplot.png'],
|
||||
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
|
||||
index 6b3c08d2eb..5160112e37 100644
|
||||
--- a/lib/matplotlib/tests/test_polar.py
|
||||
+++ b/lib/matplotlib/tests/test_polar.py
|
||||
@@ -321,7 +321,7 @@ def test_get_tightbbox_polar():
|
||||
fig.canvas.draw()
|
||||
bb = ax.get_tightbbox(fig.canvas.get_renderer())
|
||||
assert_allclose(
|
||||
- bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1e-03)
|
||||
+ bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1)
|
||||
|
||||
|
||||
@check_figures_equal(extensions=["png"])
|
||||
diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
|
||||
index 9c654f4d1f..9678e34a80 100644
|
||||
--- a/lib/matplotlib/tests/test_tightlayout.py
|
||||
+++ b/lib/matplotlib/tests/test_tightlayout.py
|
||||
@@ -174,13 +174,13 @@ def test_outward_ticks():
|
||||
# These values were obtained after visual checking that they correspond
|
||||
# to a tight layouting that did take the ticks into account.
|
||||
expected = [
|
||||
- [[0.091, 0.607], [0.433, 0.933]],
|
||||
- [[0.579, 0.607], [0.922, 0.933]],
|
||||
- [[0.091, 0.140], [0.433, 0.466]],
|
||||
- [[0.579, 0.140], [0.922, 0.466]],
|
||||
+ [[0.09, 0.61], [0.43, 0.93]],
|
||||
+ [[0.58, 0.61], [0.92, 0.93]],
|
||||
+ [[0.09, 0.14], [0.43, 0.47]],
|
||||
+ [[0.58, 0.14], [0.92, 0.47]],
|
||||
]
|
||||
for nn, ax in enumerate(fig.axes):
|
||||
- assert_array_equal(np.round(ax.get_position().get_points(), 3),
|
||||
+ assert_array_equal(np.round(ax.get_position().get_points(), 2),
|
||||
expected[nn])
|
||||
|
||||
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,38 @@
|
||||
From b671c4141dc9692ce8745a4ddb9f6b0b14e5e70f Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 13 Dec 2024 02:03:33 -0500
|
||||
Subject: [PATCH 4/5] Unpin meson-python build requirement
|
||||
|
||||
This is pinned to fix sdists, but we already have one and are building a
|
||||
wheel, which should be fine.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
pyproject.toml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 1894bbf3cd..bdf2119f1b 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -48,7 +48,7 @@ requires-python = ">=3.9"
|
||||
[project.optional-dependencies]
|
||||
# Should be a copy of the build dependencies below.
|
||||
dev = [
|
||||
- "meson-python>=0.13.1,<0.17.0",
|
||||
+ "meson-python>=0.13.1",
|
||||
"numpy>=1.25",
|
||||
"pybind11>=2.6,!=2.13.3",
|
||||
"setuptools_scm>=7",
|
||||
@@ -73,7 +73,7 @@ dev = [
|
||||
build-backend = "mesonpy"
|
||||
# Also keep in sync with optional dependencies above.
|
||||
requires = [
|
||||
- "meson-python>=0.13.1,<0.17.0",
|
||||
+ "meson-python>=0.13.1",
|
||||
"pybind11>=2.6,!=2.13.3",
|
||||
"setuptools_scm>=7",
|
||||
"numpy",
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,84 @@
|
||||
From f6ecac5a3c02b32d66acd0fff41e1732d0939f60 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Mon, 22 Aug 2022 18:43:28 -0400
|
||||
Subject: [PATCH 5/5] Use old stride_windows implementation on 32-bit x86
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/mlab.py | 39 +++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 35 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py
|
||||
index e1f08c0da5..5c0d56c74d 100644
|
||||
--- a/lib/matplotlib/mlab.py
|
||||
+++ b/lib/matplotlib/mlab.py
|
||||
@@ -49,6 +49,7 @@ Spectral functions
|
||||
|
||||
import functools
|
||||
from numbers import Number
|
||||
+import sys
|
||||
|
||||
import numpy as np
|
||||
|
||||
@@ -210,6 +211,30 @@ def detrend_linear(y):
|
||||
return y - (b*x + a)
|
||||
|
||||
|
||||
+def _stride_windows(x, n, noverlap=0):
|
||||
+ if noverlap >= n:
|
||||
+ raise ValueError('noverlap must be less than n')
|
||||
+ if n < 1:
|
||||
+ raise ValueError('n cannot be less than 1')
|
||||
+
|
||||
+ x = np.asarray(x)
|
||||
+
|
||||
+ if n == 1 and noverlap == 0:
|
||||
+ return x[np.newaxis]
|
||||
+ if n > x.size:
|
||||
+ raise ValueError('n cannot be greater than the length of x')
|
||||
+
|
||||
+ # np.lib.stride_tricks.as_strided easily leads to memory corruption for
|
||||
+ # non integer shape and strides, i.e. noverlap or n. See #3845.
|
||||
+ noverlap = int(noverlap)
|
||||
+ n = int(n)
|
||||
+
|
||||
+ step = n - noverlap
|
||||
+ shape = (n, (x.shape[-1]-noverlap)//step)
|
||||
+ strides = (x.strides[0], step*x.strides[0])
|
||||
+ return np.lib.stride_tricks.as_strided(x, shape=shape, strides=strides)
|
||||
+
|
||||
+
|
||||
def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
|
||||
window=None, noverlap=None, pad_to=None,
|
||||
sides=None, scale_by_freq=None, mode=None):
|
||||
@@ -304,8 +329,11 @@ def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
|
||||
raise ValueError(
|
||||
"The window length must match the data's first dimension")
|
||||
|
||||
- result = np.lib.stride_tricks.sliding_window_view(
|
||||
- x, NFFT, axis=0)[::NFFT - noverlap].T
|
||||
+ if sys.maxsize > 2**32: # NumPy version on 32-bit OOMs.
|
||||
+ result = np.lib.stride_tricks.sliding_window_view(
|
||||
+ x, NFFT, axis=0)[::NFFT - noverlap].T
|
||||
+ else:
|
||||
+ result = _stride_windows(x, NFFT, noverlap=noverlap)
|
||||
result = detrend(result, detrend_func, axis=0)
|
||||
result = result * window.reshape((-1, 1))
|
||||
result = np.fft.fft(result, n=pad_to, axis=0)[:numFreqs, :]
|
||||
@@ -313,8 +341,11 @@ def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
|
||||
|
||||
if not same_data:
|
||||
# if same_data is False, mode must be 'psd'
|
||||
- resultY = np.lib.stride_tricks.sliding_window_view(
|
||||
- y, NFFT, axis=0)[::NFFT - noverlap].T
|
||||
+ if sys.maxsize > 2**32: # NumPy version on 32-bit OOMs.
|
||||
+ resultY = np.lib.stride_tricks.sliding_window_view(
|
||||
+ y, NFFT, axis=0)[::NFFT - noverlap].T
|
||||
+ else:
|
||||
+ resultY = _stride_windows(y, NFFT, noverlap=noverlap)
|
||||
resultY = detrend(resultY, detrend_func, axis=0)
|
||||
resultY = resultY * window.reshape((-1, 1))
|
||||
resultY = np.fft.fft(resultY, n=pad_to, axis=0)[:numFreqs, :]
|
||||
--
|
||||
2.47.0
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue