Skip to content

Commit

Permalink
context is saved by Julia serialize() instead of JLD2.save()
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelJuillard committed Aug 20, 2023
1 parent 6a1c02f commit ae6fd46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
KOrderPerturbations = "469b1a10-d817-41b3-9228-c19fbf63afb5"
KalmanFilterTools = "ec016732-9331-11e9-305f-d53cb440b85a"
Expand Down Expand Up @@ -87,7 +86,6 @@ FiniteDiff = "2.13.1"
Formatting = "0.4.2"
IntervalSets = "0.6.2, 0.7"
IterativeSolvers = "0.9.2"
JLD2 = "0.4.22"
JSON = "0.21.2"
KOrderPerturbations = "0.1.2"
KalmanFilterTools = "0.1.3"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ The results are in the ``context`` structure.

## Output
1. The ``context`` structure is saved in the directory
``<path to modfile>/<modfilenane>/output/<modfilename>.jld2``. It can be loaded with
``<path to modfile>/<modfilenane>/output/<modfilename>.jls``. It can be loaded with
```
using JLD2
DD = load("<path to modfile>/<modefilename>/output/<modefilename>.jld2")``
using Serialization
DD = Serialization.deserialize("<path to modfile>/<modefilename>/output/<modefilename>.jls")``
```
1. The IRF graphs are saved in ``<path to
modfile>/<modfilenane>/graphs``
Expand Down
3 changes: 1 addition & 2 deletions src/DynareParser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using CSV
using DataFrames
using ExtendedDates
using FastLapackInterface
using JLD2
using JSON
using Plots
using StatsFuns
Expand Down Expand Up @@ -491,7 +490,7 @@ end
function save_context(context::Context, filepath::String)
filename = split(filepath, "/")[end]
outputpath = mkpath(joinpath(filepath, "output"))
save(joinpath(outputpath, "$(filename).jld2"), "context", context)
serialize(joinpath(outputpath, "$(filename).jls"), context)
return nothing
end

Expand Down

0 comments on commit ae6fd46

Please sign in to comment.