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

Error with fused function dispatch on Linux with Python 2.7 and NumPy 1.16.3 #2932

Open
mobiusklein opened this issue Apr 25, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@mobiusklein
Copy link

commented Apr 25, 2019

Minimal Reproducible Example: https://gist.github.com/mobiusklein/808d101ea228a71af02e9b5f4a8a0caa

It was observed that using Python 2.7 on Linux with NumPy 1.16, invoking an unspecialized fused function where np.ndarray is in the fused type produces RuntimeError: implement_array_function method already has a docstring.

The gist includes the source code for building numfoo, and a short test script to demonstrate the behavior:

import numfoo
import numpy as np

data = [1.2, 2.4]

# The data are a plain list
print(data)

# Invoking the fused function explicitly with a list works
print(numfoo.make_array[list](data))

# convert it into a NumPy array
data = np.array(data)

# Invoking the fused function explicitly with an np.ndarray works
print(numfoo.make_array[np.ndarray](data))

# This fails
print(numfoo.make_array(data))

This does not happen with an earlier NumPy version, it does not happen with a newer version of Python, and it does not appear to happen on Windows. That it blows up inside the fused function dispatch machinery but with seemingly an initialization-like problem in NumPy makes it hard to tell where I should be reporting this bug.

Note: Compilation was does using Cython 0.29.7

@mobiusklein

This comment has been minimized.

Copy link
Author

commented May 6, 2019

From reviewing the C code template for fused functions, I can't tell where the actual type testing takes place. Is there a place other than /Cython/Utility/CythonFunction.c I should be looking, @scoder?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.