diff options
author | mattip <matti.picus@gmail.com> | 2019-08-23 16:02:34 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-08-23 16:02:34 +0300 |
commit | bc74b3185f131661d602d4c95433b05b050ca4f0 (patch) | |
tree | cee4c37e5fe4da654dc2aa820317c59ef7c42258 /numpy/core | |
parent | 4246ce2a391314acc1da90d56ff4f995d45e18a9 (diff) | |
download | numpy-bc74b3185f131661d602d4c95433b05b050ca4f0.tar.gz |
BUG: revert detecting and raising error on ragged arrays
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 7 | ||||
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 5 |
2 files changed, 1 insertions, 11 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index bc327bf0d..f0a15505d 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -1849,13 +1849,6 @@ PyArray_GetArrayParamsFromObject(PyObject *op, *out_arr = NULL; return 0; } - if (is_object && (requested_dtype != NULL) && - (requested_dtype->type_num != NPY_OBJECT)) { - PyErr_SetString(PyExc_ValueError, - "cannot create an array from unequal-length (ragged) sequences"); - Py_DECREF(*out_dtype); - return -1; - } /* If object arrays are forced */ if (is_object) { Py_DECREF(*out_dtype); diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 6a115f41b..2593045ed 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -44,7 +44,7 @@ from numpy.testing import ( assert_, assert_raises, assert_warns, assert_equal, assert_almost_equal, assert_array_equal, assert_raises_regex, assert_array_almost_equal, assert_allclose, IS_PYPY, HAS_REFCOUNT, assert_array_less, runstring, - temppath, suppress_warnings, break_cycles, assert_raises_regex, + temppath, suppress_warnings, break_cycles, ) from numpy.core.tests._locales import CommaDecimalPointLocale @@ -497,9 +497,6 @@ class TestArrayConstruction(object): assert_(np.ascontiguousarray(d).flags.c_contiguous) assert_(np.asfortranarray(d).flags.f_contiguous) - def test_ragged(self): - assert_raises_regex(ValueError, 'ragged', - np.array, [[1], [2, 3]], dtype=int) class TestAssignment(object): def test_assignment_broadcasting(self): |