From 5a51e6a5dd2d0a2c38c3cc72fcb5136a4f34c549 Mon Sep 17 00:00:00 2001 From: Victor Liu Date: Fri, 22 Nov 2024 21:22:36 -0500 Subject: [PATCH 1/8] converted ps to array before slicing --- lib/mpl_toolkits/mplot3d/art3d.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index 44585ccd05e7..9c98f13c6e43 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -1218,6 +1218,7 @@ def _generate_normals(polygons): v2 = np.empty((len(polygons), 3)) for poly_i, ps in enumerate(polygons): n = len(ps) + ps = np.asarray(ps) i1, i2, i3 = 0, n//3, 2*n//3 v1[poly_i, :] = ps[i1, :] - ps[i2, :] v2[poly_i, :] = ps[i2, :] - ps[i3, :] From bdf5514fb0c3ee49cbb1cdf66834dab7a2c58c46 Mon Sep 17 00:00:00 2001 From: Victor Liu Date: Sat, 23 Nov 2024 14:30:11 -0500 Subject: [PATCH 2/8] added test cases for the modification to art3d.py --- lib/mpl_toolkits/mplot3d/tests/test_art3d.py | 31 +++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py index 4ed48aae4685..bb791f68343e 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt from matplotlib.backend_bases import MouseEvent -from mpl_toolkits.mplot3d.art3d import Line3DCollection +from mpl_toolkits.mplot3d.art3d import Line3DCollection, Poly3DCollection def test_scatter_3d_projection_conservation(): @@ -54,3 +54,32 @@ def test_zordered_error(): ax.add_collection(Line3DCollection(lc)) ax.scatter(*pc, visible=False) plt.draw() + + +def test_generate_normals(): + + # Following code is an example taken from + # https://stackoverflow.com/questions/18897786/transparency-for-poly3dcollection-plot-in-matplotlib + # and modified to test _generate_normals function + + fig = plt.figure() + ax = fig.add_subplot(111, projection='3d') + + x = [0, 2, 1, 1] + y = [0, 0, 1, 0] + z = [0, 0, 0, 1] + + # deliberately use nested tuple + vertices = ((0, 1, 2), (0, 1, 3), (0, 2, 3), (1, 2, 3)) + + tupleList = list(zip(x, y, z)) + + poly3d = [[tupleList[vertices[ix][iy]] for iy in range(len(vertices[0]))] + for ix in range(len(vertices))] + ax.scatter(x, y, z) + collection = Poly3DCollection(poly3d, alpha=0.2, edgecolors='r', shade=True) + face_color = [0.5, 0.5, 1] # alternative: matplotlib.colors.rgb2hex([0.5, 0.5, 1]) + collection.set_facecolor(face_color) + ax.add_collection3d(collection) + + plt.draw() From 4d1e3d247c3e6986f18623abfb7e9d4b6e4f46b2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 30 Nov 2024 03:44:36 -0500 Subject: [PATCH 3/8] BLD: bump branch away from tag So the tarballs from GitHub are stable. From 1d7e71eafa2e9f22f605b0cd767165e38fb10a25 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 1 Dec 2024 00:42:34 -0500 Subject: [PATCH 4/8] DOC: Add Zenodo DOI for 3.9.3 --- doc/_static/zenodo_cache/14249941.svg | 35 +++++++++++++++++++++++++++ doc/project/citing.rst | 3 +++ tools/cache_zenodo_svg.py | 1 + 3 files changed, 39 insertions(+) create mode 100644 doc/_static/zenodo_cache/14249941.svg diff --git a/doc/_static/zenodo_cache/14249941.svg b/doc/_static/zenodo_cache/14249941.svg new file mode 100644 index 000000000000..f9165f17fdf0 --- /dev/null +++ b/doc/_static/zenodo_cache/14249941.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + DOI + + + DOI + + + 10.5281/zenodo.14249941 + + + 10.5281/zenodo.14249941 + + + \ No newline at end of file diff --git a/doc/project/citing.rst b/doc/project/citing.rst index 38c989fca195..544c899da4d2 100644 --- a/doc/project/citing.rst +++ b/doc/project/citing.rst @@ -32,6 +32,9 @@ By version .. START OF AUTOGENERATED +v3.9.3 + .. image:: ../_static/zenodo_cache/14249941.svg + :target: https://doi.org/10.5281/zenodo.14249941 v3.9.2 .. image:: ../_static/zenodo_cache/13308876.svg :target: https://doi.org/10.5281/zenodo.13308876 diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py index 40814d21573c..e1a5d3bcec48 100644 --- a/tools/cache_zenodo_svg.py +++ b/tools/cache_zenodo_svg.py @@ -63,6 +63,7 @@ def _get_xdg_cache_dir(): if __name__ == "__main__": data = { + "v3.9.3": "14249941", "v3.9.2": "13308876", "v3.9.1": "12652732", "v3.9.0": "11201097", From 6348165c649e8efb410582025534f73997661666 Mon Sep 17 00:00:00 2001 From: Victor Liu Date: Sat, 7 Dec 2024 15:39:07 -0500 Subject: [PATCH 5/8] modified test for _generate_normals --- lib/mpl_toolkits/mplot3d/tests/test_art3d.py | 30 ++++---------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py index bb791f68343e..04e756ed9499 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py @@ -57,29 +57,11 @@ def test_zordered_error(): def test_generate_normals(): - - # Following code is an example taken from - # https://stackoverflow.com/questions/18897786/transparency-for-poly3dcollection-plot-in-matplotlib - # and modified to test _generate_normals function + # Smoke test for https://github.com/matplotlib/matplotlib/issues/29156 + vertices = ((0, 0, 0), (0, 5, 0), (5, 5, 0), (5, 0, 0)) + shape = Poly3DCollection([vertices], edgecolors='r', shade=True) fig = plt.figure() - ax = fig.add_subplot(111, projection='3d') - - x = [0, 2, 1, 1] - y = [0, 0, 1, 0] - z = [0, 0, 0, 1] - - # deliberately use nested tuple - vertices = ((0, 1, 2), (0, 1, 3), (0, 2, 3), (1, 2, 3)) - - tupleList = list(zip(x, y, z)) - - poly3d = [[tupleList[vertices[ix][iy]] for iy in range(len(vertices[0]))] - for ix in range(len(vertices))] - ax.scatter(x, y, z) - collection = Poly3DCollection(poly3d, alpha=0.2, edgecolors='r', shade=True) - face_color = [0.5, 0.5, 1] # alternative: matplotlib.colors.rgb2hex([0.5, 0.5, 1]) - collection.set_facecolor(face_color) - ax.add_collection3d(collection) - - plt.draw() + ax = fig.add_subplot(projection='3d') + ax.add_collection3d(shape) + plt.show() From 3982428df4fed6cb0a6c6ee433e6b8a0d2933e7c Mon Sep 17 00:00:00 2001 From: Victor Liu Date: Sat, 7 Dec 2024 16:04:59 -0500 Subject: [PATCH 6/8] changed plot.show to plot.draw --- lib/mpl_toolkits/mplot3d/tests/test_art3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py index 04e756ed9499..4d33636a0b05 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py @@ -64,4 +64,4 @@ def test_generate_normals(): fig = plt.figure() ax = fig.add_subplot(projection='3d') ax.add_collection3d(shape) - plt.show() + plt.draw() From 9d3cc1ec1c68943932059a15ff199bdd6d458fc0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 12 Dec 2024 19:46:02 -0500 Subject: [PATCH 7/8] Backport PR #29295: BLD: Pin meson-python to <0.17.0 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0237c7df5c5..aa6aa2350627 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", + "meson-python>=0.13.1,<0.17.0", "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", + "meson-python>=0.13.1,<0.17.0", "pybind11>=2.6,!=2.13.3", "setuptools_scm>=7", From 69a98115f8bdaf0f3f615b062d3a380f01f017df Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 12 Dec 2024 23:29:02 -0500 Subject: [PATCH 8/8] REL: 3.9.4 This is the fourth bugfix release of the 3.9.x series. This release contains two bug-fixes: - Fix toolbar icons in GTK backend - Fix `Poly3DCollection` initialization with list of lists