summaryrefslogtreecommitdiffstats
path: root/python/astra/utils.pyx
diff options
context:
space:
mode:
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)
-