Skip to content

Commit

Permalink
Merge pull request #88 from MineralsCloud:print
Browse files Browse the repository at this point in the history
Rename command `print` to `show` & Remove stdlib `Serialization` from deps
  • Loading branch information
singularitti authored Aug 13, 2022
2 parents 7799956 + 0bf7d39 commit dd75399
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/EOS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions src/ExpressCommands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit dd75399

Please sign in to comment.