Open TorkelE opened 5 months ago
Normally remake does not affect the input problems. However, for JumpProblem this is the case:
remake
JumpProblem
using Catalyst, JumpProcesses # Creates the model. rn = @reaction_network begin p1*p2, A + B --> C end @unpack p1, p2 = rn u0 = [:A => 1, :B => 2, :C => 3] ps = [:p1 => 3.0, :p2 => 2.0] dprob = DiscreteProblem(rn, u0, (0.0, 1.0), ps) jprob = JumpProblem(rn, dprob, Direct()) jprob.massaction_jump.scaled_rates[1] # Returns 6.0. jprob2 = remake(jprob; p = [p1 => 0.0]) jprob.massaction_jump.scaled_rates[1] # returns 0.0 jprob2.massaction_jump.scaled_rates[1] # returns 0.0
This should be documented properly, and a kwarg added to instead make a deepcopy of the input problem (so that there is no mutation).
Normally
remake
does not affect the input problems. However, forJumpProblem
this is the case:This should be documented properly, and a kwarg added to instead make a deepcopy of the input problem (so that there is no mutation).