Closed joefresna closed 7 years ago
round_to_1(x) should return an error if x is zero because of the definition of this function. This function is only used for axis formatting where the input is the plotting range, e.g. xmax-xmin on the x-axis. This cannot be zero.
I get this error when I launch SSA for Lotka-Volterra with the initial condition: A:10 Y:0 X:0 The SSA returns only flat lines, thus ymax-ymin=0.
Maybe it's enough to do if x == 0: x = 0.00000001
yes, you can make this modifiction, or you use the new keyword choose_yrange = [y1,y2], and set values if your data gives zero
The suggested change: if x == 0: x = 0.00000001
generates other issues.
Instead, if x == 0: return 1
works without issues.
@tbose1, I don't how you use it and what should return when x is zero. But I get an error, because sometimes in my code it's called with x=0. I (temporarily) put that returns 1... Please, check if correct.