-
Notifications
You must be signed in to change notification settings - Fork 153
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
Unable to create numpy int array from an EdgeList
#614
Comments
This is going to be a release blocking issue because this causes errors in qiskit-terra as it relies on being able to |
A possible fix without downgrading PyO3 is to implement the It is puzzling that bumping the PyO3 version broke our code, especially considering we did not update |
That's a good idea, that also would potentially avoid the iteration overhead too because we could go straight to a numpy array via the c api (not that array creation from our custom return types is a bottleneck for anything). |
I also reported this upstream to pyo3 in PyO3/pyo3#2392 one option we might want to look at is converting back to use |
Information
What is the current behavior?
Trying to create a numpy array from an
EdgeList
object failsI bisected this to 71e34d1 (#569). I'm not sure if this is caused by changes in the newer version of pyo3 or our minimal changes to the
custom_vec_iter_impl
macro (I'm leaning towards a pyo3 change).What is the expected behavior?
calling
np.asarray(g.edge_list, dtype=np.uintp)
will create a numpy array for the edge list like:Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: