Skip to content

Commit

Permalink
insure Julia 1.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelJuillard committed Dec 21, 2023
1 parent 9eb57da commit d55ff74
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ LinearRationalExpectations = "0.5.5"
LogDensityProblems = "0.11.5, 2"
MCMCChains = "5.3.1, 6"
MCMCDiagnosticTools = "0.3"
MKL = "0.6"
MKL = "0.4.3, 0.5, 0.6"
MPI = "0.20"
MUMPS = "1"
Metaheuristics = "3"
Expand Down
8 changes: 4 additions & 4 deletions src/DynareParser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ function make_containers(
Trends(endo_nbr, exo_nbr, exo_det_nbr),
Vector{Bool}(undef, endo_nbr),
EstimationResults(),
AxisArrayTable([;;], [], Symbol[]),
[AxisArrayTable([;;], [], Symbol[])],
AxisArrayTable([;;], [], Symbol[]),
AxisArrayTable(Matrix{Float64}(undef, 0, 0), [], Symbol[]),
[AxisArrayTable(Matrix{Float64}(undef, 0, 0), [], Symbol[])],
AxisArrayTable(Matrix{Float64}(undef, 0, 0), [], Symbol[]),
LinearRationalExpectationsResults(endo_nbr, exo_nbr, model.n_states),
Vector{Simulation}(undef, 0),
AxisArrayTable([;;], [], Symbol[]),
AxisArrayTable(Matrix{Float64}(undef, 0, 0), [], Symbol[]),
Vector{Matrix{Float64}}(undef, 0)
)
results = Results([modelresults])
Expand Down
2 changes: 1 addition & 1 deletion src/estimation/estimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include("estimated_parameters.jl")

Base.@kwdef struct EstimationOptions
config_sig::Float64 = 0.8
data::AxisArrayTable = AxisArrayTable(AxisArrayTables.AxisArray([;;], PeriodsSinceEpoch[], Symbol[]))
data::AxisArrayTable = AxisArrayTable(AxisArrayTables.AxisArray(Matrix{Float64}(undef, 0, 0), PeriodsSinceEpoch[], Symbol[]))
datafile::String = ""
diffuse_filter::Bool = false
display::Bool = false
Expand Down
2 changes: 1 addition & 1 deletion src/filters/kalman/kalman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Compute the smoothed values of the variables for an estimated model
"""
function calibsmoother!(; context=context,
datafile = "",
data::AxisArrayTable = AxisArrayTable([;;], Undated[], Symbol[]),
data::AxisArrayTable = AxisArrayTable(Matrix{Float64}(undef, 0, 0), Undated[], Symbol[]),
first_obs::PeriodsSinceEpoch = Undated(typemin(Int)),
last_obs::PeriodsSinceEpoch = Undated(typemin(Int)),
nobs::Int = 0
Expand Down
6 changes: 3 additions & 3 deletions src/forecast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ computes an unconditional forecast of the variables of the model
function forecasting!(; periods::Integer,
forecast_mode::ForecastModes,
context::Context=context,
data::AxisArrayTable=AxisArrayTable([;;], PeriodsSinceEpoch[], Symbol[]),
data::AxisArrayTable=AxisArrayTable(Matrix{Float64}(undef, 0, 0), PeriodsSinceEpoch[], Symbol[]),
datafile::String="",
first_obs::PeriodsSinceEpoch=Undated(typemin(Int)),
last_obs::PeriodsSinceEpoch=Undated(typemin(Int)),
Expand Down Expand Up @@ -54,7 +54,7 @@ end
function forecasting_(; periods,
forecast_mode::ForecastModes,
context=context,
data = AxisArrayTable([;;], PeriodsSinceEpoch[], Symbol[]),
data = AxisArrayTable(Matrix{Float64}(undef, 0, 0), PeriodsSinceEpoch[], Symbol[]),
datafile = "",
first_obs::PeriodsSinceEpoch = Undated(typemin(Int)),
last_obs::PeriodsSinceEpoch = Undated(typemin(Int)),
Expand Down Expand Up @@ -118,7 +118,7 @@ function recursive_forecasting!(; Np::Integer,
first_period::PeriodsSinceEpoch=Undated(typemin(Int)),
last_period::PeriodsSinceEpoch=Undated(typemin(Int)),
context::Context=context,
data::AxisArrayTable = AxisArrayTable([;;], PeriodsSinceEpoch[], Symbol[]),
data::AxisArrayTable = AxisArrayTable(Matrix{Float64}(undef, 0, 0), PeriodsSinceEpoch[], Symbol[]),
datafile::String="",
variables::Vector{<:Union{Symbol, String}} = Union{Symbol, String}[],
first_obs::PeriodsSinceEpoch=Undated(typemin(Int)),
Expand Down
6 changes: 3 additions & 3 deletions src/perfectforesight/perfectforesight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ function check_scenario(scenario)
end
p2 = collect(keys(scenario[k2]))
if !(p1 in p2)
error("A shock must be explicitly confirmed or modifier in all relevant subsequent infoperiods")
error("A shock must be explicitly confirmed or modified in all relevant subsequent infoperiods")
else
for v in p1
@show collect(keys(scenario[k2][p1]))
if !(v in keys(scenario[k2][p1]))
error("A shock must be explicitly confirmed or modifier in all relevant subsequent infoperiods")
error("A shock must be explicitly confirmed or modified in all relevant subsequent infoperiods")

end
end
Expand Down Expand Up @@ -980,7 +980,7 @@ function recursive_perfect_foresight!(context::Context, options::PerfectForesigh
else
initial_periods = 1
end
let simulation = Float64[;;]
let simulation = Matrix{Float64}(undef, 0, 0)
for (j, i) in enumerate(sort(collect(keys(scenario))))
if i == 1
initial_values = get_dynamic_initialvalues(context)
Expand Down
4 changes: 2 additions & 2 deletions test/test_scenario.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ context = @dynare "models/example1pf/example1pf_conditional"
@test context.work.scenario[2][3][:y] == (0.3 => :u)

Dynare.scenario!(infoperiod=Undated(3), name= :e, value = 0.1, period = 3, context = context)
@test_throws "A shock must be explicitly" Dynare.check_scenario(context.work.scenario)
@test_throws ErrorException Dynare.check_scenario(context.work.scenario)
end

@testset "set_future_information" begin
Expand Down Expand Up @@ -308,7 +308,7 @@ context = @dynare "models/example1pf/example1pf_conditional"
@testset "example1pf_conditional" begin
context = @dynare "models/example1pf/example1pf_conditional"

e = AxisArrayTables.data(simulation(:e))
e = AxisArrayTables.data(simulation(:e))
u = AxisArrayTables.data(simulation(:u))
y = AxisArrayTables.data(simulation(:y))
c1 = AxisArrayTables.data(simulation(:c, simnbr=1))
Expand Down

0 comments on commit d55ff74

Please sign in to comment.