From 7ceb7f76149ac588ad494c1b2839490c8353247c Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 23 Aug 2015 23:18:34 +0000 Subject: [PATCH] fixed problem when reading single label through data_readArray --- lib/damask/asciitable.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index adda4f623..30623d680 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -416,6 +416,7 @@ class ASCIItable(): ''' read whole data of all (given) labels as numpy array ''' + from collections import Iterable try: self.data_rewind() # try to wind back to start of data @@ -426,6 +427,8 @@ class ASCIItable(): use = None # use all columns (and keep labels intact) labels_missing = [] else: + if isinstance(labels, str) or not isinstance(labels, Iterable): # check whether labels are a list or single item + labels = [labels] indices = self.label_index(labels) # check requested labels ... dimensions = self.label_dimension(labels) # ... and remember their dimension present = np.where(indices >= 0)[0] # positions in request list of labels that are present ...