JuliaPy / JuliaPy/PyCall.jl

sympy matrices, and failed `pyerr_check`

Ouverte
#736 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Julia
Étoiles
1.5k
Forks
186
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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`?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.