SciML / SciML/JumpProcesses.jl
Better documentation of `remake` mutating original problems
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 150
- Forks
- 41
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 28
Description
Normally remake does not affect the input problems. However, for JumpProblem this is the case:
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the remake entry point and the JumpProblem handling, then run the Julia reproduction in the issue to observe mutation of massaction_jump.scaled_rates. Done means documenting the current behavior and adding a keyword option that prevents mutation by deep-copying the input problem.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100