summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-07-10 00:30:23 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-07-23 11:57:16 +0200
commitf79f072b9bbc5719fbfa3d5c75e886a2bbb7f1ce (patch)
treef0d205a5cb1b6b074b77c6c9593431dc5f517b31
parentc4d227e4d8fd8809fb3c3bded5540cc1e82746ef (diff)
downloadastra-f79f072b9bbc5719fbfa3d5c75e886a2bbb7f1ce.tar.gz
astra-f79f072b9bbc5719fbfa3d5c75e886a2bbb7f1ce.tar.bz2
astra-f79f072b9bbc5719fbfa3d5c75e886a2bbb7f1ce.tar.xz
astra-f79f072b9bbc5719fbfa3d5c75e886a2bbb7f1ce.zip
Also allow tuples to be passed in a config dict
-rw-r--r--python/astra/utils.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/astra/utils.pyx b/python/astra/utils.pyx
index 08ee67b..9d2e9ab 100644
--- a/python/astra/utils.pyx
+++ b/python/astra/utils.pyx
@@ -93,7 +93,7 @@ cdef void readDict(XMLNode root, _dc):
dc = convert_item(_dc)
for item in dc:
val = dc[item]
- if isinstance(val, list):
+ if isinstance(val, list) or isinstance(val, tuple):
val = np.array(val,dtype=np.float64)
if isinstance(val, np.ndarray):
if val.size == 0:
@@ -128,7 +128,7 @@ cdef void readOptions(XMLNode node, dc):
val = dc[item]
if node.hasOption(item):
raise Exception('Duplicate Option: %s' % item)
- if isinstance(val, list):
+ if isinstance(val, list) or isinstance(val, tuple):
val = np.array(val,dtype=np.float64)
if isinstance(val, np.ndarray):
if val.size == 0: