metaarray import fix for flowchart/Filters

This commit is contained in:
Luke Campagnola 2012-06-18 17:48:33 -04:00
parent 16c4e2929f
commit a90d00a536

View File

@ -8,11 +8,7 @@ from . import functions
from .common import * from .common import *
import numpy as np import numpy as np
try: import pyqtgraph.metaarray as metaarray
import metaarray
HAVE_METAARRAY = True
except:
HAVE_METAARRAY = False
class Downsample(CtrlNode): class Downsample(CtrlNode):
@ -145,11 +141,11 @@ class Derivative(CtrlNode):
nodeName = 'DerivativeFilter' nodeName = 'DerivativeFilter'
def processData(self, data): def processData(self, data):
if HAVE_METAARRAY and (hasattr(data, 'implements') and data.implements('MetaArray')): if hasattr(data, 'implements') and data.implements('MetaArray'):
info = data.infoCopy() info = data.infoCopy()
if 'values' in info[0]: if 'values' in info[0]:
info[0]['values'] = info[0]['values'][:-1] info[0]['values'] = info[0]['values'][:-1]
return MetaArray(data[1:] - data[:-1], info=info) return metaarray.MetaArray(data[1:] - data[:-1], info=info)
else: else:
return data[1:] - data[:-1] return data[1:] - data[:-1]