Skip to content

Commit 0e30632

Browse files
committed
up
1 parent 439a002 commit 0e30632

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/spatial_reaction_systems/spatial_reactions.jl

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,14 @@ end
108108

109109
# Since MTK's "isequal" ignores metadata, we have to use a special function that accounts for this.
110110
# This is important because whether something is an edge parameter is defined in metadata.
111-
const ep_metadata = [Catalyst.EdgeParameter => true]
111+
const ep_metadata = Catalyst.EdgeParameter => true
112112
function isequivalent(sym1, sym2)
113113
isequal(sym1, sym2) || (return false)
114-
in_skip_ep_metadata(md1, md2) || (return false)
115-
in_skip_ep_metadata(md2, md1) || (return false)
114+
any((md1 != ep_metadata) && !(md1 in sym2.metadata) for md1 in sym1.metadata) && (return false)
115+
any((md2 != ep_metadata) && !(md2 in sym1.metadata) for md2 in sym2.metadata) && (return false)
116116
(typeof(sym1) != typeof(sym2)) && (return false)
117117
return true
118118
end
119-
# Checks if metadata 1 is in metadata 2 (but always return true if md1 is the edge parameter metadata.
120-
function in_skip_ep_metadata(md1, md2)
121-
(md1 == ep_metadata) && (return true)
122-
for md1 in sym1.metadata
123-
(md1 in md2) || return false
124-
end
125-
return true
126-
end
127119

128120
# Implements custom `==`.
129121
"""

0 commit comments

Comments
 (0)