summaryrefslogtreecommitdiffstats
path: root/python/astra/utils.pyx
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-12-01 12:27:44 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-12-01 12:27:44 +0100
commitfff0e6dba508744f540bcf5efff76f676fe7af48 (patch)
tree5f33544e7d79b59501a5dd63a4922722eed8a98b /python/astra/utils.pyx
parent0d5947a0e8e7d6f86c7591a96d877dfe14b187e4 (diff)
parentdcfd15335549fa8e3e56260791cc4510331f7be6 (diff)
downloadastra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.gz
astra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.bz2
astra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.xz
astra-fff0e6dba508744f540bcf5efff76f676fe7af48.zip
Merge branch 'master' into python-plugins
Conflicts: python/astra/utils.pyx
Diffstat (limited to 'python/astra/utils.pyx')
-rw-r--r--python/astra/utils.pyx7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/astra/utils.pyx b/python/astra/utils.pyx
index 9d2e9ab..9871ac6 100644
--- a/python/astra/utils.pyx
+++ b/python/astra/utils.pyx
@@ -99,7 +99,8 @@ cdef void readDict(XMLNode root, _dc):
if val.size == 0:
break
listbase = root.addChildNode(item)
- data = <double*>np.PyArray_DATA(np.ascontiguousarray(val,dtype=np.float64))
+ contig_data = np.ascontiguousarray(val,dtype=np.float64)
+ data = <double*>np.PyArray_DATA(contig_data)
if val.ndim == 2:
listbase.setContent(data, val.shape[1], val.shape[0], False)
elif val.ndim == 1:
@@ -135,7 +136,8 @@ cdef void readOptions(XMLNode node, dc):
break
listbase = node.addChildNode(six.b('Option'))
listbase.addAttribute(< string > six.b('key'), < string > item)
- data = <double*>np.PyArray_DATA(np.ascontiguousarray(val,dtype=np.float64))
+ contig_data = np.ascontiguousarray(val,dtype=np.float64)
+ data = <double*>np.PyArray_DATA(contig_data)
if val.ndim == 2:
listbase.setContent(data, val.shape[1], val.shape[0], False)
elif val.ndim == 1:
@@ -147,4 +149,3 @@ cdef void readOptions(XMLNode node, dc):
cdef configToDict(Config *cfg):
return XMLNode2dict(cfg.self)
-