Skip to content

Commit 37f3175

Browse files
committed
up
1 parent 25ba99b commit 37f3175

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/src/catalyst_functionality/dsl_description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,4 +623,4 @@ Finally, some general rules for creating observables:
623623
- The left-hand side of the observables expression must be a single symbol, indicating the observable's name.
624624
- Metadata can, however, be provided, e.g through `@observables (Xtot, [description="Total amount of X"]) ~ X + XY`.
625625
- 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`).
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.

src/reactionsystem.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ struct ReactionSystem{V <: NetworkProperties} <:
516516
function ReactionSystem(eqs, rxs, iv, sivs, states, spcs, ps, var_to_name, observed,
517517
name, systems, defaults, connection_type, nps, cls, cevs, devs,
518518
complete::Bool = false; checks::Bool = true)
519+
# Filters away any potential obervables from `states` and `spcs`.
520+
obs_vars = [obs_eq.lhs for obs_eq in observed]
521+
states = filter(state -> !in(state, obs_vars), states)
522+
spcs = filter(spc -> !in(spc, obs_vars), spcs)
519523

520524
# unit checks are for ODEs and Reactions only currently
521525
nonrx_eqs = Equation[eq for eq in eqs if eq isa Equation]

0 commit comments

Comments
 (0)