JuliaPy / JuliaPy/PyCall.jl

indexing using pycall get differs from python

オープン
#234 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
1.5k
フォーク
186
PR マージ指標
30日以内にマージされた PR はありません

説明

I have read this:

Given o::PyObject, get(o, key) is equivalent to o[key] in Python, with automatic type conversion. To get as a PyObject without type conversion, do get(o, PyObject, key), or more generally get(o, SomeType, key). You can also supply a default value to use if the key is not found by get(o, key, default) or get(o, SomeType, key, default)

With this I successfully sliced a Python object ndarray in the first direction using:
image = get(image, PyObject, 5:70)
The problem is that I want to be able to do (in python) img[5:70, 5:200], use multiple arguments in brackets, but when typing
image = get(image, PyObject, 5:70, 5:200)
the second argument in seen as the default argument. So wouldn't it be nice to be able to give multiple arguments using get?

image = get(image, PyObject, (5:70, 5:200)) results in

LoadError: Only two or three spatial dimensions are permitted
while loading In[55], in expression starting on line 102
in call at /home/frank/.julia/v0.4/ImageView/src/display.jl:143
in view at /home/frank/.julia/v0.4/ImageView/src/display.jl:239
in obtainDataFromImages at In[55]:88
[inlined code] from In[55]:108
in anonymous at no file:0

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

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

調査の方向性

まず、issueで説明されているPyCall get APIを追跡し、Python ndarrayに対する多次元インデックス指定を再現します。個別のslice引数とtuple形式を比較し、デフォルト引数が現在どのように区別されているかを明らかにします。完了条件は、要求どおり多次元インデックス指定が機能すること、または回帰テストによってサポートされる動作が明確になることです。

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

評価

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

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

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