File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -518,8 +518,8 @@ struct ReactionSystem{V <: NetworkProperties} <:
518
518
complete:: Bool = false ; checks:: Bool = true )
519
519
# Filters away any potential obervables from `states` and `spcs`.
520
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)
521
+ states = filter (state -> ! any ( isequal ( state, obs_var) for obs_var in obs_vars), states)
522
+ spcs = filter (spc -> ! any ( isequal ( spc, obs_var) for obs_var in obs_vars), spcs)
523
523
524
524
# unit checks are for ODEs and Reactions only currently
525
525
nonrx_eqs = Equation[eq for eq in eqs if eq isa Equation]
Original file line number Diff line number Diff line change 478
478
end
479
479
480
480
# Declares observables implicitly/explicitly.
481
+ # Cannot test `isequal(rn1, rn2)` because the two sets of observables have some obscure Symbolics
482
+ # substructure that is different.
481
483
let
482
484
# Basic case.
483
485
rn1 = @reaction_network rn_observed begin
489
491
@observables X ~ X1 + X2
490
492
k, 0 --> X1 + X2
491
493
end
492
- @test_broken isequal (rn1, rn2)
494
+ @test isequal (observed (rn1)[1 ]. rhs, observed (rn2)[1 ]. rhs)
495
+ @test isequal (observed (rn1)[1 ]. lhs. metadata, observed (rn2)[1 ]. lhs. metadata)
496
+ @test isequal (states (rn1), states (rn2))
493
497
494
498
# Case with metadata.
495
499
rn3 = @reaction_network rn_observed begin
501
505
@observables X ~ X1 + X2
502
506
k, 0 --> X1 + X2
503
507
end
504
- @test_broken isequal (rn3, rn4)
508
+ @test isequal (observed (rn3)[1 ]. rhs, observed (rn4)[1 ]. rhs)
509
+ @test isequal (observed (rn3)[1 ]. lhs. metadata, observed (rn4)[1 ]. lhs. metadata)
510
+ @test isequal (states (rn3), states (rn4))
505
511
end
506
512
507
513
# Tests various erroneous declarations throw errors.
You can’t perform that action at this time.
0 commit comments