From 5a21d595385c148c919d355d2570553ef338e36b Mon Sep 17 00:00:00 2001 From: Chadwick Boulay Date: Sun, 24 Apr 2016 13:31:32 -0400 Subject: [PATCH] A few small style changes to MetaArray.py --- pyqtgraph/metaarray/MetaArray.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyqtgraph/metaarray/MetaArray.py b/pyqtgraph/metaarray/MetaArray.py index 9045e3eb..66ecc460 100644 --- a/pyqtgraph/metaarray/MetaArray.py +++ b/pyqtgraph/metaarray/MetaArray.py @@ -152,7 +152,7 @@ class MetaArray(object): if self._data is None: return else: - self._info = [{} for i in range(self.ndim+1)] + self._info = [{} for i in range(self.ndim + 1)] return else: try: @@ -175,16 +175,16 @@ class MetaArray(object): elif type(info[i]['values']) is not np.ndarray: raise Exception("Axis values must be specified as list or ndarray") if info[i]['values'].ndim != 1 or info[i]['values'].shape[0] != self.shape[i]: - raise Exception("Values array for axis %d has incorrect shape. (given %s, but should be %s)" %\ + raise Exception("Values array for axis %d has incorrect shape. (given %s, but should be %s)" % (i, str(info[i]['values'].shape), str((self.shape[i],)))) if i < self.ndim and 'cols' in info[i]: if not isinstance(info[i]['cols'], list): info[i]['cols'] = list(info[i]['cols']) if len(info[i]['cols']) != self.shape[i]: - raise Exception('Length of column list for axis %d does not match data. (given %d, but should be %d)' %\ + raise Exception('Length of column list for axis %d does not match data. (given %d, but should be %d)' % (i, len(info[i]['cols']), self.shape[i])) self._info = info - + def implements(self, name=None): ## Rather than isinstance(obj, MetaArray) use object.implements('MetaArray') if name is None: @@ -647,7 +647,7 @@ class MetaArray(object): if len(axs) > maxl: maxl = len(axs) - for i in range(min(self.ndim, len(self._info)-1)): + for i in range(min(self.ndim, len(self._info) - 1)): ax = self._info[i] axs = titles[i] axs += '%s[%d] :' % (' ' * (maxl - len(axs) + 5 - len(str(self.shape[i]))), self.shape[i]) @@ -657,11 +657,11 @@ class MetaArray(object): axs += " values: [%g" % (v0) if self.shape[i] > 1: v1 = ax['values'][-1] - axs += " ... %g] (step %g)" % (v1, (v1-v0)/(self.shape[i]-1)) + axs += " ... %g] (step %g)" % (v1, (v1 - v0) / (self.shape[i] - 1)) else: axs += "]" else: - axs+= " values: []" + axs += " values: []" if 'cols' in ax: axs += " columns: " colstrs = []