Skip to content

Commit

Permalink
stricter typing
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Oct 27, 2023
1 parent 47a098b commit df3be00
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/MacroModelling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ function solve_steady_state!(𝓂::β„³, symbolic_SS, Symbolics::symbolics; verbo

SS_solve_func = []

atoms_in_equations = Set()
atoms_in_equations = Set{Symbol}()
atoms_in_equations_list = []
relevant_pars_across = []
NSSS_solver_cache_init_tmp = []
Expand Down Expand Up @@ -1335,7 +1335,7 @@ function solve_steady_state!(𝓂::β„³, symbolic_SS, Symbolics::symbolics; verbo
push!(𝓂.solved_vals,Meta.parse(string(soll[1])))

# atoms = reduce(union,soll[1].atoms())
[push!(atoms_in_equations, a) for a in soll[1].atoms()]
[push!(atoms_in_equations, Symbol(a)) for a in soll[1].atoms()]
push!(atoms_in_equations_list, Set(Symbol.(soll[1].atoms())))
# println(atoms_in_equations)
# push!(atoms_in_equations, soll[1].atoms())
Expand Down Expand Up @@ -1393,7 +1393,7 @@ function solve_steady_state!(𝓂::β„³, symbolic_SS, Symbolics::symbolics; verbo
# relevant_pars = reduce(union,map(x->x.atoms(),collect(soll[1])))
atoms = reduce(union,map(x->x.atoms(),collect(soll[1])))
# println(atoms)
[push!(atoms_in_equations, a) for a in atoms]
[push!(atoms_in_equations, Symbol(a)) for a in atoms]

for (k, vars) in enumerate(vars_to_solve)
push!(𝓂.solved_vars,Symbol(vars))
Expand Down Expand Up @@ -1685,7 +1685,7 @@ function solve_steady_state!(𝓂::β„³, symbolic_SS, Symbolics::symbolics; verbo
parameters_in_equations = []

for (i, parss) in enumerate(𝓂.parameters)
if parss ∈ union(Symbol.(atoms_in_equations),relevant_pars_across)
if parss ∈ union(atoms_in_equations, relevant_pars_across)
push!(parameters_in_equations,:($parss = params[$i]))
end
end
Expand Down Expand Up @@ -1736,7 +1736,7 @@ function solve_steady_state!(𝓂::β„³, symbolic_SS, Symbolics::symbolics; verbo
# fix parameter bounds
par_bounds = []

for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(Symbol.(atoms_in_equations),relevant_pars_across)))
for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(atoms_in_equations, relevant_pars_across)))
i = indexin([varpar],𝓂.bounded_vars)
push!(par_bounds, :($varpar = min(max($varpar,$(𝓂.lower_bounds[i...])),$(𝓂.upper_bounds[i...]))))
end
Expand Down Expand Up @@ -1837,7 +1837,7 @@ function solve_steady_state!(𝓂::β„³; verbose::Bool = false)

SS_solve_func = []

atoms_in_equations = Set()
atoms_in_equations = Set{Symbol}()
atoms_in_equations_list = []
relevant_pars_across = []
NSSS_solver_cache_init_tmp = []
Expand Down Expand Up @@ -2050,7 +2050,7 @@ function solve_steady_state!(𝓂::β„³; verbose::Bool = false)
parameters_in_equations = []

for (i, parss) in enumerate(𝓂.parameters)
if parss ∈ union(Symbol.(atoms_in_equations),relevant_pars_across)
if parss ∈ union(atoms_in_equations, relevant_pars_across)
push!(parameters_in_equations,:($parss = params[$i]))
end
end
Expand Down Expand Up @@ -2092,7 +2092,7 @@ function solve_steady_state!(𝓂::β„³; verbose::Bool = false)
# fix parameter bounds
par_bounds = []

for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(Symbol.(atoms_in_equations),relevant_pars_across)))
for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(atoms_in_equations, relevant_pars_across)))
i = indexin([varpar],𝓂.bounded_vars)
push!(par_bounds, :($varpar = min(max($varpar,$(𝓂.lower_bounds[i...])),$(𝓂.upper_bounds[i...]))))
end
Expand Down

0 comments on commit df3be00

Please sign in to comment.