ReactionNetworkImporters.jl
ReactionNetworkImporters.jl copied to clipboard
Internal conversion of integer Float values (e.g. `1.0`) to Int (e.g. 1)
I have a BCR model stored in a .net file. If I try this:
using Catalyst, JumpProcesses
using ReactionNetworkImporters
BCR = loadrxnetwork(BNGNetwork(), "BCR.net")
d_prob = remake(d_prob; u0=Int64.(d_prob.u0))
j_prob = JumpProblem(BCR.rn, d_prob, RSSACR(); save_positions=(false,false))
sol = solve(j_prob, SSAStepper(); saveat=0.1);
I get an error since some initial condition end up as a Float. Instead, I have to add this line:
d_prob = remake(d_prob; u0=Int64.(d_prob.u0))
It would be neat to automatically convert stuff that is Float to Ints. This example is slightly more complicated, as the non-zero initial conditions are set by parameters, which values are Floats.
Basically, this would require the automatic conversion of integer parameter values from the Float64 to the Int64 form. I don't think this is generally done in the system, so while it might be convenient for certain cases, it might still be undesired.