Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
2b1b8705
Commit
2b1b8705
authored
May 19, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1179 from Daetalus/numpy_update_2
Remove numpy submodule
parents
7ac0fc69
ef4807e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
148 deletions
+40
-148
.gitmodules
.gitmodules
+0
-3
test/integration/numpy_patch.patch
test/integration/numpy_patch.patch
+15
-130
test/integration/numpy_test.py
test/integration/numpy_test.py
+25
-14
test/lib/numpy
test/lib/numpy
+0
-1
No files found.
.gitmodules
View file @
2b1b8705
...
...
@@ -31,9 +31,6 @@
[submodule "build_deps/jemalloc"]
path = build_deps/jemalloc
url = git://github.com/jemalloc/jemalloc.git
[submodule "test/lib/numpy"]
path = test/lib/numpy
url = https://github.com/numpy/numpy
[submodule "test/lib/decorator"]
path = test/lib/decorator
url = https://github.com/micheles/decorator
...
...
test/integration/numpy_patch.patch
View file @
2b1b8705
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index
8ffeeda..5d43aab
100644
index
b9db3bb..2d24efc
100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -133
6,13 +1336
,13 @@
arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
@@ -133
7,13 +1337
,13 @@
arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
_ADDDOC(Type, new->tp_doc, new->tp_name);
}
else if (_TESTDOC2(MemberDescr)) {
- _ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name);
+ /
/_ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name);
+ /
* _ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name); */
}
else if (_TESTDOC2(GetSetDescr)) {
- _ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name);
+ /
/_ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name);
+ /
* _ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name); */
}
else if (_TESTDOC2(MethodDescr)) {
- _ADDDOC(MethodDescr, new->d_method->ml_doc, new->d_method->ml_name);
+ /
/_ADDDOC(MethodDescr, new->d_method->ml_doc, new->d_method->ml_name);
+ /
* _ADDDOC(MethodDescr, new->d_method->ml_doc, new->d_method->ml_name); */
}
else {
PyObject *doc_attr;
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index d025901..27c8718 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -1051,6 +1051,11 @@
_convert_from_dict(PyObject *obj, int align)
"with align=True",
(int)offset, (int)newdescr->alignment);
ret = NPY_FAIL;
+
+ // Pyston change: we don't deal well with execution continuing
+ // after an exception has been set. Subsequent calls to GetItem and
+ // such happen with the exception set (PyErr_Occurred() == true).
+ goto fail;
}
else if (offset + newdescr->elsize > totalsize) {
totalsize = offset + newdescr->elsize;
@@ -1079,6 +1084,11 @@
_convert_from_dict(PyObject *obj, int align)
PyErr_SetString(PyExc_ValueError,
"field names must be strings");
ret = NPY_FAIL;
+
+ // Pyston change: we don't deal well with execution continuing
+ // after an exception has been set. Subsequent calls to GetItem and
+ // such happen with the exception set (PyErr_Occurred() == true).
+ goto fail;
}
/* Insert into dictionary */
@@ -1086,6 +1096,11 @@
_convert_from_dict(PyObject *obj, int align)
PyErr_SetString(PyExc_ValueError,
"name already used as a name or title");
ret = NPY_FAIL;
+
+ // Pyston change: we don't deal well with execution continuing
+ // after an exception has been set. Subsequent calls to GetItem and
+ // such happen with the exception set (PyErr_Occurred() == true).
+ goto fail;
}
PyDict_SetItem(fields, name, tup);
Py_DECREF(name);
@@ -1099,6 +1114,11 @@
_convert_from_dict(PyObject *obj, int align)
PyErr_SetString(PyExc_ValueError,
"title already used as a name or title.");
ret=NPY_FAIL;
+
+ // Pyston change: we don't deal well with execution continuing
+ // after an exception has been set. Subsequent calls to GetItem and
+ // such happen with the exception set (PyErr_Occurred() == true).
+ goto fail;
}
PyDict_SetItem(fields, title, tup);
}
diff --git a/numpy/core/tests/test_records.py b/numpy/core/tests/test_records.py
index 7a18f29..a8d4e4b 100644
--- a/numpy/core/tests/test_records.py
+++ b/numpy/core/tests/test_records.py
@@ -12,7 +12,7 @@
from numpy.testing import (
assert_array_almost_equal, assert_raises
diff --git a/setup.py b/setup.py
index cc8f3c1..d3f89f6 100755
--- a/setup.py
+++ b/setup.py
@@ -352,6 +352,7 @@
def setup_package():
platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
test_suite='nose.collector',
cmdclass={"sdist": sdist_checked},
+ zip_safe=False,
)
-
+"""
class TestFromrecords(TestCase):
def test_fromrecords(self):
r = np.rec.fromrecords([[456, 'dbe', 1.2], [2, 'de', 1.3]],
@@ -294,6 +294,6 @@
def test_find_duplicate():
l3 = [2, 2, 1, 4, 1, 6, 2, 3]
assert_(np.rec.find_duplicate(l3) == [2, 1])
-
+"""
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index f4ce678..56f5cd9 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -885,7 +885,8 @@
class Testfromregex(TestCase):
#####--------------------------------------------------------------------------
-
+# Pyston: these don't work, segfault, not sure why
+"""
class TestFromTxt(TestCase):
#
def test_record(self):
@@ -1822,6 +1823,7 @@
M 33 21.99
assert_allclose(test['f0'], 73786976294838206464.)
assert_equal(test['f1'], 17179869184)
assert_equal(test['f2'], 1024)
+"""
def test_gzip_load():
a = np.random.random((5, 5))
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index d3ec704..d68ffb0 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -1433,7 +1433,12 @@
class TestMaskedArrayAttributes(TestCase):
def assign():
m = np.ma.array(a)
m.dtype = np.dtype('f8')
- assert_raises(ValueError, assign)
+
+ # Pyston: Some weirdness here with a jitted frame calling a C function
+# that raises an exception in C-style, and the exception is still set as we
+# return from the jitted function, causing an assertion to be triggered. Also,
+# this happens with a with context catching the exception and stuff. I have no idea.
+#assert_raises(ValueError, assign)
b = a.view(dtype='f4', type=np.ma.MaskedArray) # raises?
assert_equal(b.dtype, np.dtype('f4'))
diff --git a/numpy/ma/tests/test_regression.py b/numpy/ma/tests/test_regression.py
index dba74d3..23cfeed 100644
--- a/numpy/ma/tests/test_regression.py
+++ b/numpy/ma/tests/test_regression.py
@@ -35,7 +35,8 @@
class TestRegression(TestCase):
a[2, 0] = np.ma.masked
b = np.zeros((4, 2))
a*b
- b*a
+ # Pyston: commented out for now, causes assertion to be triggered.
+ # b*a
def test_masked_array_repeat(self, level=rlevel):
# Ticket #271
if "--force" in sys.argv:
test/integration/numpy_test.py
View file @
2b1b8705
...
...
@@ -60,7 +60,7 @@ if not os.path.exists(ENV_NAME) or os.stat(sys.executable).st_mtime > os.stat(EN
SRC_DIR
=
ENV_NAME
PYTHON_EXE
=
os
.
path
.
abspath
(
ENV_NAME
+
"/bin/python"
)
CYTHON_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
SRC_DIR
,
"Cython-0.22"
))
NUMPY_DIR
=
os
.
path
.
dirname
(
__file__
)
+
"/../lib/numpy"
NUMPY_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
SRC_DIR
,
"numpy"
))
print_progress_header
(
"Setting up Cython..."
)
if
not
os
.
path
.
exists
(
CYTHON_DIR
):
...
...
@@ -82,21 +82,32 @@ if not os.path.exists(CYTHON_DIR):
else
:
print
">>> Cython already installed."
print_progress_header
(
"Patching NumPy..."
)
NUMPY_PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"numpy_patch.patch"
))
print_progress_header
(
"Cloning up NumPy..."
)
if
not
os
.
path
.
exists
(
NUMPY_DIR
):
url
=
"https://github.com/numpy/numpy"
subprocess
.
check_call
([
"git"
,
"clone"
,
"--branch"
,
"v1.11.0"
,
url
],
cwd
=
SRC_DIR
)
else
:
print
">>> NumPy already installed."
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"numpy_patch.patch"
))
print_progress_header
(
"Patching NumPy..."
)
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
NUMPY_DIR
)
try
:
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-d"
,
NUMPY_DIR
]
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
e
:
print
e
.
output
if
"Reversed (or previously applied) patch detected! Skipping patch"
not
in
e
.
output
:
raise
e
print_progress_header
(
"Setting up NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"build"
],
cwd
=
NUMPY_DIR
)
print_progress_header
(
"Installing NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
NUMPY_DIR
)
env
=
os
.
environ
CYTHON_BIN_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
+
"/bin"
))
env
[
"PATH"
]
=
CYTHON_BIN_DIR
+
":"
+
env
[
"PATH"
]
print_progress_header
(
"Setting up NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"build"
],
cwd
=
NUMPY_DIR
,
env
=
env
)
print_progress_header
(
"Installing NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
NUMPY_DIR
,
env
=
env
)
except
:
subprocess
.
check_call
([
"rm"
,
"-rf"
,
NUMPY_DIR
])
# From Wikipedia
script
=
"""
...
...
numpy
@
e4d4b45d
Subproject commit e4d4b45d26813899c66e112365896aabbb7b19fa
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment