madsjulia / Mads.jl

MADS: Model Analysis & Decision Support
http://mads.gitlab.io
GNU General Public License v3.0
102 stars 20 forks source link

Connection between Mads.jl and JuliaDiffEq #7

Closed ChrisRackauckas closed 7 years ago

ChrisRackauckas commented 8 years ago

Hey, I just found what you have here and it's pretty nice stuff. I would like to be able to wrap this functionality into the DifferentialEquations.jl ecosystem so that way it will be seamless for the average Julia user to use this. Here's the low-down:

@finmod I see you've opened an issue here: are you familiar with its usage?

montyvesselinov commented 7 years ago

Thank you very much! We will address this issues. Currently, we use ODE.jl only to demo our model analyses capabilites.

ChrisRackauckas commented 7 years ago

Can this be re-opened? This was never done and I'd still like to take a crack at it.

Reguarding building the .mads file from the ParameterizedFunction, I have a few questions. First of all

https://github.com/madsjulia/Mads.jl/blob/master/examples/ode/ode.mads

Is the specification for this file defined anywhere? All I can find is here:

http://mads.readthedocs.io/en/latest/getting_started/

But not all of the fields are defined or documented. Secondly, is there a way to go about this without building the .mads file? It's quite unnecessary to have to write out to a file to call the library.

Third, regarding:

http://mads.readthedocs.io/en/latest/getting_started/

where is Associative documented?

Also, ode.jl example fails:

julia> import Mads

julia> import ODE

julia> import JSON

julia> import Gadfly

julia> import DataStructures

julia> # load parameter data from MADS YAML file
       Mads.madsinfo("Loading data ...")

julia> workdir = Mads.getmadsdir() # get the directory where the problem is executed
"."

julia> if workdir == ""
               workdir = joinpath(Mads.madsdir, "..", "examples", "ode")
       end

julia> md = Mads.loadmadsfile(joinpath(workdir, "ode.mads"))
ERROR: SystemError: opening file ./ode.mads: No such file or directory
 in #systemerror#51 at ./error.jl:34 [inlined]
 in systemerror(::String, ::Bool) at ./error.jl:34
 in open(::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./iostream.jl:89
 in #loadyamlfile#41(::Bool, ::Function, ::String) at /home/crackauc/.julia/v0.5/Mads/src/MadsYAML.jl:19
 in (::Mads.#kw##loadyamlfile)(::Array{Any,1}, ::Mads.#loadyamlfile, ::String) at ./<missing>:0
 in #loadmadsfile#6(::Bool, ::String, ::Function, ::String) at /home/crackauc/.julia/v0.5/Mads/src/MadsIO.jl:25
 in loadmadsfile(::String) at /home/crackauc/.julia/v0.5/Mads/src/MadsIO.jl:24
montyvesselinov commented 7 years ago

It is not required to use "ode.mads" but in this case, you need to build the Dictionary by yourself.

Changes pushed. Now include("ode.jl" should work