Skip to content

Commit 334ccb2

Browse files
committed
chaneg names
1 parent 913e5f6 commit 334ccb2

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/network_analysis.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -542,21 +542,21 @@ end
542542

543543
### Conservation Laws ###
544544

545-
# Implements the `conservationquantity` parameter metadata.
545+
# Implements the `conserved` parameter metadata.
546546
struct ConservedParameter end
547-
Symbolics.option_to_metadata_type(::Val{:conserved}) = ConservationQuantity
547+
Symbolics.option_to_metadata_type(::Val{:conserved}) = ConservedParameter
548548

549549
"""
550-
isconservationquantity(p)
550+
isconserved(p)
551551
552-
Checks if the input parameter (`p`) is a conserved quantity (i.e. have the `conservationquantity`)
552+
Checks if the input parameter (`p`) is a conserved quantity (i.e. have the `conserved`)
553553
metadata.
554554
"""
555-
isconservationquantity(x::Num, args...) = isconservationquantity(Symbolics.unwrap(x), args...)
556-
function isconservationquantity(x, default = false)
555+
isconserved(x::Num, args...) = isconserved(Symbolics.unwrap(x), args...)
556+
function isconserved(x, default = false)
557557
p = Symbolics.getparent(x, nothing)
558558
p === nothing || (x = p)
559-
Symbolics.getmetadata(x, ConservationQuantity, default)
559+
Symbolics.getmetadata(x, ConservedParameter, default)
560560
end
561561

562562
"""
@@ -653,7 +653,7 @@ function cache_conservationlaw_eqs!(rn::ReactionSystem, N::AbstractMatrix, col_o
653653
depidxs = col_order[(r + 1):end]
654654
depspecs = sts[depidxs]
655655
constants = MT.unwrap.(MT.scalarize(only(
656-
@parameters $(CONSERVED_CONSTANT_SYMBOL)[1:nullity] [conservationquantity=true])))
656+
@parameters $(CONSERVED_CONSTANT_SYMBOL)[1:nullity] [conserved=true])))
657657

658658
conservedeqs = Equation[]
659659
constantdefs = Equation[]

test/network_analysis/conservation_laws.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ let
144144
@test isapprox(g2[istsidxs, :], g3)
145145
end
146146

147-
### ConservedQuantity Metadata Tests ###
147+
### ConservedParameter Metadata Tests ###
148148

149-
# Checks that `conservationquantity` metadata is added correctly to parameters.
150-
# Checks that the `isconservationquantity` getter function works correctly.
149+
# Checks that `conserved` metadata is added correctly to parameters.
150+
# Checks that the `isconserved` getter function works correctly.
151151
let
152152
# Creates ODESystem with conserved quantities.
153153
rs = @reaction_network begin
@@ -156,9 +156,9 @@ let
156156
end
157157
osys = convert(ODESystem, rs; remove_conserved = true)
158158

159-
# Checks that the correct parameters have the `conservationquantity` metadata.
160-
@test Catalyst.isconservationquantity(osys.Γ[1])
161-
@test Catalyst.isconservationquantity(osys.Γ[2])
162-
@test !Catalyst.isconservationquantity(osys.k1)
163-
@test !Catalyst.isconservationquantity(osys.k2)
159+
# Checks that the correct parameters have the `conserved` metadata.
160+
@test Catalyst.isconserved(osys.Γ[1])
161+
@test Catalyst.isconserved(osys.Γ[2])
162+
@test !Catalyst.isconserved(osys.k1)
163+
@test !Catalyst.isconserved(osys.k2)
164164
end

0 commit comments

Comments
 (0)