summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-07-30 15:28:16 +0200
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-07-30 15:28:16 +0200
commit43155c03488ca98c24f8f369e5c8699efa20cca3 (patch)
treecf300323088576cbdbe0560a63150f52e25950ed /python
parent004e25a7afe080bdaddb19e48e426672e6e73479 (diff)
downloadastra-43155c03488ca98c24f8f369e5c8699efa20cca3.tar.gz
astra-43155c03488ca98c24f8f369e5c8699efa20cca3.tar.bz2
astra-43155c03488ca98c24f8f369e5c8699efa20cca3.tar.xz
astra-43155c03488ca98c24f8f369e5c8699efa20cca3.zip
Fix Python OpTomo for scipy 0.16
scipy 0.16 also uses .T to define a transpose, which conflicts with the old OpTomo implementation. OpTomo now also defines the _transpose() method, which .T will call in scipy 0.16.
Diffstat (limited to 'python')
-rw-r--r--python/astra/optomo.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/python/astra/optomo.py b/python/astra/optomo.py
index 0108674..19b07e3 100644
--- a/python/astra/optomo.py
+++ b/python/astra/optomo.py
@@ -86,7 +86,15 @@ class OpTomo(scipy.sparse.linalg.LinearOperator):
self.proj_id = proj_id
- self.T = OpTomoTranspose(self)
+ self.transposeOpTomo = OpTomoTranspose(self)
+ try:
+ self.T = self.transposeOpTomo
+ except AttributeError:
+ # Scipy >= 0.16 defines self.T using self._transpose()
+ pass
+
+ def _transpose(self):
+ return self.transposeOpTomo
def __checkArray(self, arr, shp):
if len(arr.shape)==1: