Commit 15693c86 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'add_repr_strings' into 'NIFTy_6'

__repr__ methods for _FunctionApplier, _Amplitude and _LognormalMomentMatching

See merge request !520
parents 533fcc7e 42413ccc
Pipeline #75817 passed with stages
in 14 minutes and 49 seconds
......@@ -129,6 +129,7 @@ class _LognormalMomentMatching(Operator):
op = _normal(logmean, logsig, key, N_copies).ptw("exp")
self._domain, self._target = op.domain, op.target
self.apply = op.apply
self._repr_str = f"_LognormalMomentMatching: " + op.__repr__()
@property
def mean(self):
......@@ -138,6 +139,9 @@ class _LognormalMomentMatching(Operator):
def std(self):
return self._sig
def __repr__(self):
return self._repr_str
class _SlopeRemover(EndomorphicOperator):
def __init__(self, domain, space=0):
......@@ -346,11 +350,15 @@ class _Amplitude(Operator):
self.apply = op.apply
self._domain, self._target = op.domain, op.target
self._space = space
self._repr_str = "_Amplitude: " + op.__repr__()
@property
def fluctuation_amplitude(self):
return self._fluc
def __repr__(self):
return self._repr_str
class CorrelatedFieldMaker:
"""Constrution helper for hirarchical correlated field models.
......
......@@ -362,6 +362,9 @@ class _FunctionApplier(Operator):
self._check_input(x)
return x.ptw(self._funcname, *self._args, **self._kwargs)
def __repr__(self):
return f"_FunctionApplier ('{self._funcname}')"
class _CombinedOperator(Operator):
def __init__(self, ops, _callingfrommake=False):
......
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