JuliaPy / JuliaPy/PyCall.jl

sympy matrices, and failed `pyerr_check`

Abierto
#736 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Julia
Estrellas
1.5k
Forks
186
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
julia, python
Área
tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.