From c71b45cee60c598fc1504ee5cc1f97e3c86cfbb8 Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Sat, 17 May 2014 12:21:48 -0400
Subject: [PATCH] remove pyopencl.np. pypy have already switched to numpy and
 most of the part cannot run on numpypy anyway....

---
 pyopencl/__init__.py                 | 2 +-
 pyopencl/algorithm.py                | 2 +-
 pyopencl/array.py                    | 2 +-
 pyopencl/capture_call.py             | 4 ++--
 pyopencl/cffi_cl.py                  | 2 +-
 pyopencl/characterize/performance.py | 2 +-
 pyopencl/clrandom.py                 | 2 +-
 pyopencl/elementwise.py              | 2 +-
 pyopencl/np.py                       | 4 ----
 pyopencl/reduction.py                | 2 +-
 pyopencl/scan.py                     | 2 +-
 pyopencl/tools.py                    | 4 ++--
 12 files changed, 13 insertions(+), 17 deletions(-)
 delete mode 100644 pyopencl/np.py

diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py
index d7e34628..bc4175c2 100644
--- a/pyopencl/__init__.py
+++ b/pyopencl/__init__.py
@@ -38,7 +38,7 @@ except ImportError:
 # _ccl = _cl
 # import cffi_cl
 # _cl = cffi_cl
-import np
+import numpy as np
 #from pyopencl._cl import *  # noqa
 from pyopencl.cffi_cl import *
 import inspect as _inspect
diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py
index 153c341f..23d336e6 100644
--- a/pyopencl/algorithm.py
+++ b/pyopencl/algorithm.py
@@ -27,7 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 """
 
-import pyopencl.np as np
+import numpy as np
 import pyopencl as cl
 import pyopencl.array  # noqa
 from pyopencl.scan import ScanTemplate
diff --git a/pyopencl/array.py b/pyopencl/array.py
index 7622f370..88770736 100644
--- a/pyopencl/array.py
+++ b/pyopencl/array.py
@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 """
 
 
-import pyopencl.np as np
+import numpy as np
 import pyopencl.elementwise as elementwise
 import pyopencl as cl
 from pytools import memoize_method
diff --git a/pyopencl/capture_call.py b/pyopencl/capture_call.py
index ecc006d5..cc4539b2 100644
--- a/pyopencl/capture_call.py
+++ b/pyopencl/capture_call.py
@@ -24,7 +24,7 @@ THE SOFTWARE.
 
 
 import pyopencl as cl
-import pyopencl.np as np
+import numpy as np
 from pytools.py_codegen import PythonCodeGenerator, Indentation
 
 
@@ -41,7 +41,7 @@ def capture_kernel_call(kernel, filename, queue, g_size, l_size, *args, **kwargs
 
     cg("# generated by pyopencl.capture_call")
     cg("")
-    cg("import pyopencl.np as np")
+    cg("import numpy as np")
     cg("import pyopencl as cl")
     cg("from base64 import b64decode")
     cg("from zlib import decompress")
diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py
index 2ec26ae6..19a84724 100644
--- a/pyopencl/cffi_cl.py
+++ b/pyopencl/cffi_cl.py
@@ -27,7 +27,7 @@ THE SOFTWARE.
 
 
 import warnings
-import np
+import numpy as np
 import sys
 
 # TODO: can we do without ctypes?
diff --git a/pyopencl/characterize/performance.py b/pyopencl/characterize/performance.py
index 2b843877..e498582e 100644
--- a/pyopencl/characterize/performance.py
+++ b/pyopencl/characterize/performance.py
@@ -23,7 +23,7 @@ THE SOFTWARE.
 """
 
 import pyopencl as cl
-import pyopencl.np as np
+import numpy as np
 
 
 
diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py
index 63536967..56360394 100644
--- a/pyopencl/clrandom.py
+++ b/pyopencl/clrandom.py
@@ -57,7 +57,7 @@ import pyopencl.array as cl_array
 from pyopencl.tools import first_arg_dependent_memoize
 from pytools import memoize_method
 
-import pyopencl.np as np
+import numpy as np
 
 
 class RanluxGenerator(object):
diff --git a/pyopencl/elementwise.py b/pyopencl/elementwise.py
index 36d127fd..5878b89c 100644
--- a/pyopencl/elementwise.py
+++ b/pyopencl/elementwise.py
@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 from pyopencl.tools import context_dependent_memoize
-import pyopencl.np as np
+import numpy as np
 import pyopencl as cl
 from pytools import memoize_method
 from pyopencl.tools import (dtype_to_ctype, VectorArg, ScalarArg,
diff --git a/pyopencl/np.py b/pyopencl/np.py
deleted file mode 100644
index 1c35453e..00000000
--- a/pyopencl/np.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
-    from numpypy import *
-except ImportError:
-    from numpy import *
diff --git a/pyopencl/reduction.py b/pyopencl/reduction.py
index 1606e28e..489be110 100644
--- a/pyopencl/reduction.py
+++ b/pyopencl/reduction.py
@@ -36,7 +36,7 @@ from pyopencl.tools import (
         context_dependent_memoize,
         dtype_to_ctype, KernelTemplateBase,
         _process_code_for_macro)
-import pyopencl.np as np
+import numpy as np
 
 
 # {{{ kernel source
diff --git a/pyopencl/scan.py b/pyopencl/scan.py
index 1b80960a..23c32777 100644
--- a/pyopencl/scan.py
+++ b/pyopencl/scan.py
@@ -28,7 +28,7 @@ within the Thrust project, https://code.google.com/p/thrust/
 # Direct link to thrust source:
 # https://code.google.com/p/thrust/source/browse/thrust/detail/backend/cuda/detail/fast_scan.inl # noqa
 
-import pyopencl.np as np
+import numpy as np
 
 import pyopencl as cl
 import pyopencl.array  # noqa
diff --git a/pyopencl/tools.py b/pyopencl/tools.py
index b335dee3..b270bd09 100644
--- a/pyopencl/tools.py
+++ b/pyopencl/tools.py
@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 """
 
 
-import pyopencl.np as np
+import numpy as np
 from decorator import decorator
 import pyopencl as cl
 from pytools import memoize, memoize_method
@@ -510,7 +510,7 @@ def match_dtype_to_c_struct(device, name, dtype, context=None):
 
     This example explains the use of this function::
 
-        >>> import pyopencl.np as np
+        >>> import numpy as np
         >>> import pyopencl as cl
         >>> import pyopencl.tools
         >>> ctx = cl.create_some_context()
-- 
GitLab