diff options
author | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-07-30 15:28:16 +0200 |
---|---|---|
committer | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-07-30 15:28:16 +0200 |
commit | 43155c03488ca98c24f8f369e5c8699efa20cca3 (patch) | |
tree | cf300323088576cbdbe0560a63150f52e25950ed /python/astra/optomo.py | |
parent | 004e25a7afe080bdaddb19e48e426672e6e73479 (diff) | |
download | astra-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/astra/optomo.py')
-rw-r--r-- | python/astra/optomo.py | 10 |
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: |