From 4d1be3006e96dab48c1a2eaa4542b761416e926f Mon Sep 17 00:00:00 2001
From: Martin Reinecke <martin@mpa-garching.mpg.de>
Date: Thu, 14 Sep 2017 13:22:49 +0200
Subject: [PATCH] work around a limitation of numpy 1.11

---
 nifty2go/random.py | 8 +++++---
 setup.py           | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/nifty2go/random.py b/nifty2go/random.py
index 5ead56b42..277b19831 100644
--- a/nifty2go/random.py
+++ b/nifty2go/random.py
@@ -35,11 +35,13 @@ class Random(object):
     def normal(dtype, shape, mean=0., std=1.):
         if issubclass(dtype, (complex, np.complexfloating)):
             x = np.empty(shape, dtype=dtype)
-            x.real = np.random.normal(mean, std*np.sqrt(0.5), shape)
-            x.imag = np.random.normal(0., std*np.sqrt(0.5), shape)
+            x.real = np.random.normal(loc=0., scale=np.sqrt(0.5), size=shape)
+            x.imag = np.random.normal(loc=0., scale=np.sqrt(0.5), size=shape)
         else:
-            x = np.random.normal(mean, std, shape)
+            x = np.random.normal(loc=0., scale=1., size=shape)
             x = x.astype(dtype, copy=False)
+        x *= std
+        x += mean
         return x
 
     @staticmethod
diff --git a/setup.py b/setup.py
index c91096f82..585f9cfcc 100644
--- a/setup.py
+++ b/setup.py
@@ -32,8 +32,8 @@ setup(name="nifty2go",
       dependency_links=[
                'git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git@setuptools_test#egg=pyHealpix-0.0.1'],
       license="GPLv3",
-      setup_requires=['future', 'pyHealpix>=0.0.1', 'numpy>=1.13', 'pyfftw>=0.10.4'],
-      install_requires=['future', 'pyHealpix>=0.0.1', 'numpy>=1.13', 'pyfftw>=0.10.4'],
+      setup_requires=['future', 'pyHealpix>=0.0.1', 'numpy', 'pyfftw>=0.10.4'],
+      install_requires=['future', 'pyHealpix>=0.0.1', 'numpy', 'pyfftw>=0.10.4'],
       classifiers=[
         "Development Status :: 4 - Beta",
         "Topic :: Utilities",
-- 
GitLab