Skip to content

Internal conversion of integer Float values (e.g. 1.0) to Int (e.g. 1) #106

@TorkelE

Description

@TorkelE

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions