Commit b0946178 authored by Philipp Arras's avatar Philipp Arras
Browse files

Remove is_endo again

parent fa08ba32
Pipeline #88285 canceled with stages
in 4 minutes and 23 seconds
......@@ -31,7 +31,7 @@ from .operators.linear_operator import LinearOperator
from .operators.operator import Operator
from .operators.scaling_operator import ScalingOperator
from .probing import StatCalculator
from .sugar import from_random, full, is_endo, is_fieldlike, is_operator
from .sugar import from_random, full, is_fieldlike, is_operator
from .utilities import myassert
__all__ = ["check_linear_operator", "check_operator", "assert_allclose", "minisanity"]
......@@ -38,7 +38,7 @@ from .plot import Plot
__all__ = ['PS_field', 'power_analyze', 'create_power_operator',
'create_harmonic_smoothing_operator', 'from_random',
'full', 'makeField',
'is_fieldlike', 'is_linearization', 'is_operator', 'is_endo',
'is_fieldlike', 'is_linearization', 'is_operator',
'makeDomain', 'get_signal_variance', 'makeOp', 'domain_union',
'get_default_codomain', 'single_plot', 'exec_time',
'calculate_position'] + list(pointwise.ptw_dict.keys())
......@@ -559,22 +559,3 @@ def is_fieldlike(obj):
:class:`~nifty7.linearization.Linearization` behave field-like.
return isinstance(obj, Operator) and obj.val is not None
def is_endo(obj):
"""Check if object is an endomorphic (linear) operator.
A simple `isinstance(obj, ift.EndomorphicOperator)` does not cover all
cases. One counter example would be an `ChainOperator` where the domain of
the first sub operator and target of the last sub operator coincide.
from .operators.endomorphic_operator import EndomorphicOperator
from .operators.linear_operator import LinearOperator
return isinstance(obj, EndomorphicOperator) or (
and isinstance(obj, LinearOperator)
and obj.domain ==
......@@ -85,16 +85,3 @@ def test_isinstance_helpers():
assert ift.is_operator(op)
assert not ift.is_operator(lin)
assert not ift.is_operator(fld)
assert ift.is_endo(op)
assert not ift.is_endo(lin)
assert not ift.is_endo(fld)
def test_isendo():
dom = ift.RGSpace(12, harmonic=True)
op = ift.FFTOperator(dom)
assert not ift.is_endo(op)
assert not ift.is_endo(op.inverse)
assert not ift.is_endo(op.adjoint)
assert ift.is_endo(op @ op.adjoint)
assert ift.is_endo(op @ op.inverse)
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