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
I'm running into an issue with map in AlgebraicPetri even though the types align correctly. Here is an example to replicate the bug (this example does require the AlgebraicPetri package):
using AlgebraicPetri
# Create a labelled reaction net with integer concentrations and rates# and tuples of symbols
tuple_rxn = AlgebraicPetri.LabelledReactionNetUntyped{Int,Int,Tuple{Symbol,Symbol}}()
add_species!(tuple_rxn, 3, sname=((:U, :S), (:U, :I), (:U, :R)), concentration=(1, 1, 1))
add_transitions!(tuple_rxn, 2, tname=((:Q, :inf), (:Q, :rec)), rate=(1, 1))
# Create a simple function to convert nested tuples of symbols to a single Symbolflat_symbol(sym::Symbol)::Symbol= sym
flat_symbol(sym::Tuple)::Symbol=mapreduce(x ->isa(x, Tuple) ?flat_symbol(x) : x, (x, y) ->Symbol(x, "_", y), sym)
# Map this `flat_symbol` function to all Name types# (`tname` and `sname` parts)map(tuple_rxn, Name=flat_symbol)
Also to note I get the same behavior even if I specify the parts in particular with
I'm running into an issue with
map
in AlgebraicPetri even though the types align correctly. Here is an example to replicate the bug (this example does require theAlgebraicPetri
package):Also to note I get the same behavior even if I specify the parts in particular with
This results in the following error:
The text was updated successfully, but these errors were encountered: