JuliaPy / JuliaPy/PyCall.jl

Implicit dependency on NumPy headers not made explicit anywhere

Offen
#814 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the README and numpy.jl, especially npyinitialize and the PyObject(a::StridedArray{T}) method described in the issue. Document the NumPy header requirement and parsing behavior, and verify that initialization failures are visible to users rather than silently caught.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia, numpy
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.