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: docs/src/catalyst_functionality/dsl_description.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -623,4 +623,13 @@ Finally, some general rules for creating observables:
623
623
- The left-hand side of the observables expression must be a single symbol, indicating the observable's name.
624
624
- Metadata can, however, be provided, e.g through `@observables (Xtot, [description="Total amount of X"]) ~ X + XY`.
625
625
- The right-hand side of the observables expression can be any valid algebraic expression.
626
-
- Observables are (by default, but this can be changed) considered `variables` (and not `species`). This can be changed by e.g. pre-declaring them using the `@species` option.
626
+
- Observables are (by default, but this can be changed) considered `variables` (and not `species`). This can be changed by e.g. pre-declaring them using the `@species` option:
isempty(ivs) ||error("An observable ($obs_name) was given independent variable(s). These should not be given, as they are inferred automatically.")
705
706
isnothing(defaults) ||error("An observable ($obs_name) was given a default value. This is forbidden.")
706
707
in(obs_name, forbidden_symbols_error) &&error("A forbidden symbol ($(obs_eq.args[2])) was used as an observable name.")
707
-
if (obs_name inspecies_declared)
708
+
if (obs_name inspecies_n_vars_declared) ||is_escaped_expr(obs_eq.args[2])
708
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.")
709
-
continue
710
710
end
711
711
712
-
# Appends (..) to the observable (which is later replaced with the extracted ivs).
713
-
# Adds the observable to the first line of the output expression (starting with `@variables`).
0 commit comments