Skip to content

Commit

Permalink
Merge pull request #19 from daschw/weights
Browse files Browse the repository at this point in the history
fix: accept Integer as weights in config
  • Loading branch information
daschw authored Sep 27, 2024
2 parents 911d03d + 163b1ef commit e9a6248
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ function _ConfigSnapshots(config::Dict{String, Any})
@warn "Detected precompilation... limiting Snapshot count" original = config["count"] new = count
end

weight_config = get(config, "weights", nothing)
weights = weight_config isa Real ? float(weight_config) : weight_config

return _ConfigSnapshots(
count,
get(config, "offset", 0),
get(config, "names", nothing),
get(config, "weights", nothing),
weights,
get(config, "representatives", nothing),
get(config, "aggregate", nothing),
)
Expand Down

0 comments on commit e9a6248

Please sign in to comment.