RFC: Lazier and more interface-based conversion
まだ誰も着手していません。
- 主要言語
- Julia
- スター
- 1.5k
- フォーク
- 186
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Rather than trying to convert and copy values between Python and Julia, I propose to:
-
Enhance
pyjlwrapand implement most of Python data model such that virtually all Julia values are usable withpyjlwrap. For example, we can translategetindexto__getitem__etc. such that we can use anAbstractArraywithout translating it to a Numpy array. We can also implement__array__in Julia side to makenumpy.asarrayfast. -
Restrict automatic conversion to Julia types which supports ("practically") lossless round-trip (Julia -> Python -> Julia). Maybe something like:
Union{
Nothing,
Integer,
NpyNumber, # Int64, Float16, Float32, Float64, ...
Array{<: NpyNumber},
String,
Dates.AbstractTime, # or maybe only the concrete subtypes
IO, # ditto
}
Here is a reference implementation that shows this approach works: https://github.com/tkf/PyBase.jl
It would solve, e.g.,:
https://github.com/JuliaPy/PyCall.jl/issues/11
https://github.com/JuliaPy/PyCall.jl/issues/175
https://github.com/JuliaPy/PyCall.jl/issues/507
https://github.com/JuliaPy/PyCall.jl/issues/555
https://github.com/JuliaPy/PyCall.jl/issues/616
https://github.com/JuliaPy/PyPlot.jl/issues/391
https://github.com/JuliaPy/PyPlot.jl/issues/400
https://github.com/JuliaPy/pyjulia/issues/122
https://github.com/JuliaPy/pyjulia/issues/123
https://github.com/JuliaDiffEq/diffeqpy/issues/21
There are many details that can be refined (e.g., rather than using a single Python class, maybe define a few base class? Or even create Python class on-demand?) but first I'd like to know if it is a reasonable direction for PyCall.jl.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず既存の pyjlwrap のアプローチと、リンクされている PyBase.jl のリファレンス実装を確認し、次にそれらを一覧にある変換関連の issue と比較します。提案されているインターフェースベースの変換方針が PyCall.jl に適しているかを明らかにし、実装前にその範囲を具体化できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- julia, python
- 領域
- developer-experience, tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100