From ab0d57b4c6dd28a0f705a9a5a2fcf85feb88a006 Mon Sep 17 00:00:00 2001
From: Gordian Edenhofer <gordian.edenhofer@gmail.com>
Date: Tue, 19 Nov 2019 14:13:33 +0100
Subject: [PATCH] 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.
---
 nifty6/operators/operator.py | 4 ++--
 test/test_field.py           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/nifty6/operators/operator.py b/nifty6/operators/operator.py
index 90b88f784..4790da315 100644
--- a/nifty6/operators/operator.py
+++ b/nifty6/operators/operator.py
@@ -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)
diff --git a/test/test_field.py b/test/test_field.py
index ac0fe753b..9f95a311f 100644
--- a/test/test_field.py
+++ b/test/test_field.py
@@ -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
-- 
GitLab