JuliaPy / JuliaPy/PythonCall.jl

Support more of abstract array interface

オープン
#462 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Julia
スター
1.1k
フォーク
86
平均マージ
1日 22時間
マージ済み PR(30日)
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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No implementation file or test is named. Reproduce the Python/Julia `similar` example from the issue, then read the linked Julia array-interface documentation and trace the existing `similar` handling in PythonCall.jl. Done means the relevant optional array-interface methods are supported and the example preserves the expected container type.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia, python
領域
api, backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。