Skip to content

Commit

Permalink
throw informative error if var defined only in ss
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Jan 20, 2024
1 parent e4fa92c commit 10e1317
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,11 @@ macro model(𝓂,ex...)
dyn_var_past = sort(collect(reduce(union,dyn_var_past_list)))
dyn_var_ss = sort(collect(reduce(union,dyn_ss_list)))

all_vars = union(dyn_var_future, dyn_var_present, dyn_var_past, dyn_var_ss)
all_dyn_vars = union(dyn_var_future, dyn_var_present, dyn_var_past)

@assert length(setdiff(dyn_var_ss, all_dyn_vars)) == 0 "The following variables are (and cannot be) defined only in steady state (`[ss]`): $(setdiff(dyn_var_ss, all_dyn_vars))"

all_vars = union(all_dyn_vars, dyn_var_ss)

present_only = sort(setdiff(dyn_var_present,union(dyn_var_past,dyn_var_future)))
future_not_past = sort(setdiff(dyn_var_future, dyn_var_past))
Expand Down

0 comments on commit 10e1317

Please sign in to comment.