From 0ab37c3814f2638130de88d2e83dcf5c649cc7ef Mon Sep 17 00:00:00 2001 From: vyudu Date: Wed, 4 Sep 2024 09:02:53 -0400 Subject: [PATCH] revert, splitting off params-related changes --- src/dsl.jl | 16 ---------------- test/dsl/dsl_options.jl | 4 ---- 2 files changed, 20 deletions(-) diff --git a/src/dsl.jl b/src/dsl.jl index fa87a4f2d0..0f6514fbb7 100644 --- a/src/dsl.jl +++ b/src/dsl.jl @@ -348,12 +348,6 @@ function make_reaction_system(ex::Expr; name = :(gensym(:ReactionSystem))) variables))) species_extracted, parameters_extracted = extract_species_and_parameters!(reactions, declared_syms) - # Checks that all the symbols in the equation are declared. - eq_syms = extract_syms_eq(equations, union(declared_syms, species_extracted, parameters_extracted)) - if !isempty(eq_syms) - error("Symbols in equations must be explicitly defined using @variable, @species, or @parameter within the @reaction_network input.") - end - species = vcat(species_declared, species_extracted) parameters = vcat(parameters_declared, parameters_extracted) @@ -534,16 +528,6 @@ function extract_species_and_parameters!(reactions, excluded_syms) collect(species), collect(parameters) end -# Find undeclared symbols in the RHS of the equations. -function extract_syms_eq(equations, excluded_syms) - syms = OrderedSet{Union{Symbol, Expr}}() - for eq in equations - add_syms_from_expr!(syms, eq.args[3], excluded_syms) - end - - collect(syms) -end - # Function called by extract_species_and_parameters!, recursively loops through an # expression and find symbols (adding them to the push_symbols vector). function add_syms_from_expr!(push_symbols::AbstractSet, rateex::ExprValues, excluded_syms) diff --git a/test/dsl/dsl_options.jl b/test/dsl/dsl_options.jl index b01e053291..35778c97b9 100644 --- a/test/dsl/dsl_options.jl +++ b/test/dsl/dsl_options.jl @@ -166,10 +166,6 @@ let @species A(t) @test isequal(equations(rn)[1], D(A) ~ 2*A*t) - # Tests that error is declared. - @test_throws LoadError @eval @reaction_network begin - @equations D(A) ~ hill(A, v, K, n) - end # Test Catalyst function rn2 = @reaction_network begin