Skip to content
Snippets Groups Projects
Commit ab0d57b4 authored by Gordian Edenhofer's avatar Gordian Edenhofer
Browse files

Define `log1p` and `expm1` as acting on OP-chains

Amend the operator section as well to make both functions also work on
chains of operators.
parent 05752fda
No related branches found
No related tags found
1 merge request!381Add log1p and expm1 to sugar.py and operator.py
Pipeline #64547 passed
......@@ -158,8 +158,8 @@ class Operator(metaclass=NiftyMeta):
return None, self
for f in ["sqrt", "exp", "log", "tanh", "sigmoid", 'sin', 'cos', 'tan',
'sinh', 'cosh', 'absolute', 'sinc', 'one_over', 'log10']:
for f in ["sqrt", "exp", "log", "sin", "cos", "tan", "sinh", "cosh", "tanh",
"sinc", "sigmoid", "absolute", "one_over", "log10", "log1p", "expm1"]:
def func(f):
def func2(self):
fa = _FunctionApplier(self.target, f)
......
......@@ -335,7 +335,7 @@ def test_emptydomain():
@pmp('dom', [ift.RGSpace((8,), harmonic=True), ()])
@pmp('func', [
"exp", "log", "sin", "cos", "tan", "sinh", "cosh", "sinc", "absolute",
"sign", "log10"
"sign", "log10", "log1p", "expm1"
])
def test_funcs(num, dom, func):
num = 5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment