JuliaPy / JuliaPy/PyCall.jl

Implicit dependency on NumPy headers not made explicit anywhere

Abierto
#814 1 comentario 0 reacciones 0 asignados Ver en GitHub
help wanted
Lenguaje dominante
Julia
Estrellas
1.5k
Forks
186
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi, I've been on a quest the past two days to figure out why PyCall (through pyjulia) does not turn an `Array` on the Julia side into a NumPy array on the Python side (and produces a Python list instead). See https://github.com/paulmelis/blender-julia-test/issues/2 for all the gory details in nailing it down, particularly https://github.com/paulmelis/blender-julia-test/issues/2#issuecomment-687354497

The problem turns out to be that the NumPy installation I was using (as part of Blender) did not contain any header files and so `npyinitialize` in `numpy.jl` fails. There is an `error()` raised at that point with message `could not read __multiarray_api.h to parse PyArray_API` but that apparently never surfaces to the user level. In this case it gets raised further on from `NpyArray` but gets hidden in the catch part of `function PyObject(a::StridedArray{T}) where T<:PYARR_TYPES`. The message certainly isn't printed. It's also not mentioned anywhere in the docs that NumPy headers are being parsed (I could only find a reference to this in #38 from 2013).

So please add a note somewhere in the readme that the headers are a requirement for the NumPy installation used and are being parsed (which is quite unexpected). And NumPy initialization silently failing is also pretty suboptimal.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza con el README y numpy.jl, especialmente con npyinitialize y el método PyObject(a::StridedArray{T}) descrito en el issue. Documenta el requisito de la cabecera de NumPy y el comportamiento del análisis, y verifica que los fallos de inicialización sean visibles para los usuarios en lugar de capturarse silenciosamente.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
julia, numpy
Área
documentation
Tipo de issue
Documentación
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.