You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using python with sympy 1.7 results in div not being found when trying to use division on a Sym.
Error trace
this is how I stumbled over the error but one gets basically the same for Sym(2)/2.
``` julia
julia> Sym(2):-one(Sym(2)):-Sym(2)
ERROR: KeyError: key :__div__ not found
Stacktrace:
[1] __getproperty(::PyCall.PyObject, ::Symbol) at /home/benneti/.julia/packages/PyCall/BcTLp/src/PyCall.jl:307
[2] getproperty(::PyCall.PyObject, ::Symbol) at /home/benneti/.julia/packages/PyCall/BcTLp/src/PyCall.jl:312
[3] getproperty(::Sym, ::Symbol) at /home/benneti/.julia/packages/SymPy/1X20v/src/types.jl:119
[4] /(::Sym, ::Sym) at /home/benneti/.julia/packages/SymPy/1X20v/src/mathops.jl:11
[5] rem(::Sym, ::Sym) at /home/benneti/.julia/packages/SymPy/1X20v/src/generic.jl:115
[6] steprange_last(::Sym, ::Sym, ::Sym) at ./range.jl:232
[7] StepRange{Sym,Sym}(::Sym, ::Sym, ::Sym) at ./range.jl:205
[8] StepRange(::Sym, ::Sym, ::Sym) at ./range.jl:256
[9] _colon(::Sym, ::Sym, ::Sym) at ./range.jl:46
[10] (::Colon)(::Sym, ::Sym, ::Sym) at ./range.jl:40
[11] top-level scope at REPL[2]:1
```
The text was updated successfully, but these errors were encountered:
benneti
changed the title
range with sympy numbers (regression)
Problems with pythons sympy 1.7
Dec 2, 2020
julia> for i in Sym(2):-Sym(2):-Sym(2)
@show i
end
i = 2
i = 0
i = -2
julia> sympy.__version__
"1.6.2"
But I haven't tested against 1.7. I guess I need to upgrade and put out the first. Hopefully this
will have a simple workaround, but I don't know as there is nothing special done to support this syntax
on the SymPy.jl side of things.
What also gives an error, even on 1.6.2, and should be fixable, is
julia> collect(Sym(2):-Sym(2):-Sym(2))
ERROR: MethodError: no method matching Integer(::Sym)
jverzani
added a commit
to jverzani/SymPy.jl
that referenced
this issue
Dec 2, 2020
Using python with sympy 1.7 results in div not being found when trying to use division on a
Sym
.Error trace
this is how I stumbled over the error but one gets basically the same for Sym(2)/2. ``` julia julia> Sym(2):-one(Sym(2)):-Sym(2) ERROR: KeyError: key :__div__ not found Stacktrace: [1] __getproperty(::PyCall.PyObject, ::Symbol) at /home/benneti/.julia/packages/PyCall/BcTLp/src/PyCall.jl:307 [2] getproperty(::PyCall.PyObject, ::Symbol) at /home/benneti/.julia/packages/PyCall/BcTLp/src/PyCall.jl:312 [3] getproperty(::Sym, ::Symbol) at /home/benneti/.julia/packages/SymPy/1X20v/src/types.jl:119 [4] /(::Sym, ::Sym) at /home/benneti/.julia/packages/SymPy/1X20v/src/mathops.jl:11 [5] rem(::Sym, ::Sym) at /home/benneti/.julia/packages/SymPy/1X20v/src/generic.jl:115 [6] steprange_last(::Sym, ::Sym, ::Sym) at ./range.jl:232 [7] StepRange{Sym,Sym}(::Sym, ::Sym, ::Sym) at ./range.jl:205 [8] StepRange(::Sym, ::Sym, ::Sym) at ./range.jl:256 [9] _colon(::Sym, ::Sym, ::Sym) at ./range.jl:46 [10] (::Colon)(::Sym, ::Sym, ::Sym) at ./range.jl:40 [11] top-level scope at REPL[2]:1 ```The text was updated successfully, but these errors were encountered: