From 0a98be125fa387d357552c3779eff311e2b1484b Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 21:54:45 -0500 Subject: [PATCH] Add src/MD/think.jl --- src/MD/think.jl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/MD/think.jl diff --git a/src/MD/think.jl b/src/MD/think.jl new file mode 100644 index 00000000..511cd0e8 --- /dev/null +++ b/src/MD/think.jl @@ -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