diff options
author | Pauli Virtanen <pav@iki.fi> | 2010-07-17 13:10:39 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2010-07-17 13:10:39 +0000 |
commit | 3b21802c8aa4902627973c910aa8ab0d8c8fe2c6 (patch) | |
tree | 99d32ef63fec73967892a0e32512e0bc6c06dcb7 /numpy/core | |
parent | b08b7b1b9f903d100d2111e42c2a17599fc7a0b0 (diff) | |
download | numpy-3b21802c8aa4902627973c910aa8ab0d8c8fe2c6.tar.gz |
ENH: core: make npy_3kcompat.h header public, for easier usage in Scipy
Diffstat (limited to 'numpy/core')
36 files changed, 48 insertions, 36 deletions
diff --git a/numpy/core/src/private/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h index fad2f1fd3..2739af3f2 100644 --- a/numpy/core/src/private/npy_3kcompat.h +++ b/numpy/core/include/numpy/npy_3kcompat.h @@ -1,10 +1,22 @@ +/* + * This is a convenience header file providing compatibility utilities + * for supporting Python 2 and Python 3 in the same code base. + * + * If you want to use this for your own projects, it's recommended to make a + * copy of it. Although the stuff below is unlikely to change, we don't provide + * strong backwards compatibility guarantees at the moment. + */ + #ifndef _NPY_3KCOMPAT_H_ #define _NPY_3KCOMPAT_H_ #include <Python.h> #include <stdio.h> -#include "npy_config.h" +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + #include "numpy/npy_common.h" #include "numpy/ndarrayobject.h" diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index fdf89e883..ab1e824be 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -32,7 +32,7 @@ maintainer email: oliphant.travis@ieee.org #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index 40ed09da1..3c6ad10dd 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -9,7 +9,7 @@ #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "numpy/npy_math.h" diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c index 763874bc7..9fedece17 100644 --- a/numpy/core/src/multiarray/buffer.c +++ b/numpy/core/src/multiarray/buffer.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "buffer.h" #include "numpyos.h" diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c index 78ae26295..22225347d 100644 --- a/numpy/core/src/multiarray/calculation.c +++ b/numpy/core/src/multiarray/calculation.c @@ -8,7 +8,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "number.h" diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c index 449616986..33d7f719c 100644 --- a/numpy/core/src/multiarray/common.c +++ b/numpy/core/src/multiarray/common.c @@ -6,7 +6,7 @@ #include "numpy/arrayobject.h" #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "usertypes.h" diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c index 975327223..abc254058 100644 --- a/numpy/core/src/multiarray/conversion_utils.c +++ b/numpy/core/src/multiarray/conversion_utils.c @@ -8,7 +8,7 @@ #include "numpy/arrayscalars.h" #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "arraytypes.h" diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c index 0d5b3fd31..a2c965181 100644 --- a/numpy/core/src/multiarray/convert.c +++ b/numpy/core/src/multiarray/convert.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "arrayobject.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index ca56b1e2e..4de50ddce 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "scalartypes.h" diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 30399c754..6e339f5df 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c index b75260dd4..83c95bef3 100644 --- a/numpy/core/src/multiarray/datetime.c +++ b/numpy/core/src/multiarray/datetime.c @@ -10,7 +10,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "_datetime.h" diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c index 1784e2102..74cb7da7a 100644 --- a/numpy/core/src/multiarray/descriptor.c +++ b/numpy/core/src/multiarray/descriptor.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c index 3155929cf..ca27ef083 100644 --- a/numpy/core/src/multiarray/flagsobject.c +++ b/numpy/core/src/multiarray/flagsobject.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c index 7b75ab9fd..b35058238 100644 --- a/numpy/core/src/multiarray/getset.c +++ b/numpy/core/src/multiarray/getset.c @@ -10,7 +10,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "scalartypes.h" diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c index 9f2f2f599..4d4a7868e 100644 --- a/numpy/core/src/multiarray/hashdescr.c +++ b/numpy/core/src/multiarray/hashdescr.c @@ -5,7 +5,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "hashdescr.h" diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 49023d032..398acfe71 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c index 9db39b020..f841006ec 100644 --- a/numpy/core/src/multiarray/iterators.c +++ b/numpy/core/src/multiarray/iterators.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "arrayobject.h" #include "iterators.h" diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 476f05c36..6e5c60c2d 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "iterators.h" diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index 314d0abdd..0d7180a01 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -10,7 +10,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/multiarray_tests.c.src b/numpy/core/src/multiarray/multiarray_tests.c.src index 92b149961..f99cb98ad 100644 --- a/numpy/core/src/multiarray/multiarray_tests.c.src +++ b/numpy/core/src/multiarray/multiarray_tests.c.src @@ -1,7 +1,7 @@ #include <Python.h> #include "numpy/ndarrayobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /* * TODO: diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index 32dea6df6..de63f339c 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -27,7 +27,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" NPY_NO_EXPORT int NPY_NUMUSERTYPES = 0; diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c index 33fee51a1..ee9bf27a4 100644 --- a/numpy/core/src/multiarray/number.c +++ b/numpy/core/src/multiarray/number.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "number.h" diff --git a/numpy/core/src/multiarray/numpymemoryview.c b/numpy/core/src/multiarray/numpymemoryview.c index 417020aab..97d20577e 100644 --- a/numpy/core/src/multiarray/numpymemoryview.c +++ b/numpy/core/src/multiarray/numpymemoryview.c @@ -16,7 +16,7 @@ #include "numpy/arrayscalars.h" #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "numpymemoryview.h" diff --git a/numpy/core/src/multiarray/numpyos.c b/numpy/core/src/multiarray/numpyos.c index 2384b5161..b37e03942 100644 --- a/numpy/core/src/multiarray/numpyos.c +++ b/numpy/core/src/multiarray/numpyos.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /* * From the C99 standard, section 7.19.6: The exponent always contains at least diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c index fc8a35816..9fb4a901f 100644 --- a/numpy/core/src/multiarray/refcount.c +++ b/numpy/core/src/multiarray/refcount.c @@ -14,7 +14,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" static void _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype); diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c index faec958a9..f549ad35c 100644 --- a/numpy/core/src/multiarray/scalarapi.c +++ b/numpy/core/src/multiarray/scalarapi.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "ctors.h" #include "descriptor.h" diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index c95749c53..fa5bc3c27 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -11,7 +11,7 @@ #include "numpy/npy_math.h" #include "numpy/arrayscalars.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "npy_config.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c index fd58ce918..e3fff56c6 100644 --- a/numpy/core/src/multiarray/sequence.c +++ b/numpy/core/src/multiarray/sequence.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "common.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c index 81e22dc4d..671dc1538 100644 --- a/numpy/core/src/multiarray/shape.c +++ b/numpy/core/src/multiarray/shape.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c index 4371c3bc0..6a1788581 100644 --- a/numpy/core/src/multiarray/ucsnarrow.c +++ b/numpy/core/src/multiarray/ucsnarrow.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /* Functions only needed on narrow builds of Python for converting back and forth between the NumPy Unicode data-type diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c index 8df582fbd..203792914 100644 --- a/numpy/core/src/multiarray/usertypes.c +++ b/numpy/core/src/multiarray/usertypes.c @@ -34,7 +34,7 @@ maintainer email: oliphant.travis@ieee.org #include "common.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "usertypes.h" diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index d5475a30b..99182d83f 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -11,7 +11,7 @@ #include "numpy/ufuncobject.h" #include "numpy/arrayscalars.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /** numarray adapted routines.... **/ diff --git a/numpy/core/src/umath/funcs.inc.src b/numpy/core/src/umath/funcs.inc.src index 9208b92d2..d8127322c 100644 --- a/numpy/core/src/umath/funcs.inc.src +++ b/numpy/core/src/umath/funcs.inc.src @@ -6,7 +6,7 @@ * object functions. */ -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /* diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src index 72616e27c..cef45bdcb 100644 --- a/numpy/core/src/umath/loops.c.src +++ b/numpy/core/src/umath/loops.c.src @@ -14,7 +14,7 @@ #include "numpy/ufuncobject.h" #include "numpy/npy_math.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "ufunc_object.h" diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 31aaa56bf..a39b69212 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -33,7 +33,7 @@ #define NO_IMPORT_ARRAY #endif -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "numpy/noprefix.h" #include "numpy/ufuncobject.h" diff --git a/numpy/core/src/umath/umath_tests.c.src b/numpy/core/src/umath/umath_tests.c.src index 81bcb4f97..1fd27a296 100644 --- a/numpy/core/src/umath/umath_tests.c.src +++ b/numpy/core/src/umath/umath_tests.c.src @@ -9,7 +9,7 @@ #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "npy_config.h" |