Commit 4fb64987 authored by Jeremy Sanders's avatar Jeremy Sanders

Removed numpy patch

parent dfd154b9
......@@ -4,6 +4,7 @@ veusz (3.0-1) unstable; urgency=low
* d/copyright: Update URLs
* d/control: Update descriptions
* d/control: Update standards version to 4.1.4
* d/patches: Removed 01-numpy-1.13.diff
-- Jeremy Sanders <jeremy@jeremysanders.net> Sat, 16 Jun 2018 10:48:00 +0200
......
commit 70447b7bc2dbd067b526569aa673f8f37407dc00
Author: Jeremy Sanders <jeremy@jeremysanders.net>
Date: Sat Sep 17 15:25:48 2016 +0200
Avoid None in list of numpy arrays
diff --git a/veusz/utils/utilfuncs.py b/veusz/utils/utilfuncs.py
index 836816d6..ffe429f8 100644
--- a/veusz/utils/utilfuncs.py
+++ b/veusz/utils/utilfuncs.py
@@ -591,3 +591,7 @@ def unescapeHDFDataName(name):
name = name.replace('`SL', '/')
name = name.replace('`BT', '`')
return name
+
+def allNotNone(*items):
+ """Are all the items not None."""
+ return not any((x is None for x in items))
diff --git a/veusz/widgets/axis.py b/veusz/widgets/axis.py
index 5ef52b4c..eac54dd9 100644
--- a/veusz/widgets/axis.py
+++ b/veusz/widgets/axis.py
@@ -750,7 +750,7 @@ class Axis(widget.Widget):
for plotter in plotters:
# get label and label coordinates from plotter (if any)
labels, coords = plotter.getAxisLabels(dir)
- if None not in (labels, coords):
+ if labels is not None and coords is not None:
# convert coordinates to plotter coordinates
pcoords = self._graphToPlotter(coords)
for coord, pcoord, lab in czip(coords, pcoords, labels):
diff --git a/veusz/widgets/point.py b/veusz/widgets/point.py
index 2763845b..59152c68 100644
--- a/veusz/widgets/point.py
+++ b/veusz/widgets/point.py
@@ -75,14 +75,14 @@
def _errorBarsBox(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
s, painter, clip):
"""Draw box around error region."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
painter.setBrush( qt4.QBrush() )
utils.plotBoxesToPainter(painter, xmin, ymin, xmax, ymax, clip)
def _errorBarsBoxFilled(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
s, painter, clip):
"""Draw box filled region inside error bars."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
# filled region below
if not s.FillBelow.hideerror:
path = qt4.QPainterPath()
@@ -102,7 +102,7 @@
def _errorBarsDiamond(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
s, painter, clip):
"""Draw diamond around error region."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
# expand clip by pen width (urgh)
pw = painter.pen().widthF()*2
@@ -119,7 +119,7 @@
def _errorBarsDiamondFilled(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
s, painter, clip):
"""Draw diamond filled region inside error bars."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
if not s.FillBelow.hideerror:
path = qt4.QPainterPath()
utils.addNumpyPolygonToPath(path, clip,
@@ -137,7 +137,7 @@
def _errorBarsCurve(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
s, painter, clip):
"""Draw curve around error region."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
# non-filling brush
painter.setBrush( qt4.QBrush() )
@@ -160,7 +160,7 @@
s, painter, clip):
"""Fill area around error region."""
- if None not in (xmin, xmax, ymin, ymax):
+ if utils.allNotNone(xmin, xmax, ymin, ymax):
for xp, yp, xmn, ymn, xmx, ymx in czip(
xplotter, yplotter, xmin, ymin, xmax, ymax):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment