Commit e9e2db2c authored by Roman Yurchak's avatar Roman Yurchak Committed by GitHub

Merge pull request #148 from mdboom/numpy-1-15

Update to Numpy 1.15.1
parents 98e37809 01b27b37
package:
name: numpy
version: 1.14.5
version: 1.15.1
source:
url: https://files.pythonhosted.org/packages/d5/6e/f00492653d0fdf6497a181a1c1d46bbea5a2383e7faf4c8ca6d6f3d2581d/numpy-1.14.5.zip
sha256: a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac
url: https://files.pythonhosted.org/packages/65/ab/4dfcc20234fae12ee40c714b98077d6e3a10652496bd1488fa4828529b22/numpy-1.15.1.zip
sha256: 7b9e37f194f8bcdca8e9e6af92e2cbad79e360542effc2dd6b98d63955d8d8a3
patches:
- patches/add-emscripten-cpu.patch
- patches/disable-maybe-uninitialized.patch
- patches/dont-include-execinfo.patch
- patches/fix-enums.patch
- patches/fix-longdouble.patch
- patches/fix-static-init-of-nditer-pywrap.patch
- patches/force_malloc.patch
- patches/init-alloc-cache.patch
- patches/pass-along-errors-from-init.patch
- patches/use-dummy-threading.patch
- patches/use-local-blas-lapack.patch
- patches/fix-install-with-skip-build.patch
......
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
index 84653ea18..ca25a5715 100644
index 5edd8f42e..31560eac3 100644
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -82,6 +82,8 @@
#define NPY_CPU_ARCEL
#elif defined(__arc__) && defined(__BIG_ENDIAN__)
@@ -102,6 +102,8 @@
#define NPY_CPU_ARCEB
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
#define NPY_CPU_RISCV64
+#elif defined(__EMSCRIPTEN__)
+ #define NPY_CPU_EMSCRIPTEN
#else
#error Unknown CPU, please report this to numpy maintainers with \
information about your platform (OS, CPU and compiler)
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
index 1a42121db..5a43b14a8 100644
index 649bdb0a6..ec2f6eda5 100644
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -46,7 +46,8 @@
|| defined(NPY_CPU_SH_LE) \
@@ -47,7 +47,8 @@
|| defined(NPY_CPU_MIPSEL) \
|| defined(NPY_CPU_PPC64LE) \
- || defined(NPY_CPU_ARCEL)
+ || defined(NPY_CPU_ARCEL) \
|| defined(NPY_CPU_ARCEL) \
- || defined(NPY_CPU_RISCV64)
+ || defined(NPY_CPU_RISCV64) \
+ || defined(NPY_CPU_EMSCRIPTEN)
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
#elif defined(NPY_CPU_PPC) \
......
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 19bbc7435..ecab1d52a 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -252,7 +252,8 @@ typedef enum {
NPY_FR_ps = 11,/* picoseconds */
NPY_FR_fs = 12,/* femtoseconds */
NPY_FR_as = 13,/* attoseconds */
- NPY_FR_GENERIC = 14 /* Generic, unbound units, can convert to anything */
+ NPY_FR_GENERIC = 14, /* Generic, unbound units, can convert to anything */
+ NPY_DATETIMEUNIT_NULL = -1
} NPY_DATETIMEUNIT;
/*
diff --git a/numpy/core/src/multiarray/datetime_strings.c b/numpy/core/src/multiarray/datetime_strings.c
index b9aeda508..263ef96a1 100644
--- a/numpy/core/src/multiarray/datetime_strings.c
+++ b/numpy/core/src/multiarray/datetime_strings.c
@@ -795,6 +795,8 @@ get_datetime_iso_8601_strlen(int local, NPY_DATETIMEUNIT base)
case NPY_FR_Y:
len += 21; /* 64-bit year */
break;
+ case NPY_DATETIMEUNIT_NULL:
+ return 0;
}
if (base >= NPY_FR_h) {
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 486eb43ce..4e3181fc0 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1113,7 +1113,7 @@ PyArray_Sort(PyArrayObject *op, int axis, NPY_SORTKIND which)
return -1;
}
- if (which < 0 || which >= NPY_NSORTS) {
+ if (which >= NPY_NSORTS) {
PyErr_SetString(PyExc_ValueError, "not a valid sort kind");
return -1;
}
@@ -1221,10 +1221,6 @@ PyArray_Partition(PyArrayObject *op, PyArrayObject * ktharray, int axis,
return -1;
}
- if (which < 0 || which >= NPY_NSELECTS) {
- PyErr_SetString(PyExc_ValueError, "not a valid partition kind");
- return -1;
- }
part = get_partition_func(PyArray_TYPE(op), which);
if (part == NULL) {
/* Use sorting, slower but equivalent */
@@ -1263,7 +1259,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which)
PyArray_ArgSortFunc *argsort;
PyObject *ret;
- if (which < 0 || which >= NPY_NSORTS) {
+ if (which >= NPY_NSORTS) {
PyErr_SetString(PyExc_ValueError,
"not a valid sort kind");
return NULL;
@@ -1316,12 +1312,6 @@ PyArray_ArgPartition(PyArrayObject *op, PyArrayObject *ktharray, int axis,
PyArray_ArgSortFunc *argsort;
PyObject *ret;
- if (which < 0 || which >= NPY_NSELECTS) {
- PyErr_SetString(PyExc_ValueError,
- "not a valid partition kind");
- return NULL;
- }
-
argpart = get_argpartition_func(PyArray_TYPE(op), which);
if (argpart == NULL) {
/* Use sorting, slower but equivalent */
diff --git a/numpy/core/src/private/npy_binsearch.h.src b/numpy/core/src/private/npy_binsearch.h.src
index 3b2c59487..7d7099d24 100644
--- a/numpy/core/src/private/npy_binsearch.h.src
+++ b/numpy/core/src/private/npy_binsearch.h.src
@@ -106,10 +106,6 @@ get_@arg@binsearch_func(PyArray_Descr *dtype, NPY_SEARCHSIDE side)
npy_intp max_idx = num_funcs;
int type = dtype->type_num;
- if (side >= NPY_NSEARCHSIDES) {
- return NULL;
- }
-
/*
* It seems only fair that a binary search function be searched for
* using a binary search...
diff --git a/numpy/core/src/private/npy_partition.h.src b/numpy/core/src/private/npy_partition.h.src
index 07aecd4f8..8345546cc 100644
--- a/numpy/core/src/private/npy_partition.h.src
+++ b/numpy/core/src/private/npy_partition.h.src
@@ -92,9 +92,6 @@ static NPY_INLINE PyArray_PartitionFunc *
get_partition_func(int type, NPY_SELECTKIND which)
{
npy_intp i;
- if (which >= NPY_NSELECTS) {
- return NULL;
- }
for (i = 0; i < sizeof(_part_map)/sizeof(_part_map[0]); i++) {
if (type == _part_map[i].typenum) {
return _part_map[i].part[which];
@@ -108,9 +105,6 @@ static NPY_INLINE PyArray_ArgPartitionFunc *
get_argpartition_func(int type, NPY_SELECTKIND which)
{
npy_intp i;
- if (which >= NPY_NSELECTS) {
- return NULL;
- }
for (i = 0; i < sizeof(_part_map)/sizeof(_part_map[0]); i++) {
if (type == _part_map[i].typenum) {
return _part_map[i].argpart[which];
diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src
index fb31e8e6a..36e7fa095 100644
index cf427dad8..6c9f1c37e 100644
--- a/numpy/core/src/npymath/npy_math_complex.c.src
+++ b/numpy/core/src/npymath/npy_math_complex.c.src
@@ -1515,11 +1515,9 @@ _sum_squares@c@(@type@ x, @type@ y)
{
@@ -1522,10 +1522,9 @@ _sum_squares@c@(@type@ x, @type@ y)
#if @precision@ == 1
const npy_float SQRT_MIN = 1.0842022e-19f;
-#endif
#endif
-#if @precision@ == 2
+#elif @precision@ == 2 || NPY_SIZEOF_LONGDOUBLE < 16
+#if @precision@ == 2 || NPY_SIZEOF_LONGDOUBLE < 16
const npy_double SQRT_MIN = 1.4916681462400413e-154; /* sqrt(DBL_MIN) */
-#endif
-#if @precision@ == 3
+#elif @precision@ == 3
/* this is correct for 80 bit long doubles */
const npy_longdouble SQRT_MIN = 1.8336038675548471656e-2466l;
#endif
#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
const npy_longdouble SQRT_MIN = 1.4916681462400413e-154; /* sqrt(DBL_MIN) */
#else
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index a713679e8..ddb4ca0e0 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -4728,7 +4728,7 @@ static struct PyModuleDef moduledef = {
/* Initialization function for the module */
#if defined(NPY_PY3K)
-#define RETVAL m
+#define RETVAL retval
PyMODINIT_FUNC PyInit_multiarray(void) {
#else
#define RETVAL
@@ -4736,6 +4736,7 @@ PyMODINIT_FUNC initmultiarray(void) {
#endif
PyObject *m, *d, *s;
PyObject *c_api;
+ PyObject *retval = NULL;
/* Create the module and add the functions */
#if defined(NPY_PY3K)
@@ -4761,6 +4762,10 @@ PyMODINIT_FUNC initmultiarray(void) {
/* Initialize access to the PyDateTime API */
numpy_pydatetime_import();
+ if (PyErr_Occurred()) {
+ goto err;
+ }
+
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
if (!d) {
@@ -4888,6 +4893,8 @@ PyMODINIT_FUNC initmultiarray(void) {
if (set_typeinfo(d) != 0) {
goto err;
}
+ retval = m;
+
return RETVAL;
err:
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 1a6cee030..0706d2bad 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -310,7 +310,7 @@ static struct PyModuleDef moduledef = {
#include <stdio.h>
#if defined(NPY_PY3K)
-#define RETVAL m
+#define RETVAL retval
PyMODINIT_FUNC PyInit_umath(void)
#else
#define RETVAL
@@ -318,6 +318,7 @@ PyMODINIT_FUNC initumath(void)
#endif
{
PyObject *m, *d, *s, *s2, *c_api;
+ PyObject *retval = NULL;
int UFUNC_FLOATING_POINT_SUPPORT = 1;
#ifdef NO_UFUNC_FLOATING_POINT_SUPPORT
@@ -428,6 +429,8 @@ PyMODINIT_FUNC initumath(void)
goto err;
}
+ retval = m;
+
return RETVAL;
err:
diff --git a/numpy/fft/helper.py b/numpy/fft/helper.py
index 0856d6759..7238b74a2 100644
--- a/numpy/fft/helper.py
+++ b/numpy/fft/helper.py
@@ -5,7 +5,10 @@ Discrete Fourier Transforms - helper.py
from __future__ import division, absolute_import, print_function
import collections
-import threading
+try:
+ import threading
+except ImportError:
+ import dummy_threading as threading
from numpy.compat import integer_types
from numpy.core import (
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment