You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reaction_network.jl
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -705,8 +705,13 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
705
705
isempty(ivs) ||error("An observable ($obs_name) was given independent variable(s). These should not be given, as they are inferred automatically.")
706
706
isnothing(defaults) ||error("An observable ($obs_name) was given a default value. This is forbidden.")
707
707
in(obs_name, forbidden_symbols_error) &&error("A forbidden symbol ($(obs_eq.args[2])) was used as an observable name.")
708
-
if (obs_name in species_n_vars_declared) ||is_escaped_expr(obs_eq.args[2])
709
-
isnothing(metadata) ||error("Metadata was provided to observable $obs_name in the `@observables` macro. However, the obervable was also declared separately (using either @species or @variables). When this is done, metadata should instead be provided within the original @species or @variable declaration.")
708
+
709
+
# Error checks.
710
+
if (obs_name in species_n_vars_declared) &&is_escaped_expr(obs_eq.args[2])
711
+
error("An interpoalted observable have been used, which has also been explicitly delcared within the system using eitehr @species or @variables. This is not permited.")
712
+
end
713
+
if ((obs_name in species_n_vars_declared) ||is_escaped_expr(obs_eq.args[2])) &&!isnothing(metadata)
714
+
error("Metadata was provided to observable $obs_name in the `@observables` macro. However, the obervable was also declared separately (using either @species or @variables). When this is done, metadata should instead be provided within the original @species or @variable declaration.")
710
715
end
711
716
712
717
# This bits adds the observables to the @variables vector which is given as output.
@@ -733,7 +738,8 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
733
738
734
739
# Adds the observable to the list of observable names.
735
740
# This is required for filtering away so these are not added to the ReactionSystem's species list.
736
-
push!(obs_syms.args, obs_name)
741
+
# Again, avoid this check if we have interpoalted teh variable.
0 commit comments