@@ -43,14 +43,32 @@ function MTKParameters(
4343 p = merge (defs, p)
4444 p = merge (Dict (unwrap (k) => v for (k, v) in p),
4545 Dict (default_toterm (unwrap (k)) => v for (k, v) in p))
46- p = Dict (k => fixpoint_sub (v, p) for (k, v) in p)
46+ p = Dict (unwrap (k) => fixpoint_sub (v, p) for (k, v) in p)
4747 for (sym, _) in p
4848 if istree (sym) && operation (sym) === getindex &&
4949 first (arguments (sym)) in all_ps
5050 error (" Scalarized parameter values ($sym ) are not supported. Instead of `[p[1] => 1.0, p[2] => 2.0]` use `[p => [1.0, 2.0]]`" )
5151 end
5252 end
5353
54+ missing_params = Set ()
55+ for idxmap in (ic. tunable_idx, ic. discrete_idx, ic. constant_idx, ic. nonnumeric_idx)
56+ for sym in keys (idxmap)
57+ sym isa Symbol && continue
58+ haskey (p, sym) && continue
59+ hasname (sym) && haskey (p, getname (sym)) && continue
60+ ttsym = default_toterm (sym)
61+ haskey (p, ttsym) && continue
62+ hasname (ttsym) && haskey (p, getname (ttsym)) && continue
63+
64+ istree (sym) && operation (sym) === getindex && haskey (p, arguments (sym)[1 ]) &&
65+ continue
66+ push! (missing_params, sym)
67+ end
68+ end
69+
70+ isempty (missing_params) || throw (MissingVariablesError (collect (missing_params)))
71+
5472 tunable_buffer = Tuple (Vector {temp.type} (undef, temp. length)
5573 for temp in ic. tunable_buffer_sizes)
5674 disc_buffer = Tuple (Vector {temp.type} (undef, temp. length)
0 commit comments