Any idea on this PyCall.PyObject issue?
Closed this issue · 4 comments
Hi John,
Late last Thursday NumericalMethodsforEngineers.jl (then registered version of NMfE.jl) was running fine with the registered version of Symata 0.4.2. Reason for a little celebration and a few days off grid in the mountains. But yesterday evening I was prompted to run `Pkg.build("PyCall"). All examples still run fine except late (iteration 7) in the Vianello example:
julia> include("/Users/rob/.julia/dev/NumericalMethodsforEngineers/test/vianello_symata2.jl")
[ Info: Precompiling module Symata
┌ Warning: foldr(op, v0, itr)
is deprecated, use foldr(op, itr; init=v0)
instead.
│ caller = @match(::LineNumberNode, ::Module, ::Any, ::Any) at macro.jl:54
└ @ MacroTools ~/.julia/packages/MacroTools/IEXI/src/macro.jl:54
┌ Warning: cat(dims, As...)
is deprecated, use cat(As..., dims=dims)
instead.
│ caller = top-level scope at none:0
└ @ Core none:0
N[res[1, 1]]: 0.0
N[res[2, 1]]: 22.7027027027027
N[res[3, 1]]: 19.110473457675752
N[res[4, 1]]: 18.669080846404874
N[res[5, 1]]: 18.589113036311467
N[res[6, 1]]: 18.57300630567659
MethodError(Rational, (1, PyObject 93666727314800640000), 0x0000000000006c07)
ERROR: LoadError: LoadError: MethodError: no method matching Rational(::Int64, ::PyCall.PyObject)
Closest candidates are:
Rational(::Integer) at rational.jl:20
Rational(::T<:Integer, ::T<:Integer) where T<:Integer at rational.jl:18
Rational(::Integer, ::Integer) at rational.jl:19
...
Stacktrace:
[1] _pytosj(::PyCall.PyObject) at /Users/rob/.julia/packages/Symata/wzfo/src/sympy.jl:419
Vianello is a nice example but not critical for my next pass over the Symata examples in NumericalMethodsforEngineers and also adding examples in other chapters.
Best,
Rob
Curious. I'll try to find a 'tuit.
Great. I've also been experimenting quite a bit. I commented out all failing Symata tests in NumericalMethodsforEngineering.jl. The simple example in ch04 and the abbreviated vianello example work fine. All Weighted Residual Methods fail, with a PyCall error. It definitely started after a Pkg.build("PyCall") a few days ago
Hi John, no idea if this is relevant to Symata but this sentence of Michael Borregaard:
"On 1.0, though, (Pkg3 to be exact) you can’t import a package that was installed as a dependency - you can only import packages you’ve explicitly installed. That changes the installation procedure - we’ve updated the error message on the newest release of Plots (https://github.com/JuliaPlots/Plots.jl/pull/1656/files) but it may not be shown appropriately."
seems an important fact. Also noted your issue #157 this morning.
This is solved in Symata 0.4.5 on both Julia 1.0.1 and Julia 1.1!