From 067817dc1ab4fe9c5d67ecc0573abc264e47cc06 Mon Sep 17 00:00:00 2001
From: Martin Reinecke <martin@mpa-garching.mpg.de>
Date: Wed, 2 Jun 2021 09:49:13 +0200
Subject: [PATCH] tweaks

---
 src/domains/rg_space.py           | 9 ++++-----
 test/test_spaces/test_rg_space.py | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/domains/rg_space.py b/src/domains/rg_space.py
index c6e1c54d8..142297b61 100644
--- a/src/domains/rg_space.py
+++ b/src/domains/rg_space.py
@@ -11,7 +11,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-# Copyright(C) 2013-2020 Max-Planck-Society
+# Copyright(C) 2013-2021 Max-Planck-Society
 #
 # NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
 
@@ -77,6 +77,8 @@ class RGSpace(StructuredDomain):
                 if self._harmonic:
                     temp = 1. / (np.array(self._shape) * temp)
                 self._rdistances = tuple(temp)
+        self._hdistances = tuple(
+            1. / (np.array(self.shape)*np.array(self._rdistances)))
         if min(self._rdistances) <= 0:
             raise ValueError('Non-positive distances encountered')
 
@@ -220,7 +222,4 @@ class RGSpace(StructuredDomain):
         The n-th entry of the tuple is the distance between neighboring
         grid points along the n-th dimension.
         """
-        if self._harmonic:
-            return tuple(1. / (np.array(self.shape)*np.array(self._rdistances)))
-        else:
-            return self._rdistances
+        return self._hdistances if self._harmonic else self._rdistances
diff --git a/test/test_spaces/test_rg_space.py b/test/test_spaces/test_rg_space.py
index a1ec8302e..126a26958 100644
--- a/test/test_spaces/test_rg_space.py
+++ b/test/test_spaces/test_rg_space.py
@@ -11,7 +11,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-# Copyright(C) 2013-2019 Max-Planck-Society
+# Copyright(C) 2013-2021 Max-Planck-Society
 #
 # NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
 
-- 
GitLab