-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CI: Numpy Dev Build Failing #33507
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
Comments
I think we want Cython dev to catch regressions there. cc @scoder if you have any ideas why this would be raising.
I'll try to recompile with Cython master to get the actual C code. |
I'm not really sure what's helpful to post here from the C file. This is a fused type so there's tons of output. Haven't been able to make a simpler reproducer yet, and I need to step away for a while. |
@TomAugspurger No idea. The error message is plain wrong and I don't remember a specific change in that corner. A quick look in the sources also didn't reveal anything suspicious. It should accept a bool, and that's it. (And that also works in our test suite, at least according to the test we have…) |
This is as minimal as a reproducer as I;ve found so far: from numpy cimport int64_t, float64_t
ctypedef fused int_or_float:
int64_t
float64_t
def afunc(int_or_float[:] data,
ties_method="average",
bint ascending=True,
na_option="keep",
bint pct=False):
return 5 Not sure specifically within that what is throwing things off. Seems like changing any of the above makes it OK |
Thanks. I'm bisecting Cython commits with that. |
I may have messed up the bisect. It's pointing to cython/cython@f5ab2f4, which doesn't really make sense... Based on the title cython/cython#3493 seems like a likely culprit, but checking out that commit it seems fine. |
I won't be able to look into this more today. For now I'd recommend pinning Cython in the numpydev env. |
Maybe you didn't clean your Cython installation before the bisect? That commit changes the version number, which could enforce a new installation and ABI module. |
@WillAyd how do you reproduce the failure with that code? I'm asking because it compiles without error for me. How do you get it to fail? Is there anything else that I need? |
It’s a run time error not compile time. Not at a computer but if you call that with an ndarray it will throw (can provide concrete steps in a few hours if needed)
…Sent from my iPhone
On Apr 13, 2020, at 1:28 PM, Stefan Behnel ***@***.***> wrote:
@WillAyd how do you reproduce the failure with that code? I'm asking because it compiles without error for me. How do you get it to fail? Is there anything else that I need?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
If needed here's the runtime code: >>> import numpy as np
>>> import test
>>> test.afunc(np.array([1, 5]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "test.pyx", line 8, in test.__pyx_fused_cpdef
def afunc(int_or_float[:] data,
TypeError: Expected dict, got bool setup.py from setuptools import setup
from Cython.Build import cythonize
import pkg_resources
numpy_incl = pkg_resources.resource_filename("numpy", "core/include")
setup(
name='Bug test',
ext_modules=cythonize("test.pyx"),
include_dirs=[numpy_incl],
) |
Ok, got it. It's this bug that strikes again. The default argument of the specialised fused function gets accidentally typed as dict, because the default argument of the generated dispatch function is a dict. There's a spot somewhere in the pipeline where the type gets overwritten or is inherited somehow. Need to find it… |
I created a Cython ticket for this: |
Could you give the latest Cython master branch a try? It has a fix. |
Looks like our numpy dev build also uses a pre-release (alpha) of cython.
Is this the intended behaviour?
Think this is potentially what is causing the test failures:
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=33245&view=logs&j=3a03f79d-0b41-5610-1aa4-b4a014d0bc70&t=4d05ed0e-1ed3-5bff-dd63-1e957f2766a9
The text was updated successfully, but these errors were encountered: