diff --git a/Project.toml b/Project.toml index 0c74d56..5919ac4 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,6 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Preferences = "21216c6a-2e73-6563-6e65-726566657250" PrettyPrint = "8162dcfd-2161-5ef2-ae6c-7681170c5f98" QuantumESPRESSOExpress = "524a00d3-5d12-4323-9774-d2c11dc9d82e" -Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" SimpleWorkflows = "6a97d125-85da-4b66-b300-4bba10360563" TikzGraphs = "b4f28e30-c73f-5eaf-a395-8a9db949a742" TikzPictures = "37f6aa50-8035-52d0-81c2-5a1d08754b2d" diff --git a/src/EOS.jl b/src/EOS.jl index 19ba78d..08579bf 100644 --- a/src/EOS.jl +++ b/src/EOS.jl @@ -6,8 +6,8 @@ using EquationOfStateRecipes using EquationsOfStateOfSolids: Parameters, EquationOfStateOfSolids, EnergyEquation using Express.EquationOfStateWorkflow: Scf, VcOptim, FitEos, buildjob using Express.EquationOfStateWorkflow.Recipes: buildworkflow +import JLD2 using QuantumESPRESSOExpress -using Serialization: deserialize using SimpleWorkflows: run!, getresult import Plots # using ..ExpressCommands: @load_plugin @@ -40,10 +40,10 @@ Plot an equation of state from `file` to file "out". # Args -- `file`: a `.jls` file that saves the equation of state. +- `file`: a `.jld2` file that saves the equation of state. """ @cast function plot(file) - data = deserialize(file) + data = JLD2.load(file) for (key, value) in data if value isa Parameters eos = EnergyEquation(value) diff --git a/src/ExpressCommands.jl b/src/ExpressCommands.jl index a1bf8a7..da9853b 100644 --- a/src/ExpressCommands.jl +++ b/src/ExpressCommands.jl @@ -7,7 +7,6 @@ import JLD2 using Pkg: add, rm, gc, @pkg_str using Preferences: @set_preferences!, @load_preference using PrettyPrint: pprint -using Serialization: deserialize using SimpleWorkflows: Workflow import TikzGraphs import TikzPictures @@ -19,11 +18,9 @@ Print the `file` in a pretty format. - `file`: the file to be printed. Available extensions are `.jld2`, `.json`, `.yaml`, `.yml` or `.toml`. """ -@cast function print(file) +@cast function show(file) ext = lowercase(extension(file)) - if ext == "jls" - pprint(deserialize(file)) - elseif ext == "jld2" + if ext == "jld2" pprint(JLD2.load(file)) elseif ext in ("json", "yaml", "yml", "toml") data = load(file)