JuliaPy / JuliaPy/PyCall.jl

Binary operators (+-/*) don't auto convert to Julia Types

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

説明

```
julia> using PyCall
julia> np=pyimport("numpy")
julia> a=PyCall.NpyArray(rand(3,2), false)
PyObject array([[0.82703672, 0.52055539],
[0.33942729, 0.33577722],
[0.49147636, 0.67564576]])

julia> np.exp(a) # autoconverts to a julia type
3×2 Array{Float64,2}:
2.28653 1.68296
1.40414 1.39903
1.63473 1.9653

julia> a * 2 # does not auto convert
PyObject array([[1.65407344, 1.04111078],
[0.67885458, 0.67155445],
[0.98295273, 1.35129152]])

```

This is because in [pyoperators.jl](https://github.com/JuliaPy/PyCall.jl/blob/1d0d17d4095962613fd97021407bd10a9a51c015/src/pyoperators.jl#L11) a PyObject is returned.

Maybe to be consistent with other function calls a `convert(PyAny, ...)` should be added?

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

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

調査の方向性

Start with src/pyoperators.jl at the linked operator definitions and reproduce the Julia, PyCall, and NumPy examples from the issue. Compare binary-operator behavior with np.exp and verify that the reported operators produce the expected Julia-converted result.

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

評価

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

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

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