From e20d90da62caee851dcf65fa5cd187340da10f47 Mon Sep 17 00:00:00 2001 From: vyudu Date: Wed, 4 Sep 2024 07:51:38 -0400 Subject: [PATCH] undo param-inferring --- src/dsl.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dsl.jl b/src/dsl.jl index a4722393d9..c0f65e84e5 100644 --- a/src/dsl.jl +++ b/src/dsl.jl @@ -315,12 +315,12 @@ function make_reaction_system(ex::Expr; name = :(gensym(:ReactionSystem))) parameters_declared = extract_syms(options, :parameters) variables_declared = extract_syms(options, :variables) - # Reads more options. + # Reads equations. vars_extracted, add_default_diff, equations = read_equations_options( options, variables_declared) variables = vcat(variables_declared, vars_extracted) - # handle independent variables + # Handle independent variables if haskey(options, :ivs) ivs = Tuple(extract_syms(options, :ivs)) ivexpr = copy(options[:ivs]) @@ -339,17 +339,15 @@ function make_reaction_system(ex::Expr; name = :(gensym(:ReactionSystem))) combinatoric_ratelaws = true end - # Reads more options. + # Reads observables. observed_vars, observed_eqs, obs_syms = read_observed_options( options, [species_declared; variables], all_ivs) + # Collect species and parameters, including ones inferred from the reactions. declared_syms = Set(Iterators.flatten((parameters_declared, species_declared, variables))) species_extracted, parameters_extracted = extract_species_and_parameters!(reactions, declared_syms) - parameters_extracted_eq = extract_parameters_eq(equations, declared_syms) - parameters_extracted = vcat(parameters_extracted, parameters_extracted_eq) - species = vcat(species_declared, species_extracted) parameters = vcat(parameters_declared, parameters_extracted) @@ -383,6 +381,7 @@ function make_reaction_system(ex::Expr; name = :(gensym(:ReactionSystem))) push!(rxexprs.args, equation) end + # Output code corresponding to the reaction system. quote $ivexpr $ps