Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
matplotlib
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Python Team
packages
matplotlib
Commits
a15090b4
Commit
a15090b4
authored
2 years ago
by
Sandro Tosi
Browse files
Options
Downloads
Patches
Plain Diff
Fix argument checking in Axes3D.quiver; Closes: #1027285
parent
fc2674e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/changelog
+3
-1
3 additions, 1 deletion
debian/changelog
debian/patches/PR24862.patch
+144
-0
144 additions, 0 deletions
debian/patches/PR24862.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
148 additions
and
1 deletion
debian/changelog
+
3
−
1
View file @
a15090b4
...
...
@@ -3,8 +3,10 @@ matplotlib (3.6.2-4) UNRELEASED; urgency=medium
* debian/rules
- run dh_installdocs on the -data pkg, to unstall changelog;
Closes: #1027049
* debian/patches/PR24862.patch
- Fix argument checking in Axes3D.quiver; Closes: #1027285
-- Sandro Tosi <morph@debian.org> Thu, 05 Jan 2023
10:59
:3
3
-0500
-- Sandro Tosi <morph@debian.org> Thu, 05 Jan 2023
23:48
:3
1
-0500
matplotlib (3.6.2-3) unstable; urgency=medium
...
...
This diff is collapsed.
Click to expand it.
debian/patches/PR24862.patch
0 → 100644
+
144
−
0
View file @
a15090b4
From 8f0792cb9c8d80ff17d1f8f0500897f0e56e8fea Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Sun, 1 Jan 2023 14:55:41 +0100
Subject: [PATCH] Fix argument checking in Axes3D.quiver
---
lib/mpl_toolkits/mplot3d/axes3d.py | 45 ++++++++++++------------------
1 file changed, 18 insertions(+), 27 deletions(-)
--- a/lib/mpl_toolkits/mplot3d/axes3d.py
+++ b/lib/mpl_toolkits/mplot3d/axes3d.py
@@ -1372,7 +1372,7 @@
class Axes3D(Axes):
The lightsource to use when *shade* is True.
**kwargs
- Other arguments are forwarded to `.Poly3DCollection`.
+ Other keyword arguments are forwarded to `.Poly3DCollection`.
"""
had_data = self.has_data()
@@ -1620,7 +1620,7 @@
class Axes3D(Axes):
of the new default of ``rcount = ccount = 50``.
**kwargs
- Other arguments are forwarded to `.Line3DCollection`.
+ Other keyword arguments are forwarded to `.Line3DCollection`.
"""
had_data = self.has_data()
@@ -1747,7 +1747,7 @@
class Axes3D(Axes):
lightsource : `~matplotlib.colors.LightSource`
The lightsource to use when *shade* is True.
**kwargs
- All other arguments are passed on to
+ All other keyword arguments are passed on to
:class:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
Examples
@@ -2156,7 +2156,7 @@
class Axes3D(Axes):
data : indexable object, optional
DATA_PARAMETER_PLACEHOLDER
**kwargs
- All other arguments are passed on to `~.axes.Axes.scatter`.
+ All other keyword arguments are passed on to `~.axes.Axes.scatter`.
Returns
-------
@@ -2208,7 +2208,8 @@
class Axes3D(Axes):
data : indexable object, optional
DATA_PARAMETER_PLACEHOLDER
**kwargs
- Other arguments are forwarded to `matplotlib.axes.Axes.bar`.
+ Other keyword arguments are forwarded to
+ `matplotlib.axes.Axes.bar`.
Returns
-------
@@ -2417,19 +2418,16 @@
class Axes3D(Axes):
return ret
@_preprocess_data()
- def quiver(self, *args,
+ def quiver(self, X, Y, Z, U, V, W, *,
length=1, arrow_length_ratio=.3, pivot='tail', normalize=False,
**kwargs):
"""
- ax.quiver(X, Y, Z, U, V, W, /, length=1, arrow_length_ratio=.3, \
-pivot='tail', normalize=False, **kwargs)
-
Plot a 3D field of arrows.
- The arguments could be array-like or scalars, so long as they
- they can be broadcast together. The arguments can also be
- masked arrays. If an element in any of argument is masked, then
- that corresponding quiver element will not be plotted.
+ The arguments can be array-like or scalars, so long as they can be
+ broadcast together. The arguments can also be masked arrays. If an
+ element in any of argument is masked, then that corresponding quiver
+ element will not be plotted.
Parameters
----------
@@ -2459,7 +2457,7 @@
pivot='tail', normalize=False, **kwargs)
**kwargs
Any additional keyword arguments are delegated to
- :class:`~matplotlib.collections.LineCollection`
+ :class:`.Line3DCollection`
"""
def calc_arrows(UVW, angle=15):
@@ -2490,22 +2488,15 @@
pivot='tail', normalize=False, **kwargs)
had_data = self.has_data()
- # handle args
- argi = 6
- if len(args) < argi:
- raise ValueError('Wrong number of arguments. Expected %d got %d' %
- (argi, len(args)))
-
- # first 6 arguments are X, Y, Z, U, V, W
- input_args = args[:argi]
+ input_args = [X, Y, Z, U, V, W]
# extract the masks, if any
masks = [k.mask for k in input_args
if isinstance(k, np.ma.MaskedArray)]
# broadcast to match the shape
bcast = np.broadcast_arrays(*input_args, *masks)
- input_args = bcast[:argi]
- masks = bcast[argi:]
+ input_args = bcast[:6]
+ masks = bcast[6:]
if masks:
# combine the masks into one
mask = functools.reduce(np.logical_or, masks)
@@ -2517,7 +2508,7 @@
pivot='tail', normalize=False, **kwargs)
if any(len(v) == 0 for v in input_args):
# No quivers, so just make an empty collection and return early
- linec = art3d.Line3DCollection([], *args[argi:], **kwargs)
+ linec = art3d.Line3DCollection([], **kwargs)
self.add_collection(linec)
return linec
@@ -2531,7 +2522,7 @@
pivot='tail', normalize=False, **kwargs)
shaft_dt -= length / 2
XYZ = np.column_stack(input_args[:3])
- UVW = np.column_stack(input_args[3:argi]).astype(float)
+ UVW = np.column_stack(input_args[3:]).astype(float)
# Normalize rows of UVW
norm = np.linalg.norm(UVW, axis=1)
@@ -2560,7 +2551,7 @@
pivot='tail', normalize=False, **kwargs)
else:
lines = []
- linec = art3d.Line3DCollection(lines, *args[argi:], **kwargs)
+ linec = art3d.Line3DCollection(lines, **kwargs)
self.add_collection(linec)
self.auto_scale_xyz(XYZ[:, 0], XYZ[:, 1], XYZ[:, 2], had_data)
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
a15090b4
...
...
@@ -6,3 +6,4 @@
#0013-static-SHA.patch
0014-py3k-sphinx.patch
0015-disable-sphinx--W.patch
PR24862.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment