Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TorkelE opened this issue Oct 5, 2023 · 1 comment
Open

Comments

@TorkelE
Copy link
Member

TorkelE commented Oct 5, 2023

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.

@TorkelE
Copy link
Member Author

TorkelE commented Jan 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant