Remove unreachable code

This commit is contained in:
Ogi Moore 2021-04-25 20:25:58 -07:00
parent 38dccf8642
commit 7c48233bfa
9 changed files with 12 additions and 49 deletions

View File

@ -172,7 +172,6 @@ def _generateItemSvg(item, nodes=None, root=None, options={}):
## Generate SVG text for just this item (exclude its children; we'll handle them later)
tr = QtGui.QTransform()
if isinstance(item, QtGui.QGraphicsScene):
xmlStr = "<g>\n</g>\n"
doc = xml.parseString(xmlStr)

View File

@ -21,6 +21,7 @@ class FillBetweenItem(QtGui.QGraphicsPathItem):
self.updatePath()
def setBrush(self, *args, **kwds):
"""Change the fill brush. Acceps the same arguments as pg.mkBrush()"""
QtGui.QGraphicsPathItem.setBrush(self, fn.mkBrush(*args, **kwds))
def setPen(self, *args, **kwds):
@ -50,10 +51,6 @@ class FillBetweenItem(QtGui.QGraphicsPathItem):
self.setZValue(min(curve1.zValue(), curve2.zValue())-1)
self.curveChanged()
def setBrush(self, *args, **kwds):
"""Change the fill brush. Acceps the same arguments as pg.mkBrush()"""
QtGui.QGraphicsPathItem.setBrush(self, fn.mkBrush(*args, **kwds))
def curveChanged(self):
self.updatePath()

View File

@ -193,8 +193,3 @@ def test_zoom_ratio_with_limits_out_of_range():
assert viewRange[1][0] >= -5
assert viewRange[1][1] <= 5
assert viewWidth == 2 * viewHeight
if __name__ == "__main__":
setup_module(None)
test_zoom_ratio()

View File

@ -45,7 +45,7 @@ def reloadAll(prefix=None, debug=False):
failed = []
changed = []
ret = {}
for modName, mod in list(sys.modules.items()): ## don't use iteritems; size may change during reload
for modName, mod in list(sys.modules.items()):
if not inspect.ismodule(mod):
ret[modName] = (False, 'not a module')
continue
@ -331,10 +331,6 @@ if __name__ == '__main__':
btn = Btn()
except:
raise
print("Error; skipping Qt tests")
doQtTest = False
import os
if not os.path.isdir('test1'):

View File

@ -15,7 +15,13 @@ def test_Vector_init():
# separate values with 3 args
v = pg.Vector(0, 1, 2)
assert v.x() == 0
assert v.y() == 1
assert v.z() == 2
v = pg.Vector(0.0, 1.0, 2.0)
assert v.x() == 0
assert v.y() == 1
assert v.z() == 2
# all in a list
v = pg.Vector([0, 1])

View File

@ -98,19 +98,6 @@ def check_interpolateArray(order):
assert_array_almost_equal(r1, r2)
def test_subArray():
a = np.array([0, 0, 111, 112, 113, 0, 121, 122, 123, 0, 0, 0, 211, 212, 213, 0, 221, 222, 223, 0, 0, 0, 0])
b = pg.subArray(a, offset=2, shape=(2,2,3), stride=(10,4,1))
c = np.array([[[111,112,113], [121,122,123]], [[211,212,213], [221,222,223]]])
assert np.all(b == c)
# operate over first axis; broadcast over the rest
aa = np.vstack([a, a/100.]).T
cc = np.empty(c.shape + (2,))
cc[..., 0] = c
cc[..., 1] = c / 100.
bb = pg.subArray(aa, offset=2, shape=(2,2,3), stride=(10,4,1))
assert np.all(bb == cc)
def test_subArray():
a = np.array([0, 0, 111, 112, 113, 0, 121, 122, 123, 0, 0, 0, 211, 212, 213, 0, 221, 222, 223, 0, 0, 0, 0])

View File

@ -7,21 +7,6 @@ import pytest
pgpath = os.path.join(os.path.dirname(pg.__file__), '..')
pgpath_repr = repr(pgpath)
# make temporary directory to write module code
path = None
def setup_module():
# make temporary directory to write module code
global path
path = tempfile.mkdtemp()
sys.path.insert(0, path)
def teardown_module():
global path
shutil.rmtree(path)
sys.path.remove(path)
code = """
import sys
sys.path.append({path_repr})

View File

@ -229,8 +229,6 @@ class EnumColorMapItem(ptree.types.GroupParameter):
vals = opts.get('values', [])
if isinstance(vals, list):
vals = OrderedDict([(v,str(v)) for v in vals])
childs = [{'name': v, 'type': 'color'} for v in vals]
childs = []
for val,vname in vals.items():
ch = ptree.Parameter.create(name=vname, type='color')

View File

@ -81,7 +81,7 @@ class Build(build.build):
if os.path.isdir(buildPath):
distutils.dir_util.remove_tree(buildPath)
ret = build.build.run(self)
build.build.run(self)
class Install(install.install):