Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with pythons sympy 1.7 #390

Closed
benneti opened this issue Dec 2, 2020 · 1 comment
Closed

Problems with pythons sympy 1.7 #390

benneti opened this issue Dec 2, 2020 · 1 comment

Comments

@benneti
Copy link

benneti commented 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 ```
@benneti benneti changed the title range with sympy numbers (regression) Problems with pythons sympy 1.7 Dec 2, 2020
@jverzani
Copy link
Collaborator

jverzani commented Dec 2, 2020

Yes, I can do this with sympy 1.6.2:

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
tomyun added a commit to cropbox/Cropbox.jl that referenced this issue Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants