Skip to content

Error associated with Media module with Atom #105

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

Closed
Datseris opened this issue Nov 3, 2016 · 18 comments
Closed

Error associated with Media module with Atom #105

Datseris opened this issue Nov 3, 2016 · 18 comments

Comments

@Datseris
Copy link

Datseris commented Nov 3, 2016

(Julia version 0.5.0 !)
When I open a fresh console and type using DifferentialEquations the package loads no problem. For your assistance I am posting the deprecation warning I get (I know this is not a problem!):

julia> using DifferentialEquations
WARNING: symbol is deprecated, use Symbol instead.
 in depwarn(::String, ::Symbol) at .\deprecated.jl:64
 in symbol(::String, ::Vararg{String,N}) at .\deprecated.jl:30
 in replace_t(::Expr) at C:\Users\migos\.julia\v0.5\InplaceOps\src\InplaceOps.jl:97
 in collect_to!(::Array{Expr,1}, ::Base.Generator{Array{Any,1},InplaceOps.#replace_t}, ::Int64, ::Int64) at .\array.jl:340
# more stuff written afterwards, not very relevant...

However, when I open the Atom IDE and type the same in the console there I get the following ERROR:

LoadError: InitError: UndefVarError: Media not defined
 in media(::Type{T}, ::Type{T}) at C:\Users\migos\.julia\v0.5\Media\src\system.jl:72
 in setup_atom() at C:\Users\migos\.julia\v0.5\Plots\src\output.jl:257
 in __init__() at C:\Users\migos\.julia\v0.5\Plots\src\Plots.jl:239
 in _include_from_serialized(::String) at .\loading.jl:150
 in _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:187
 in _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:217
 in require(::Symbol) at .\loading.jl:371
 in include_from_node1(::String) at .\loading.jl:488
 in eval(::Module, ::Any) at .\boot.jl:234
 in require(::Symbol) at .\loading.jl:415
 in include_string(::String, ::String) at .\loading.jl:441
 in eval(::Module, ::Any) at .\boot.jl:234
 in (::Atom.##60#63)() at C:\Users\migos\.julia\v0.5\Atom\src\eval.jl:39
 in withpath(::Atom.##60#63, ::Void) at C:\Users\migos\.julia\v0.5\CodeTools\src\utils.jl:30
 in withpath(::Function, ::Void) at...

If I first write using Media and then differential equations, there isn't any problem.

@ChrisRackauckas
Copy link
Member

The first one is a depwarn due to InplaceOps.jl. If you Pkg.update() it should go away. Here's the tag that fixed it: simonbyrne/InplaceOps.jl#12

The second error is due to a precompilation problem with Plots.jl:

JuliaPlots/Plots.jl#545
JuliaPlots/Plots.jl#543

If you Pkg.checkout("Plots"), precompilation on Plots.jl's master has been disabled which fixes this problem. This won't be an issue anymore when @tbreloff tags a new version of Plots.jl.

So these issues should be fixed in the most up-to-date versions (in the dependent packages).

@tbreloff
Copy link

tbreloff commented Nov 3, 2016

when @tbreloff tags a new version of Plots.jl.

When is Pkg3 going to be finished?

@ChrisRackauckas
Copy link
Member

Not for a long time... Stefan said that was a very early form of a proposal. Don't count on it for at least a few months.

@Datseris
Copy link
Author

Datseris commented Nov 3, 2016

Thanks for the quick reply. Unfortunately it does not fix the issue. After the update and after the checkout everything works in the REPL (just like before). But when firing up Atom and using DifferentialEquations there, I now get:

LoadError: InitError: UndefVarError: Media not defined
 in media(::Type{T}, ::Type{T}) at C:\Users\migos\.julia\v0.5\Media\src\system.jl:72
 in setup_atom() at C:\Users\migos\.julia\v0.5\Plots\src\output.jl:259
 in __init__() at C:\Users\migos\.julia\v0.5\Plots\src\Plots.jl:232
 in _include_from_serialized(::String) at .\loading.jl:150
 in _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:187
 in _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:217
 in require(::Symbol) at .\loading.jl:371
 in include_from_node1(::String) at .\loading.jl:488
 in eval(::Module, ::Any) at .\boot.jl:234
 in require(::Symbol) at .\loading.jl:415
 in include_string(::String, ::String) at .\loading.jl:441
 in eval(::Module, ::Any) at .\boot.jl:234
 in (::Atom.##60#63)() at C:\Users\migos\.julia\v0.5\Atom\src\eval.jl:39
 in withpath(::Atom.##60#63, ::Void) at C:\Users\migos\.julia\v0.5\CodeTools\src\utils.jl:30
 in withpath(::Function, ::Void) at...

(which is the same error)

@Datseris
Copy link
Author

Datseris commented Nov 3, 2016

Also I am very confused as to why a differential equations solving package has a dependency on plots?

@tbreloff
Copy link

tbreloff commented Nov 3, 2016

Also I am very confused as to why a differential equations solving package has a dependency on plots?

Me too! Why not RecipesBase?

@ChrisRackauckas
Copy link
Member

Me too! Why not RecipesBase?

This one function can't be recipe because animations. Maybe we can hammer out a fix for that?

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Nov 3, 2016

Also note that DifferentialEquations just underwent a huge modularization change: #59 . This main repo will soon (a few days?) be a metapackage which just re-exports the functionality from component packages. Once the animation issue is fixed up, I do want to know whether users will want Plots to be automatic or not. Let me know your take on that.

Edit: talked with some other people in chats. Once this animation issue is fixed up, DifferentialEquations.jl won't require/reexport Plots.jl, and the docs will be changed to clarify that.

Note that if you want to use a component, like say OrdinaryDiffEq.jl, then that doesn't require Plots.jl (since it's able to use recipes). It's just FiniteElementDiffEq.jl that's the problem. This will all be documented very soon.

@tbreloff
Copy link

tbreloff commented Nov 3, 2016

I wonder if we can offer some sort of iterator interface for animations, maybe something like:

function animate(obj; kw...)
    anim = Animation()
    for o in obj
        plot(o.args...; o.kw...)
        frame(anim)
    end
    gif(anim; kw...)
end

and then your obj type would be responsible for implementing an iterator that returns the args/kw for a plot command at each iteration. It should work without a Plots dependency, and the user can still using Plots; animate(sol).

@ChrisRackauckas
Copy link
Member

Is there a way to setup "how much to skip" in an iterator interface? It would be nice to be able to step through two indices at a time, or 3, or etc.

@tbreloff
Copy link

tbreloff commented Nov 3, 2016

Sure... you just have to build it into your iterator.

@ChrisRackauckas
Copy link
Member

This sounds like it would work.

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Nov 3, 2016

We worked this out. Thanks @tbreloff! The Plots dependency will be dropped with the metapackage change due to SciML/FiniteElementDiffEq.jl@d51dedf

@Datseris
Copy link
Author

Datseris commented Nov 5, 2016

Update: This is not yet solved when using the Atom IDE. After Pkg.update(); Pkg.checkout("Plots"); Pkg.checkout("DifferentialEquations") in Julia REPL, everything works fine. I can easily using DifferentialEquations in the REPL. After I close the REPL and try to load DifEq into the console of the Atom IDE, it doesn't work. It gives off the same error concerning the Media module.

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Nov 5, 2016

Yes. DifferentialEquations.jl split into a bunch of packages: #59 . Inside of the "split version", this has been fixed - there's no Plots.jl dependency. The split version is on the dev branch and will not be merged for a few more days. Once that's merged, there will be no Plots dependency for any of the DiffEq stack which will fix the problem.

By "a few more days", the change is probably happening over the weekend.

@Datseris
Copy link
Author

Datseris commented Nov 5, 2016

Thanks for the update. I appreciate it. Will just using Pkg.update() do the trick or I have to remove, and install via git?

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Nov 5, 2016

It should be Pkg.update(), but I think this will be a big test as to how well Julia's package system works. Since all of the dependent packages are in the REQUIRE file, it should just work? But the reason why I am giving it another day is for testing / making sure it will.

I am going to run it on clean installations and see what happens.

@ChrisRackauckas
Copy link
Member

Fixed on master by the modularization change cb08e55

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

3 participants