Skip to content

Commit

Permalink
Fix bugs for SaveCell
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Oct 24, 2023
1 parent 7a2910e commit 783931a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/EquationOfStateWorkflow/Recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function stage(::SelfConsistentField, r::ParallelEosFittingRecipe)
# thunk -> ConditionalJob(thunk; name="extract cell in SCF"), first(iterate(steps))
# )
# savecells = map(
# thunk -> ConditionalJob(thunk; name="save cell in SCF"), first(iterate(steps))
# thunk -> ArgDependentJob(thunk; name="save cell in SCF"), first(iterate(steps))
# )
extractdata = map(
thunk -> ConditionalJob(thunk; name="extract E(V) data in SCF"),
Expand Down Expand Up @@ -130,7 +130,7 @@ function stage(::VariableCellOptimization, r::ParallelEosFittingRecipe)
thunk -> ConditionalJob(thunk; name="extract cell in SCF"), first(iterate(steps))
)
savecells = map(
thunk -> ConditionalJob(thunk; name="save cell in SCF"), first(iterate(steps))
thunk -> ArgDependentJob(thunk; name="save cell in SCF"), first(iterate(steps))
)
extractdata = map(
thunk -> ConditionalJob(thunk; name="extract E(V) data in vc-relax"),
Expand Down
1 change: 1 addition & 0 deletions src/EquationOfStateWorkflow/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ end
struct SaveCell{T} <: Action{T}
calculation::T
end
(action::SaveCell)(path) = Base.Fix1(action, path)

struct FitEquationOfState{T} <: Action{T}
calculation::T
Expand Down
9 changes: 7 additions & 2 deletions src/EquationOfStateWorkflow/think.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ think(action::ExtractData, conf::Conf) =
collect(Thunk(action, file) for file in last.(conf.io))
think(action::ExtractCell, conf::Conf) =
collect(Thunk(action, file) for file in last.(conf.io))
think(action::SaveCell, conf::Conf) =
collect(Thunk(action, file) for file in last.(conf.io))
think(action::SaveCell, conf::Conf) = collect(
Thunk(
action(
joinpath(dirname(file), string(nameof(typeof(Calculation(action))))) * ".cif",
),
) for file in last.(conf.io)
)
think(action::GatherData, ::Conf) = Thunk(action)
think(action::SaveData, conf::Conf) = Thunk(action(conf.data.raw))
think(action::SaveParameters, conf::Conf) = Thunk(action(conf.data.eos_params))
Expand Down

0 comments on commit 783931a

Please sign in to comment.