Skip to content

Commit

Permalink
Add src/MD/think.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Nov 20, 2023
1 parent 70cc96c commit 0a98be1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/MD/think.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Thinkers: Thunk
using EasyConfig: Config as Conf
using Unitful: dimension, @u_str

using .Config: StaticConfig, expand

import ExpressBase: think

think(action::CreateInput, conf::Conf) =
collect(Thunk(action(conf.template)) for _ in Base.OneTo(length(conf.at)))
think(action::CreateInput{<:MolecularDynamics}, conf::Conf) =
collect(Thunk(action, template) for template in first.(conf.io))
# think(action::ExtractData, conf::Conf) =
# collect(Thunk(action, file) for file in last.(conf.io))
# think(action::GatherData, ::Conf) = Thunk(action)
# think(action::SaveData, conf::Conf) = Thunk(action(conf.data.raw))
function think(action::Action{T}, config::StaticConfig) where {T}
config = expand(config, T())
return think(action, config::Conf)
end

0 comments on commit 0a98be1

Please sign in to comment.