Skip to content

Commit

Permalink
Fix StaticConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Nov 20, 2023
1 parent 4c2905d commit 6eee4a2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/MD/Config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ end

@option struct StaticConfig <: AbstractConfig
recipe::String
templates::Vector{String}
template::String
at::Union{Pressures,Volumes}
io::IO = IO()
data::Data = Data()
cli::SoftwareConfig
function StaticConfig(recipe, templates, at, io, data, cli)
function StaticConfig(recipe, template, at, io, data, cli)
@assert recipe in ("md", "vc-md")
for template in templates
if !isfile(template)
@warn "I cannot find template file `$template`!"
end
if !isfile(template)
@warn "I cannot find template file `$template`!"
end
return new(recipe, templates, at, io, data, cli)
return new(recipe, template, at, io, data, cli)
end
end

Expand All @@ -60,7 +58,7 @@ function expand(config::StaticConfig, calculation::Calculation)
conf = Conf()
conf.cli = config.cli
conf.calculation = calculation
_update!(conf, config.templates)
_update!(conf, config.template)
_update!(conf, config.at)
_update!(conf, config.io, config.at)
_update!(conf, config.data)
Expand Down

0 comments on commit 6eee4a2

Please sign in to comment.