Skip to content
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

ENH: Pypy fixes #8103

Merged
merged 4 commits into from
Oct 8, 2016
Merged

ENH: Pypy fixes #8103

merged 4 commits into from
Oct 8, 2016

Conversation

mattip
Copy link
Member

@mattip mattip commented Sep 30, 2016

This pull request is the latest in my PyPy compatibility work.
987077b is cleanup from the last pull request.
a5a3bf4 and d34d26f are self-explanatory.
bcda1c5 is needed since when importing scalar_math the tp_as_number function pointers are overridden with more optimal functions, which happens much after PyType_Ready establishes the function wrappers in RPython. In general, changing a type after PyType_Ready is disallowed, but PyType_Ready internally sets up a RPython type with address-to-function-pointer placeholders to the functions. This only works if they are present on the tp_as_... structures, since some types depend on those pointers-to-functions being NULL.

@charris
Copy link
Member

charris commented Sep 30, 2016

Note that style fixup commit messages start with STY:. For the function pointer overrides, I'd like to move the scalar math into multiarray and get rid of them. Most of the needed functions are now in the npymath library, so the ufunc fallbacks shouldn't be needed. There might be a couple of things that still need fixing first.

@mattip
Copy link
Member Author

mattip commented Oct 1, 2016

Fixed the non-standard commit message.

I tried simply moving the scalarmath.c.src file from umath to multiarray, but there was a link error "PyUFunc_getfperr isn't defined". I guess that falls into the couple of things that need fixing category. It may be simpler to separate the two issues: merge this pull request to allow PyPy to move closer to compatibility, and at some future point in time move the scalar math into multiarray.

@charris
Copy link
Member

charris commented Oct 1, 2016

I wasn't suggesting that you move the files :0 It was just a reminder to myself (and others) of what should be done.

@mattip
Copy link
Member Author

mattip commented Oct 8, 2016

ping. It would be nice if this made it into 1.12 ...

@charris charris added this to the 1.12.0 release milestone Oct 8, 2016
@njsmith
Copy link
Member

njsmith commented Oct 8, 2016

This all looks pretty trivially correct to me. Except the function pointer stuff, whose motivation is obscure as heck and like Chuck says should just go away once we refactor multiarray/umath properly, but in the mean time the actual changes are totally harmless looking. So let's do this.

@njsmith njsmith merged commit dbb7094 into numpy:master Oct 8, 2016
@charris charris changed the title Pypy fixes BUG: Pypy fixes Jan 15, 2017
@charris charris changed the title BUG: Pypy fixes ENH: Pypy fixes Jan 15, 2017
@mattip mattip deleted the pypy-fixes branch June 1, 2017 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants