Skip to content

Commit

Permalink
Extend ExtractData in src/ConvergenceTestWorkflow/actions.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Oct 15, 2023
1 parent 77e770f commit 1eab39e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ConvergenceTestWorkflow/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ using AbInitioSoftwareBase: Setter
using CrystallographyBase: MonkhorstPackGrid
using Dates: format, now
using ExpressBase.Files: parentdir
using QuantumESPRESSO.PWscf: PWInput, KMeshCard, PWInput, VerbositySetter
using QuantumESPRESSO.PWscf:
PWInput, KMeshCard, PWInput, VerbositySetter, parse_electrons_energies
using Setfield: @set!
using UnifiedPseudopotentialFormat # To work with `download_potential`
using Unitful: ustrip, @u_str
using UnitfulAtomic

import Express.ConvergenceTestWorkflow: CreateInput
import Express.ConvergenceTestWorkflow: CreateInput, ExtractData
import ExpressBase: RunCmd

function (::ExtractData)(file)
str = read(file, String)
e = try
parse_electrons_energies(str, :converged)
catch
end
return e.ε[end] * u"Ry"
end

(::CreateInput)(template::PWInput, args...) = (customizer(args...) normalizer())(template)

struct CutoffEnergySetter <: Setter
Expand Down

0 comments on commit 1eab39e

Please sign in to comment.