JuliaPy / JuliaPy/PyCall.jl

sympy matrices, and failed `pyerr_check`

Đang mở
#736 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Julia
Star
1.5k
Fork
186
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

After upgrading sympy to 1.5.1, I've noticed an error in sympy's `Matrix` constructor:

```
julia> using PyCall # [438e738f] PyCall v1.91.2
julia> sympy = PyCall.pyimport_conda("sympy", "sympy")
julia> sympy.__version__ # "1.5.1"
julia> sympy.Matrix([[1,1],[2,2]])
ERROR: PyError ($(Expr(:escape, :(ccall(#= /Users/verzani/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw)))))
ValueError('The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()')
File "/Users/verzani/.julia/conda/3/lib/python3.7/site-packages/sympy/matrices/dense.py", line 430, in __new__
return cls._new(*args, **kwargs)
File "/Users/verzani/.julia/conda/3/lib/python3.7/site-packages/sympy/matrices/dense.py", line 442, in _new
rows, cols, flat_list = cls._handle_creation_inputs(*args, **kwargs)
File "/Users/verzani/.julia/conda/3/lib/python3.7/site-packages/sympy/matrices/matrices.py", line 2623, in _handle_creation_inputs
if not row:

Stacktrace:
[1] pyerr_check at /Users/verzani/.julia/packages/PyCall/ttONZ/src/exception.jl:60 [inlined]
[2] pyerr_check at /Users/verzani/.julia/packages/PyCall/ttONZ/src/exception.jl:64 [inlined]
[3] macro expansion at /Users/verzani/.julia/packages/PyCall/ttONZ/src/exception.jl:84 [inlined]
[4] __pycall!(::PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyObject, ::Ptr{Nothing}) at /Users/verzani/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44
[5] _pycall!(::PyObject, ::PyObject, ::Tuple{Array{Array{Int64,1},1}}, ::Int64, ::Ptr{Nothing}) at /Users/verzani/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:29
[6] #_#111 at /Users/verzani/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:11 [inlined]
[7] (::PyObject)(::Array{Array{Int64,1},1}) at /Users/verzani/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:89
[8] top-level scope at REPL[9]:1
```

Any chance this can be addressed from `PyCall`?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by running the Julia reproduction with PyCall v1.91.2 and SymPy 1.5.1, then inspect the stack frames in src/exception.jl and src/pyfncall.jl. Determine whether the failure is in PyCall's argument conversion or error handling; done means the Matrix call has a verified PyCall-side resolution or a clearly documented upstream limitation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
julia, python
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.