From 3496a3cda8ea70253a76ed17c0af261f2d645fe2 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 4 Jan 2006 17:37:00 +0000 Subject: Moving things.. --- numpy/lib/utils.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 numpy/lib/utils.py (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py new file mode 100644 index 000000000..19fb18d4d --- /dev/null +++ b/numpy/lib/utils.py @@ -0,0 +1,28 @@ +from numerictypes import obj2dtype + +__all__ = ['issubclass_', 'get_scipy_include', 'issubdtype'] + +def issubclass_(arg1, arg2): + try: + return issubclass(arg1, arg2) + except TypeError: + return False + +def issubdtype(arg1, arg2): + return issubclass(obj2dtype(arg1), obj2dtype(arg2)) + +def get_scipy_include(): + """Return the directory in the package that contains the scipy/*.h header + files. + + Extension modules that need to compile against scipy.base should use this + function to locate the appropriate include directory. Using distutils: + + import scipy + Extension('extension_name', ... + include_dirs=[scipy.get_scipy_include()]) + """ + from scipy.distutils.misc_util import get_scipy_include_dirs + include_dirs = get_scipy_include_dirs() + assert len(include_dirs)==1,`include_dirs` + return include_dirs[0] -- cgit v1.2.1 From e706c7d92c4ee41e8e995fb3838bd0931b57efb5 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 4 Jan 2006 19:00:27 +0000 Subject: Changed all references to scipy to numpy --- numpy/lib/utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 19fb18d4d..be5a34295 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -1,6 +1,6 @@ from numerictypes import obj2dtype -__all__ = ['issubclass_', 'get_scipy_include', 'issubdtype'] +__all__ = ['issubclass_', 'get_numpy_include', 'issubdtype'] def issubclass_(arg1, arg2): try: @@ -11,18 +11,18 @@ def issubclass_(arg1, arg2): def issubdtype(arg1, arg2): return issubclass(obj2dtype(arg1), obj2dtype(arg2)) -def get_scipy_include(): - """Return the directory in the package that contains the scipy/*.h header +def get_numpy_include(): + """Return the directory in the package that contains the numpy/*.h header files. - Extension modules that need to compile against scipy.base should use this + Extension modules that need to compile against numpy.base should use this function to locate the appropriate include directory. Using distutils: - import scipy + import numpy Extension('extension_name', ... - include_dirs=[scipy.get_scipy_include()]) + include_dirs=[numpy.get_numpy_include()]) """ - from scipy.distutils.misc_util import get_scipy_include_dirs - include_dirs = get_scipy_include_dirs() + from numpy.distutils.misc_util import get_numpy_include_dirs + include_dirs = get_numpy_include_dirs() assert len(include_dirs)==1,`include_dirs` return include_dirs[0] -- cgit v1.2.1 From 5a765123d45616661f7d61f322ce8ba4a518e1aa Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 4 Jan 2006 19:30:36 +0000 Subject: Fixed lib --- numpy/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index be5a34295..88a22ab21 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -1,4 +1,4 @@ -from numerictypes import obj2dtype +from numpy.core.numerictypes import obj2dtype __all__ = ['issubclass_', 'get_numpy_include', 'issubdtype'] -- cgit v1.2.1