Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use get_model instead f getrice
  • Loading branch information
corakingdon committed May 26, 2019
1 parent fd8566d commit 9a22086
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/main.jl
@@ -1,7 +1,7 @@
using Mimi
using MimiRICE2010

m = getrice()
m = get_model()
run(m)

explore(m)
8 changes: 6 additions & 2 deletions src/MimiRICE2010.jl
Expand Up @@ -19,10 +19,12 @@ include("components/welfare_component.jl")

export constructrice, getrice

const model_years = 2005:10:2595

function constructrice(p)

m = Model()
set_dimension!(m, :time, 2005:10:2595)
set_dimension!(m, :time, model_years)
set_dimension!(m, :regions, ["US", "EU", "Japan", "Russia", "Eurasia", "China", "India", "MidEast", "Africa", "LatAm", "OHI", "OthAsia"])

add_comp!(m, grosseconomy, :grosseconomy)
Expand Down Expand Up @@ -155,12 +157,14 @@ function constructrice(p)
return m
end #function

function getrice(;datafile=joinpath(@__DIR__, "..", "data", "RICE_2010_base_000.xlsm"))
function get_model(;datafile=joinpath(@__DIR__, "..", "data", "RICE_2010_base_000.xlsm"))
params = getrice2010parameters(datafile)

m = constructrice(params)

return m
end #function

getrice = get_model # Maintain the old `getrice` function name in addition to the standard MimiRICE2010.get_model

end #module
2 changes: 1 addition & 1 deletion test/runtests.jl
Expand Up @@ -5,7 +5,7 @@ using Mimi
using DataFrames
using CSVFiles

m = getrice()
m = MimiRICE2010.get_model()
run(m)

parameter_filename = joinpath(@__DIR__, "..", "data", "RICE_2010_base_000.xlsm")
Expand Down

0 comments on commit 9a22086

Please sign in to comment.