Commit bd3d61bc authored by Lukas Platz's avatar Lukas Platz
Browse files

fix OperatorAdapter.__repr__ index out of range

self._trafo \elem {1,2,3}. Therefore, either list needs to have
four items or should be accessed via [self._trafo - 1].
This way seem more readable to me.

Bug can be triggered by creating a FFTOperator `op` and calling
`print(op.inverse.adjoint)`.
parent 1deb0df3
...@@ -69,6 +69,6 @@ class OperatorAdapter(LinearOperator): ...@@ -69,6 +69,6 @@ class OperatorAdapter(LinearOperator):
def __repr__(self): def __repr__(self):
from ..utilities import indent from ..utilities import indent
mode = ["adjoint", "inverse", "adjoint inverse"][self._trafo] mode = ["invalid", "adjoint", "inverse", "adjoint inverse"][self._trafo]
res = "OperatorAdapter: {}\n".format(mode) res = "OperatorAdapter: {}\n".format(mode)
return res + indent(self._op.__repr__()) return res + indent(self._op.__repr__())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment