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

Deprecation warnings in setup.jl #45

Closed
homocomputeris opened this issue May 30, 2019 · 7 comments · Fixed by #46
Closed

Deprecation warnings in setup.jl #45

homocomputeris opened this issue May 30, 2019 · 7 comments · Fixed by #46

Comments

@homocomputeris
Copy link

Obviously, not a breaking issue at the moment, but may be worth fixing:

┌ Warning: `haskey(o::PyObject, s::Union{Symbol, AbstractString})` is deprecated, use `hasproperty(o, s)` instead.
│   caller = numargs(::PyObject) at setup.jl:9
└ @ Main /usr/lib/python3.7/site-packages/diffeqpy/setup.jl:9
┌ Warning: `getindex(o::PyObject, s::Symbol)` is deprecated in favor of dot overloading (`getproperty`) so elements should now be accessed as e.g. `o.s` instead of `o[:s]`.
│   caller = numargs(::PyObject) at setup.jl:13
└ @ Main /usr/lib/python3.7/site-packages/diffeqpy/setup.jl:13

https://github.com/JuliaDiffEq/diffeqpy/blob/e5acd6c9d1836d920eae802f1bed10dd6d86b424/diffeqpy/setup.jl#L9-L13

@ChrisRackauckas
Copy link
Member

#46 should do it but it seems to fail? Is this PyCall master or something?

@homocomputeris
Copy link
Author

homocomputeris commented May 31, 2019

I believe I have the release versions:

(v1.1) pkg> status
    Status `~/.julia/environments/v1.1/Project.toml`
  [764a87c0] BoundaryValueDiffEq v2.2.3
  [2b5f629d] DiffEqBase v5.8.1
  [aae7a2af] DiffEqFlux v0.5.0
  [0c46a032] DifferentialEquations v6.4.0
  [61744808] DynamicalSystems v1.3.0
  [587475ba] Flux v0.8.3
  [7073ff75] IJulia v1.18.1
  [682c06a0] JSON v0.20.0
  [91a5bcdd] Plots v0.25.1
  [438e738f] PyCall v1.91.2
  [d330b81b] PyPlot v2.8.1

@ChrisRackauckas
Copy link
Member

Can you look at that PR? I believe I followed the depwarns correctly.

@tkf
Copy link
Contributor

tkf commented May 31, 2019

That failure may be due to #42.

@homocomputeris
Copy link
Author

homocomputeris commented May 31, 2019

If I update setup.jl, I get this:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-7d45701d85a2>", line 1, in <module>
    runfile('...', wdir='...')
  File "/usr/share/pycharm/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/usr/share/pycharm/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
...
  File "...", line 52
    bvp1 = de.BVProblem(eb_beam, bc, w0, interval)
RuntimeError: Julia exception: UndefVarError: hasproperty not defined
Stacktrace:
 [1] numargs(::PyObject) at /usr/lib/python3.7/site-packages/diffeqpy/setup.jl:9
 [2] isinplace(::PyObject, ::Int64) at /home/user/.julia/packages/DiffEqBase/BvErs/src/utils.jl:26
 [3] #ODEFunction#113(::Base.Iterators.Pairs{Symbol,Nothing,NTuple{7,Symbol},NamedTuple{(:analytic, :tgrad, :jac, :invW, :invW_t, :paramjac, :syms),NTuple{7,Nothing}}}, ::Type, ::PyObject) at /home/user/.julia/packages/DiffEqBase/BvErs/src/diffeqfunction.jl:295
 [4] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:analytic, :tgrad, :jac, :invW, :invW_t, :paramjac, :syms),NTuple{7,Nothing}}, ::Type{DiffEqBase.ODEFunction}, ::PyObject) at ./none:0
 [5] convert(::Type{DiffEqBase.ODEFunction}, ::PyObject) at /home/user/.julia/packages/DiffEqBase/BvErs/src/diffeqfunction.jl:614
 [6] #BVProblem#352(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type, ::PyObject, ::PyObject, ::Array{Float64,1}, ::Tuple{Float64,Float64}, ::Nothing) at /home/user/.julia/packages/DiffEqBase/BvErs/src/problems/bvp_problems.jl:32
 [7] Type at /home/user/.julia/packages/DiffEqBase/BvErs/src/problems/bvp_problems.jl:32 [inlined] (repeats 2 times)
 [8] _pyjlwrap_call(::Type, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at /home/user/.julia/packages/PyCall/ttONZ/src/callback.jl:28
 [9] pyjlwrap_call(::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at /home/user/.julia/packages/PyCall/ttONZ/src/callback.jl:49

and also this:

julia> hasproperty
ERROR: UndefVarError: hasproperty not defined
julia> using Base
julia> hasproperty
ERROR: UndefVarError: hasproperty not defined

And I failed to find docs for JuliaLang/julia#30496 in 1.1 because it requires 1.2.

@ChrisRackauckas
Copy link
Member

@tkf
Copy link
Contributor

tkf commented May 31, 2019

I think you can use PyCall.hasproperty here.

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

Successfully merging a pull request may close this issue.

3 participants