Skip to content

Commit

Permalink
Merge pull request #3203 from CliMA/ne/hotfix
Browse files Browse the repository at this point in the history
Add warning for unused keys in config
  • Loading branch information
nefrathenrici authored Jul 17, 2024
2 parents 6d10b27 + 9d16a3b commit ea609a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/solver/yaml_helper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ function override_default_config(config_dict::AbstractDict;)
end
end

unused_keys = filter(k -> !haskey(default_config, k), keys(config_dict))
if !isempty(unused_keys)
@warn "The configuration passed to ClimaAtmos contains unused keys: $(join(unused_keys, ", "))"
end

# The "diagnostics" entry is a more complex type that doesn't fit the schema described in
# the previous lines. So, we manually add it.
if haskey(config_dict, "diagnostics")
Expand Down

0 comments on commit ea609a4

Please sign in to comment.