JuliaPy / JuliaPy/PythonCall.jl

Support more of abstract array interface

未關閉
#462 11 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
Julia
星號
1.1k
分支
86
平均合併
1 天 22 小時
30 天內合併 PR
3

描述

Currently `similar` will return an array of a different type:

```python
from juliacall import Main as jl
import numpy as np

x = np.random.randn(5)
y = jl.similar(x)

print(jl.typeof(x))
# PyArray{Float64, 1, true, true, Float64}
print(jl.typeof(y))
# Vector{Float64}
```

This can introduce some type instabilities in libraries due to the assumption that container type is preserved by `similar`.

I guess we just need the "optional methods" from here: https://docs.julialang.org/en/v1/manual/interfaces/#man-interface-array

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。