Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Jul 13, 2024
1 parent c5c00e6 commit 3f92a31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/dsl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,13 @@ function push_reactions!(reactions::Vector{ReactionInternal}, subs::ExprValues,
push!(metadata_i.args, :(only_use_rate = $(in(arrow, pure_rate_arrows))))
end

# Checks that metadata fields are unqiue.
# Checks that metadata fields are unique.
if !allunique(arg.args[1] for arg in metadata_i.args)
error("Some reaction metadata fields where repeated: $(metadata_entries)")
end

push!(reactions,
ReactionStruct(get_tup_arg(sub_line, i),
get_tup_arg(prod_line, i), get_tup_arg(rate, i), metadata_i))
push!(reactions, ReactionInternal(get_tup_arg(subs, i),
get_tup_arg(prods, i), get_tup_arg(rate, i), metadata_i))
end
end

Expand Down
7 changes: 3 additions & 4 deletions src/expression_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function esc_dollars!(ex)
end
end

return ex
ex
end

# Checks if an expression is an escaped expression (e.g. on the form `$(Expr(:escape, :Y))`)
Expand Down Expand Up @@ -42,9 +42,8 @@ end

# Checks that no symbol was sued for multiple purposes.
function unique_symbol_check(syms)
if !allunique(syms)
error("Reaction network independent variables, parameters, species, and variables must all have distinct names, but a duplicate has been detected. ")
end
allunique(syms) && return
error("Reaction network independent variables, parameters, species, and variables must all have distinct names, but a duplicate has been detected. ")
end

### Catalyst-specific Expressions Manipulation ###
Expand Down

0 comments on commit 3f92a31

Please sign in to comment.