From 0df37ea62ea71697da8118daae6634e376974e91 Mon Sep 17 00:00:00 2001 From: Reno Date: Sat, 13 Aug 2022 04:17:44 -0400 Subject: [PATCH 1/5] Rename command `print` to `show` See https://github.com/comonicon/Comonicon.jl/issues/218 --- src/ExpressCommands.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExpressCommands.jl b/src/ExpressCommands.jl index a1bf8a7..08971c3 100644 --- a/src/ExpressCommands.jl +++ b/src/ExpressCommands.jl @@ -19,7 +19,7 @@ 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)) From 4357124ac00073efdfeab26c8c89495911f4d5e5 Mon Sep 17 00:00:00 2001 From: Reno Date: Sat, 13 Aug 2022 04:17:59 -0400 Subject: [PATCH 2/5] Deprecate showing `jls` files in `show` --- src/ExpressCommands.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ExpressCommands.jl b/src/ExpressCommands.jl index 08971c3..536d410 100644 --- a/src/ExpressCommands.jl +++ b/src/ExpressCommands.jl @@ -21,9 +21,7 @@ Print the `file` in a pretty format. """ @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) From 32964ac238651b801fdf8455056998fbfe3b524a Mon Sep 17 00:00:00 2001 From: Reno Date: Sat, 13 Aug 2022 04:20:05 -0400 Subject: [PATCH 3/5] Deprecate using `jls` in `EOS.plot` --- src/EOS.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) From 8b64136a325f4d08c37c9b54fb1a35e7675a5317 Mon Sep 17 00:00:00 2001 From: Reno Date: Sat, 13 Aug 2022 04:20:25 -0400 Subject: [PATCH 4/5] Remove unused `deserialize` --- src/ExpressCommands.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ExpressCommands.jl b/src/ExpressCommands.jl index 536d410..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 From 0bf7d395d14c62135a23c78f0c26f8d13b94741a Mon Sep 17 00:00:00 2001 From: Reno Date: Sat, 13 Aug 2022 04:21:14 -0400 Subject: [PATCH 5/5] Remove stdlib `Serialization` from deps --- Project.toml | 1 - 1 file changed, 1 deletion(-) 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"