Skip to content

Commit

Permalink
revert, splitting off params-related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vyudu committed Sep 4, 2024
1 parent 05f1a72 commit 0ab37c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
16 changes: 0 additions & 16 deletions src/dsl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions test/dsl/dsl_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ab37c3

Please sign in to comment.