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

dtype of NumPy array created from Julia array is object on Julia nightly #439

Open
sethaxen opened this issue Jan 20, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@sethaxen
Copy link

Affects: PythonCall

Describe the bug

I'm executing the following code

julia> using PythonCall

pkg> conda add numpy

julia> Py(randn(10)).to_numpy().dtype

I expect the dtype to be a float64, and indeed, on Julia v1.10.0 and earlier, the result is Python: dtype('float64'). On the Julia nightly, the result is Python: dtype('O'), which corresponds to an object dtype.

Your system
For v1.10.0:

julia> using CondaPkg, Pkg

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
  Threads: 11 on 8 virtual cores
Environment:
  JULIA_NUM_THREADS = auto
  JULIA_EDITOR = code

julia> Pkg.status()
Status `/tmp/jl_lFXo6Z/Project.toml`
  [992eb4ea] CondaPkg v0.2.22
  [6099a3de] PythonCall v0.9.15

julia> CondaPkg.status()
CondaPkg Status /tmp/jl_lFXo6Z/CondaPkg.toml
Environment
  /tmp/jl_lFXo6Z/.CondaPkg/env
Packages
  numpy v1.26.3

For nightly:

julia> using CondaPkg, Pkg

julia> versioninfo()
Julia Version 1.11.0-DEV.1341
Commit 63188d58c09 (2024-01-19 23:30 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, tigerlake)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
  JULIA_NUM_THREADS = auto
  JULIA_EDITOR = code

julia> Pkg.status()
Status `/tmp/jl_oeTJsz/Project.toml`
  [992eb4ea] CondaPkg v0.2.22
  [6099a3de] PythonCall v0.9.15

julia> CondaPkg.status()
CondaPkg Status /tmp/jl_oeTJsz/CondaPkg.toml
Environment
  /tmp/jl_oeTJsz/.CondaPkg/env
Packages
  numpy v1.26.3
@MilesCranmer
Copy link
Contributor

MilesCranmer commented Jan 21, 2024

Not sure if my issue was related in #441 but I see similar issue going Python -> Julia.

@cjdoris cjdoris added priority Should be fixed or implemented soon and removed priority Should be fixed or implemented soon labels Jan 25, 2024
@cjdoris
Copy link
Collaborator

cjdoris commented Jan 25, 2024

Oof that's a fun one! Personally I'm not going to worry about it until there is a release candidate though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants