-
Notifications
You must be signed in to change notification settings - Fork 286
Some work on the NumPy test #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5c536e9
to
5bf904b
Compare
@kmod This got rebased on the ctypes changes and should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this is a bit odd to me -- why do we have to do this when cpython doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is in PyType_Ready, typeobject.cpp:4123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, right (not sure why I didn't see that).
Sorry, we really should get around to adding an exception-style linter :/ btw, how hard would it be to get it to the point that we can actually enable the numpy test? |
There's almost nothing to do besides adding a line to the script that applies a patch to NumPy. |
That being said the NumPy test currently only tests if NumPy crashes, not if it produces the same output. |
f52dd00
to
f3636f2
Compare
src/codegen/parser.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there actually anything to do here? I think we should avoid putting this in if it will silently handle ellipses the wrong way, but it looks like this might actually be all we need and we can remove the TODO? Same for the serializer.
Ok I merged the testsuite change, could you update this PR to include the new submodule commit? |
417a31d
to
a52252e
Compare
NumPy is huge, bigger than our previous (arbitrary) number by an order of magnitude.
C extensions (NumPy) might inherit classes in C code and expect to find tp_number. This is just copied from CPython's PyType_Ready. This requires assigning some of the runtime functions to thesq_ and mp_ slots otherwise there are infinite loops from Pyston attributes.
Those should never exist because all Python objects should be created through the CPython API except for type objects. Unfortunately, some places like NumPy do that so we need a mean of patching it for now.
Cool this is passing again. |
awesome! |
Depends on #767
These are just a few small changes that help run NumPy which should be useful independently of the rest of the NumPy work.